/* ╔══════════════════════════════════════════════════════════════════════════════╗
   ║                    WHATSAPP WEB CLONE - ESTILOS                             ║
   ║                                                                              ║
   ║  Archivo: 26-conversation-results.css                                        ║
   ║  Descripción: Estilos para el panel de resultados de conversación           ║
   ╚══════════════════════════════════════════════════════════════════════════════╝ */

/* ═══════════════════════════════════════════════════════════
   BADGE DEL BOTÓN
   ═══════════════════════════════════════════════════════════ */

#conversationResultsBtn {
    position: relative;
}

.cr-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #00a884;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════
   MODAL PRINCIPAL
   ═══════════════════════════════════════════════════════════ */

#conversationResultsModal .modal-content {
    width: 95% !important;
    max-width: 1400px !important;
    min-width: 800px;
    height: 90vh !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#conversationResultsModal .modal-body {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cr-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-color, #111b21);
}

/* ═══════════════════════════════════════════════════════════
   ESTADÍSTICAS
   ═══════════════════════════════════════════════════════════ */

.cr-stats-bar {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--panel-bg, #202c33);
    border-bottom: 1px solid var(--border-color, #2a3942);
    overflow-x: auto;
}

.cr-stat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-color, #111b21);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    border: 2px solid transparent;
}

.cr-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cr-stat-card.active {
    border-color: var(--primary-color, #00a884);
}

.cr-stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 18px;
}

.cr-stat-total .cr-stat-icon {
    background: rgba(100, 100, 100, 0.2);
    color: #adb5bd;
}

