/* Supervisor Console Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-box h1 {
    margin-bottom: 10px;
    color: #333;
}

.login-box .subtitle {
    color: #666;
    margin-bottom: 30px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.login-btn {
    display: block;
    padding: 14px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    color: white;
}

.login-btn.google {
    background: #4285f4;
}

.login-btn.google:hover {
    background: #357ae8;
}

.login-btn.microsoft {
    background: #00a4ef;
}

.login-btn.microsoft:hover {
    background: #0093d6;
}

.login-box .info {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 24px;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-logout {
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: #d32f2f;
}

.app-nav {
    background: white;
    padding: 0 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 30px;
}

.nav-item {
    padding: 16px 0;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.app-main {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.dashboard-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

/* Calls List */
.calls-list {
    min-height: 200px;
}

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

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

.call-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.call-from,
.call-to {
    font-weight: 600;
}

.call-duration {
    color: #999;
    font-size: 14px;
}

/* Transcription Feed */
.transcription-feed {
    max-height: 400px;
    overflow-y: auto;
    min-height: 200px;
}

.transcription-entry {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
}

.transcription-entry:last-child {
    border-bottom: none;
}

.transcription-entry .timestamp {
    color: #999;
    font-size: 12px;
    min-width: 80px;
}

.transcription-entry .text {
    flex: 1;
}

/* Agent Grid */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.agent-item {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.agent-item.online {
    border-color: #4caf50;
    background: #f1f8f4;
}

.agent-item.offline {
    border-color: #ccc;
    background: #f9f9f9;
}

.agent-extension {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.agent-status {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

/* Page Header */
.page-header {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input,
.filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filters input[type="text"] {
    min-width: 150px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Calls Section */
.calls-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calls-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.stat-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

/* Calls Table */
.calls-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.calls-table {
    width: 100%;
    border-collapse: collapse;
}

.calls-table thead {
    background: #f5f5f5;
}

.calls-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.calls-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.calls-table tbody tr:hover {
    background: #f9f9f9;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-inbound {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-outbound {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-internal {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-completed,
.badge-answered {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-failed {
    background: #ffebee;
    color: #c62828;
}

.badge-no-answer,
.badge-busy {
    background: #fff3e0;
    color: #e65100;
}

.btn-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    padding: 0;
    transition: color 0.2s;
}

.btn-link:hover {
    color: #5568d3;
    text-decoration: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Recordings Section */
.recordings-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.recording-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.recording-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.recording-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recording-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.recording-info {
    margin-bottom: 16px;
}

.recording-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.recording-actions {
    display: flex;
    gap: 12px;
}

/* Agents Section */
.agents-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.agent-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.agent-card.online {
    border-color: #4caf50;
    background: #f1f8f4;
}

.agent-card.offline {
    border-color: #ccc;
    background: #f9f9f9;
}

.agent-card.on-call {
    border-color: #ff9800;
    background: #fff3e0;
}

.agent-extension {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.agent-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.agent-card.online .agent-status-badge {
    background: #4caf50;
    color: white;
}

.agent-card.offline .agent-status-badge {
    background: #ccc;
    color: white;
}

.agent-card.on-call .agent-status-badge {
    background: #ff9800;
    color: white;
}

.agent-last-seen {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.agents-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.stat-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-card .stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .app-nav {
        overflow-x: auto;
    }

    .agent-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
    }

    .filters input,
    .filters select {
        flex: 1;
        min-width: 120px;
    }

    .calls-table {
        font-size: 12px;
    }

    .calls-table th,
    .calls-table td {
        padding: 8px;
    }

    .recordings-grid {
        grid-template-columns: 1fr;
    }

    .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ===================================================================
   AUDIO PLAYER (Spotify-style footer)
   ===================================================================*/
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(180deg, #1e1e1e 0%, #121212 100%);
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 180px;
}

.player-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.player-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.player-btn#play-pause-btn {
    width: 40px;
    height: 40px;
    background: white;
    color: black;
}

.player-btn#play-pause-btn:hover {
    transform: scale(1.06);
    background: #f0f0f0;
}

.player-info {
    flex: 0 0 30%;
    padding: 0 16px;
}

.player-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-subtitle {
    font-size: 12px;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}

.player-progress span {
    font-size: 12px;
    color: #b3b3b3;
    min-width: 40px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #4d4d4d;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover::-webkit-slider-thumb {
    opacity: 1;
}

.progress-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #4d4d4d;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    width: 100px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.app-main {
    padding-bottom: 110px; /* Add space for audio player */
}

/* ===================================================================
   MODAL
   ===================================================================*/
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.call-detail-section {
    margin-bottom: 24px;
}

.call-detail-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.call-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.call-detail-item {
    display: flex;
    flex-direction: column;
}

.call-detail-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.call-detail-value {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.transcription-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #667eea;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.transcription-box.empty {
    color: #999;
    font-style: italic;
}

.summary-box {
    background: #fff3cd;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #ffc107;
    line-height: 1.6;
    color: #333;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
}


