/* ==============================================
   LK-Demo Dashboard - Dashboard Styles
   ============================================== */

/* Call List Items */
.call-item {
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    margin: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.call-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.call-item.completed {
    background-color: #d1fae5;
    border-color: #a7f3d0;
}

.call-item.completed-no-evaluation {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.call-item.failed {
    background-color: #fee2e2;
    border-color: #fecaca;
}

.call-item.default {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.call-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.call-item-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.call-item-id {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.call-item-duration {
    color: #666;
    font-size: 13px;
}

.call-item-termination {
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
    padding: 2px 6px;
    background: #fee2e2;
    border-radius: 4px;
    display: inline-block;
}

.call-item-date {
    text-align: right;
    color: #666;
    font-size: 13px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error-state {
    text-align: center;
    padding: 40px;
    color: #f00;
}

/* Modal Styles */
.modal-content-container {
    max-height: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.modal-two-column {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Evaluation Section */
.evaluation-section {
    /* Left column container */
}

.ai-evaluation-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.section-indicator {
    width: 4px;
    height: 20px;
    border-radius: 2px;
}

.section-indicator.evaluation,
.section-indicator.ai-evaluation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.section-indicator.call-details {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.section-indicator.call-recording {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.section-indicator.no-data {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
}

.section-title {
    margin: 0;
    color: #1a202c;
    font-size: 16px;
    font-weight: 600;
}

.section-title.no-data {
    color: #718096;
}

.evaluation-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
}

.ai-evaluation-disposition {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: 8px;
    border-left: 4px solid #10b981;
}

.disposition-label {
    color: #065f46;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.disposition-value {
    font-size: 20px;
    font-weight: 700;
    color: #047857;
    text-transform: capitalize;
}

/* Disposition-specific colors */
.disposition-paid { color: #059669; }
.disposition-promise-to-pay { color: #d97706; }
.disposition-callback { color: #0891b2; }
.disposition-dispute { color: #dc2626; }
.disposition-not-interested { color: #6b7280; }

.evaluation-summary {
    margin-bottom: 16px;
}

.highlighted-summary {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #3b82f6;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.highlighted-summary .evaluation-label {
    color: #1e40af;
    font-size: 14px;
}

.highlighted-summary .evaluation-text {
    font-size: 15px;
    font-weight: 500;
    color: #1e3a8a;
}

.evaluation-label {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.evaluation-text {
    color: #1f2937;
    line-height: 1.5;
    font-size: 14px;
}

.evaluation-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.metric-item {
    text-align: center;
}

.metric-score {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.metric-score.high { color: #10B981; }
.metric-score.medium { color: #F59E0B; }
.metric-score.low { color: #EF4444; }

.metric-verified-yes { color: #10B981; }
.metric-verified-no { color: #EF4444; }

.metric-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.metric-outcome {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.evaluation-issues {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.metric-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.evaluation-other-fields {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.other-fields-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.issues-label {
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.issues-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.issue-tag {
    background: #fee2e2;
    color: #dc2626;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* No Data State */
.no-data-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #718096;
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Call Timeline */
.timeline-section {
    margin-top: 20px;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.timeline-indicator {
    width: 4px;
    height: 16px;
    background: #6B7280;
    border-radius: 2px;
}

.timeline-title {
    margin: 0;
    color: #1a202c;
    font-size: 14px;
    font-weight: 600;
}

.timeline-count {
    background: #f3f4f6;
    color: #4b5563;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}

.timeline-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    overflow: hidden;
}

.timeline-track {
    position: relative;
    height: 20px;
    margin: 0 10px;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
    transform: translateY(-50%);
}

.timeline-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.timeline-dot-circle {
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.timeline-dot-circle:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ToolCall Dots on Timeline */
.timeline-tool-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3; /* Above event dots */
}

.timeline-tool-dot-circle {
    width: 12px;
    height: 12px;
    background: #8B5CF6; /* Purple for tool calls */
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.timeline-tool-dot-circle:hover {
    transform: scale(1.3);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
    background: #7C3AED; /* Darker purple on hover */
}

/* Call Details Section */
.call-details-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
}

.call-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.call-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f7fafc;
}

.call-detail-item:last-child {
    border-bottom: none;
}

.call-detail-label {
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
}

.call-detail-value {
    color: #1f2937;
    font-weight: 600;
}

.call-detail-value.monospace {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 13px;
}

.call-detail-value-with-copy {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.completed {
    background: #10B981;
    color: white;
}

.status-badge.failed {
    background: #EF4444;
    color: white;
}

/* Copy Button */
.copy-button {
    padding: 2px 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #6b7280;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.copy-button:hover {
    background: #e5e7eb;
}

.copy-button.success {
    background: #10b981;
    color: white;
}

/* Event Tooltip */
.event-tooltip {
    position: fixed;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    transform: translateX(-50%) translateY(-120%);
}

.tooltip-event-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.tooltip-timestamp {
    color: #d1d5db;
    font-size: 11px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-two-column {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .call-item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .call-item-left {
        justify-content: space-between;
    }
    
    .call-item-date {
        text-align: left;
    }
    
    .evaluation-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .metric-score {
        font-size: 20px;
    }
    
    .timeline-track {
        margin: 0 5px;
    }
    
    .timeline-dot-circle {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
    
    .timeline-tool-dot-circle {
        width: 10px;
        height: 10px;
        border-width: 2px;
    }
    
    .call-detail-item {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        text-align: left;
    }
    
    .call-detail-value-with-copy {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .modal-content-container {
        max-height: 85vh;
        padding: 10px;
    }
    
    .modal-two-column {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .evaluation-card,
    .call-details-card {
        padding: 15px;
    }
    
    .section-title {
        font-size: 14px;
    }
    
    .evaluation-metrics {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .timeline-container {
        padding: 12px;
    }
    
    .timeline-dot-circle {
        width: 14px;
        height: 14px;
    }
    
    .timeline-tool-dot-circle {
        width: 8px;
        height: 8px;
        border-width: 1px;
    }
    
    .call-item {
        padding: 10px 12px;
        margin: 6px 0;
    }
    
    .call-item-id {
        font-size: 13px;
    }
    
    .call-item-duration,
    .call-item-date {
        font-size: 12px;
    }
}

/* Play Button Styles */
.play-button {
    margin-left: auto;
    padding: 6px 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.play-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.play-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.play-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.play-button svg {
    width: 16px;
    height: 16px;
}

/* Spinning animation for loading state */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.play-button svg.spin {
    animation: spin 1s linear infinite;
}

/* Recording Buttons (for inline play/download) */
.recording-button {
    padding: 6px 8px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.recording-button:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.recording-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.recording-button:first-child {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
}

.recording-button:first-child:hover {
    background: #2563eb;
    border-color: #1d4ed8;
}

/* Section indicator for call recording */
.section-indicator.call-recording {
    background: #8b5cf6;
}

/* Inline Audio Player Styling */
.audio-player-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
}

.inline-audio-player audio {
    width: 100%;
    height: 32px;
    background: white;
    border-radius: 4px;
}

/* Custom audio controls styling */
.inline-audio-player audio::-webkit-media-controls-panel {
    background-color: white;
    border-radius: 4px;
}

.inline-audio-player audio::-webkit-media-controls-play-button {
    background-color: #3b82f6;
    border-radius: 50%;
}

.inline-audio-player audio::-webkit-media-controls-current-time-display,
.inline-audio-player audio::-webkit-media-controls-time-remaining-display {
    color: #374151;
    font-size: 12px;
}
/* ==============================================
   Analytics Page Styles
   ============================================== */

/* Analytics Filters */
.analytics-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Analytics Stats Grid */
.analytics-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.analytics-stat {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.analytics-stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.analytics-stat-value.success {
    color: #28a745;
}

.analytics-stat-value.info {
    color: #17a2b8;
}

.analytics-stat-value.purple {
    color: #6f42c1;
}

.analytics-stat-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Collections Summary */
.analytics-collections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.analytics-collection-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.analytics-collection-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
}

.analytics-collection-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

/* Analytics Empty State */
.analytics-empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 16px;
}

/* Analytics B Container */
.analytics-b-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 16px;
}

.analytics-b-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

/* Analytics Table */
.analytics-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.analytics-table thead {
    background: #6b2d8c;
    color: white;
}

.analytics-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.analytics-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.analytics-table tbody tr:last-child {
    border-bottom: none;
}

.analytics-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
}

.analytics-table tbody tr:hover {
    background: #f8f9fa;
}

/* Purple Button */
.btn-purple {
    background: #6f42c1;
    color: white;
}

.btn-purple:hover {
    background: #5a32a3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analytics-b-container {
        grid-template-columns: 1fr;
    }

    .analytics-stats {
        grid-template-columns: 1fr 1fr;
    }

    .analytics-collections {
        grid-template-columns: 1fr;
    }

    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select,
    .filter-input {
        width: 100%;
    }
}

/* ==============================================
   Analytics Chart View Toggle
   ============================================== */

.card-header-with-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header-with-toggle h2 {
    margin: 0;
}

.view-toggle {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.toggle-btn {
    padding: 8px 16px;
    background-color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s;
    border-right: 1px solid #dee2e6;
}

.toggle-btn:last-child {
    border-right: none;
}

.toggle-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.toggle-btn.active {
    background-color: #6366f1;
    color: #fff;
}

.chart-container {
    padding: 10px;
    min-height: 200px;
}

/* Analytics Charts Grid Layout - Only active in chart view */
.analytics-charts-grid {
    display: block; /* Default: normal block layout for table view */
}

.charts-active .analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.charts-active .analytics-charts-grid .card {
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-header-with-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .view-toggle {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
        text-align: center;
    }

    .charts-active .analytics-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Re-evaluation Button Styles */
.btn-reevaluate {
    background: #6366f1;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.btn-reevaluate:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.btn-reevaluate:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.btn-reevaluate:active {
    transform: translateY(0);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