.cr-stat-pending .cr-stat-icon {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.cr-stat-completed .cr-stat-icon {
    background: rgba(0, 168, 132, 0.2);
    color: #00a884;
}

.cr-stat-cancelled .cr-stat-icon {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.cr-stat-resolved .cr-stat-icon {
    background: rgba(102, 16, 242, 0.2);
    color: #6610f2;
}

.cr-stat-info {
    display: flex;
    flex-direction: column;
}

.cr-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #e9edef);
}

.cr-stat-label {
    font-size: 12px;
    color: var(--text-secondary, #8696a0);
}

/* ═══════════════════════════════════════════════════════════
   FILTROS
   ═══════════════════════════════════════════════════════════ */

.cr-filters-bar {
    padding: 12px 20px;
    background: var(--panel-bg, #202c33);
    border-bottom: 1px solid var(--border-color, #2a3942);
}

.cr-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cr-filter-label {
    font-size: 13px;
    color: var(--text-secondary, #8696a0);
}

.cr-filter-group select {
    background: var(--bg-color, #111b21);
    border: 1px solid var(--border-color, #2a3942);
    color: var(--text-primary, #e9edef);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    min-width: 200px;
}

.cr-filter-group select:focus {
    outline: none;
    border-color: var(--primary-color, #00a884);
}

/* ═══════════════════════════════════════════════════════════
   LISTA DE RESULTADOS
   ═══════════════════════════════════════════════════════════ */

.cr-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.cr-loading,
.cr-error,
.cr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary, #8696a0);
    text-align: center;
}

.cr-loading i,
.cr-error i,
.cr-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cr-error {
    color: #dc3545;
}

/* ═══════════════════════════════════════════════════════════
   TARJETAS DE RESULTADO
   ═══════════════════════════════════════════════════════════ */

.cr-card {
    background: var(--panel-bg, #202c33);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.cr-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cr-card.cr-status-pending {
    border-left-color: #ffc107;
}

.cr-card.cr-status-completed {
    border-left-color: #00a884;
}

.cr-card.cr-status-cancelled {
    border-left-color: #dc3545;
}

.cr-card.cr-status-resolved {
    border-left-color: #6610f2;
}

.cr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #2a3942);
}

.cr-card-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.cr-action-badge {
    background: var(--primary-color, #00a884);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cr-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary, #e9edef);
    font-size: 14px;
    font-weight: 500;
}

.cr-phone i {
    color: var(--text-secondary, #8696a0);
    font-size: 12px;
}

.cr-contact-name {
    color: var(--text-secondary, #8696a0);
    font-size: 13px;
}

.cr-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.cr-status-badge.cr-status-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.cr-status-badge.cr-status-completed {
    background: rgba(0, 168, 132, 0.15);
    color: #00a884;
}

.cr-status-badge.cr-status-cancelled {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.cr-status-badge.cr-status-resolved {
    background: rgba(102, 16, 242, 0.15);
    color: #6610f2;
}

/* Card Body */
.cr-card-body {
    padding: 12px 16px;
}

.cr-data-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cr-data-tag {
    background: var(--bg-color, #111b21);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary, #8696a0);
}

.cr-data-tag strong {
    color: var(--text-primary, #e9edef);
    margin-right: 4px;
}

.cr-data-more {
    color: var(--primary-color, #00a884);
    font-size: 12px;
    padding: 6px 10px;
}

/* Card Footer */
.cr-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.1);
}

.cr-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary, #8696a0);
}

.cr-actions {
    display: flex;
    gap: 8px;
}

.cr-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.cr-btn-view {
    background: rgba(100, 100, 100, 0.2);
    color: #adb5bd;
}

.cr-btn-view:hover {
    background: rgba(100, 100, 100, 0.4);
    color: white;
}

.cr-btn-status {
    background: rgba(0, 168, 132, 0.2);
    color: #00a884;
}

.cr-btn-status:hover {
    background: rgba(0, 168, 132, 0.4);
}

.cr-btn-chat {
    background: rgba(0, 168, 132, 0.2);
    color: #00a884;
}

.cr-btn-chat:hover {
    background: rgba(0, 168, 132, 0.4);
}

.cr-btn-delete {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.cr-btn-delete:hover {
    background: rgba(220, 53, 69, 0.4);
}

.cr-btn-resolve {
    background: rgba(102, 16, 242, 0.2);
    color: #6610f2;
}

.cr-btn-resolve:hover {
    background: rgba(102, 16, 242, 0.4);
}

/* Estados vacíos */
.cr-no-phone {
    color: var(--text-secondary, #8696a0) !important;
    font-style: italic;
}

.cr-no-data {
    color: var(--text-secondary, #8696a0);
    font-size: 12px;
    font-style: italic;
    padding: 8px 0;
}

.cr-no-data i {
    margin-right: 6px;
}

/* Load More Button */
.cr-load-more {
    width: 100%;
    padding: 14px;
    background: var(--panel-bg, #202c33);
    border: 1px dashed var(--border-color, #2a3942);
    border-radius: 10px;
    color: var(--text-secondary, #8696a0);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.cr-load-more:hover {
    background: var(--bg-color, #111b21);
    color: var(--primary-color, #00a884);
    border-color: var(--primary-color, #00a884);
}

/* ═══════════════════════════════════════════════════════════
   MODAL DETALLE
   ═══════════════════════════════════════════════════════════ */

#conversationResultDetailModal .modal-content {
    width: 90% !important;
    max-width: 900px !important;
    min-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
}

.crd-header {
    padding: 20px;
    background: var(--panel-bg, #202c33);
    border-bottom: 1px solid var(--border-color, #2a3942);
}

.crd-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crd-action {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #e9edef);
}

.crd-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.crd-status.cr-status-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.crd-status.cr-status-completed {
    background: rgba(0, 168, 132, 0.15);
    color: #00a884;
}

.crd-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #2a3942);
}

.crd-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e9edef);
    margin: 0 0 12px 0;
}

.crd-section h4 i {
    color: var(--primary-color, #00a884);
}

.crd-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crd-phone {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary, #e9edef);
}

.crd-name {
    font-size: 14px;
    color: var(--text-secondary, #8696a0);
}

.crd-name-empty {
    font-size: 13px;
    color: var(--text-secondary, #8696a0);
    font-style: italic;
}

/* Data Table */
.crd-data-table {
    background: var(--bg-color, #111b21);
    border-radius: 8px;
    overflow: hidden;
}

.crd-data-row {
    display: flex;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color, #2a3942);
}

.crd-data-row:last-child {
    border-bottom: none;
}

.crd-data-key {
    flex: 0 0 120px;
    font-weight: 600;
    color: var(--text-primary, #e9edef);
    font-size: 13px;
}

.crd-data-value {
    flex: 1;
    color: var(--text-secondary, #8696a0);
    font-size: 13px;
    word-break: break-word;
}

.crd-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary, #8696a0);
    font-style: italic;
}

/* AI Response */
.crd-ai-response {
    border-left: 3px solid #00a884;
    padding-left: 16px;
}

.crd-ai-response h4 {
    color: #00a884 !important;
}

.crd-response-box {
    background: linear-gradient(135deg, rgba(0, 168, 132, 0.1) 0%, rgba(0, 168, 132, 0.05) 100%);
    border: 1px solid rgba(0, 168, 132, 0.3);
    border-radius: 8px;
    padding: 16px;
    color: var(--text-primary, #e9edef);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Dates */
.crd-dates {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crd-date-item {
    display: flex;
    gap: 10px;
}

.crd-date-label {
    font-weight: 500;
    color: var(--text-primary, #e9edef);
    font-size: 13px;
}

.crd-date-value {
    color: var(--text-secondary, #8696a0);
    font-size: 13px;
}

/* Actions */
.crd-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: var(--panel-bg, #202c33);
}

.crd-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crd-btn-chat {
    background: var(--primary-color, #00a884);
    color: white;
}

.crd-btn-chat:hover {
    background: #00916f;
}

.crd-btn-complete {
    background: rgba(0, 168, 132, 0.2);
    color: #00a884;
}

.crd-btn-complete:hover {
    background: rgba(0, 168, 132, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .cr-stats-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 12px 16px;
    }
    
    .cr-stat-card {
        min-width: 100px;
        padding: 10px 12px;
    }
    
    .cr-stat-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .cr-stat-value {
        font-size: 16px;
    }
    
    .cr-card-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .cr-card-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .cr-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .crd-data-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .crd-data-key {
        flex: none;
    }
    
    .crd-actions {
        flex-direction: column;
    }
}

