/* Audio Compare Tool Styles - Professional AB Player */

/* ==================== Upload Zones ==================== */

/* Smaller drag-drop zones for A/B selectors */
.drag-drop-zone-sm {
    padding: 15px;
    min-height: 60px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drag-drop-zone-sm .drag-drop-text-sm {
    font-size: 0.9rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.drag-drop-zone-sm.file-selected {
    border-color: var(--bs-success);
    background: rgba(25, 135, 84, 0.05);
}

/* Uploaded files table */
#uploadedFilesTable tbody tr {
    transition: background-color 0.15s ease;
}

#uploadedFilesTable .btn-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

#uploadedFilesTable .btn-remove {
    padding: 0.25rem 0.5rem;
}

/* File assigned indicators */
.file-assigned-a {
    background-color: rgba(5, 44, 101, 0.1) !important;
}

.file-assigned-b {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

[data-bs-theme="dark"] .file-assigned-a {
    background-color: rgba(5, 44, 101, 0.25) !important;
}

[data-bs-theme="dark"] .file-assigned-b {
    background-color: rgba(40, 167, 69, 0.25) !important;
}

/* Badge for assigned status */
.badge-audio-a {
    background-color: #052c65;
}

.badge-audio-b {
    background-color: #28a745;
}

/* ==================== AB Player Card ==================== */

.ab-player-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.ab-player-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem 1.25rem;
}

[data-bs-theme="dark"] .ab-player-card .card-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* A/B Source Toggle */
.ab-source-toggle {
    gap: 0;
}

.ab-toggle-btn {
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    font-size: 1rem;
    border-width: 2px;
    transition: all 0.2s ease;
}

.ab-toggle-btn .ab-label {
    display: inline-block;
    min-width: 20px;
}

.ab-toggle-btn.active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ab-toggle-btn[data-source="A"].active {
    background-color: #052c65;
    border-color: #052c65;
    color: white;
}

.ab-toggle-btn[data-source="B"].active {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

/* ==================== Now Playing ==================== */

.ab-now-playing {
    text-align: center;
}

.playing-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.playing-badge .playing-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    animation: sound-wave 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); }
}

@keyframes sound-wave {
    0% { transform: scaleY(0.8); }
    100% { transform: scaleY(1.2); }
}

.playing-badge.playing-a {
    background: linear-gradient(135deg, #052c65 0%, #0a4a9e 100%);
}

.playing-badge.playing-b {
    background: linear-gradient(135deg, #198754 0%, #25a366 100%);
}

/* ==================== Seek Bar ==================== */

.ab-seek-container {
    padding: 0 8px;
}

.ab-seek-bar {
    position: relative;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 8px;
    overflow: visible;
}

[data-bs-theme="dark"] .ab-seek-bar {
    background: #495057;
}

.ab-seek-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #052c65 0%, #0a4a9e 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
}

.ab-seek-progress.playing-b {
    background: linear-gradient(90deg, #198754 0%, #25a366 100%);
}

.ab-seek-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #052c65;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ab-seek-bar:hover .ab-seek-handle,
.ab-seek-handle.dragging {
    opacity: 1;
}

.ab-seek-handle.playing-b {
    background: #198754;
}

/* Time Display */
.ab-time-display {
    display: flex;
    justify-content: center;
    gap: 4px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    font-weight: 500;
}

.ab-time-display .current-time {
    color: #212529;
    font-weight: 600;
}

.ab-time-display .time-separator {
    opacity: 0.5;
}

.ab-time-display .total-time {
    opacity: 0.6;
}

[data-bs-theme="dark"] .ab-time-display .current-time {
    color: #f8f9fa;
}

/* ==================== Player Controls ==================== */

.ab-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
    flex-wrap: wrap;
}

/* Control Button Base */
.ab-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ab-control-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: scale(1.05);
}

.ab-control-btn:active {
    transform: scale(0.95);
}

.ab-control-btn .control-icon,
.ab-control-btn .volume-icon,
.ab-control-btn .mute-icon {
    width: 18px;
    height: 18px;
    filter: invert(30%) sepia(5%) saturate(500%) hue-rotate(180deg) brightness(95%) contrast(90%);
    transition: filter 0.2s ease;
}

[data-bs-theme="dark"] .ab-control-btn {
    border-color: #495057;
}

[data-bs-theme="dark"] .ab-control-btn:hover {
    background: #495057;
    border-color: #6c757d;
}

[data-bs-theme="dark"] .ab-control-btn .control-icon,
[data-bs-theme="dark"] .ab-control-btn .volume-icon,
[data-bs-theme="dark"] .ab-control-btn .mute-icon {
    filter: invert(70%) sepia(5%) saturate(300%) hue-rotate(180deg) brightness(100%);
}

/* Play Button - Large and Prominent */
.ab-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ab-play-btn:hover {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.ab-play-btn:active {
    transform: scale(0.95);
}

.ab-play-btn .play-icon,
.ab-play-btn .pause-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

[data-bs-theme="dark"] .ab-play-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

[data-bs-theme="dark"] .ab-play-btn:hover {
    background: linear-gradient(135deg, #868e96 0%, #6c757d 100%);
}

/* Switch Button */
.ab-switch-btn {
    width: auto;
    padding: 8px 16px;
    border-radius: 20px;
    gap: 6px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border-color: #ffc107;
    color: #000;
}

.ab-switch-btn .control-icon {
    filter: brightness(0);
}

.ab-switch-btn .switch-text {
    font-size: 13px;
    font-weight: 600;
}

.ab-switch-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffca2c 0%, #ffa726 100%);
    border-color: #ffca2c;
    transform: scale(1.05);
}

.ab-switch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loop Button Active */
.ab-loop-btn.active {
    background: #052c65;
    border-color: #052c65;
}

.ab-loop-btn.active .control-icon {
    filter: brightness(0) invert(1);
}

[data-bs-theme="dark"] .ab-loop-btn.active {
    background: #a855f7;
    border-color: #a855f7;
}

/* Control Divider */
.ab-control-divider {
    width: 1px;
    height: 30px;
    background: #dee2e6;
    margin: 0 4px;
}

[data-bs-theme="dark"] .ab-control-divider {
    background: #495057;
}

/* ==================== Volume Control ==================== */

.ab-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ab-volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #dee2e6;
    border-radius: 2px;
    cursor: pointer;
}

.ab-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-volume-slider::-webkit-slider-thumb:hover {
    background: #052c65;
    transform: scale(1.2);
}

.ab-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #495057;
    cursor: pointer;
    border: none;
}

[data-bs-theme="dark"] .ab-volume-slider {
    background: #495057;
}

[data-bs-theme="dark"] .ab-volume-slider::-webkit-slider-thumb {
    background: #adb5bd;
}

[data-bs-theme="dark"] .ab-volume-slider::-webkit-slider-thumb:hover {
    background: #a855f7;
}

/* ==================== Speed Control ==================== */

.ab-speed-control select {
    width: auto;
    min-width: 70px;
    padding: 6px 10px;
    font-size: 13px;
    border-color: #dee2e6;
    border-radius: 20px;
}

[data-bs-theme="dark"] .ab-speed-control select {
    background: #212529;
    border-color: #495057;
    color: #f8f9fa;
}

/* ==================== Keyboard Hints ==================== */

.ab-keyboard-hints {
    text-align: center;
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 8px;
}

[data-bs-theme="dark"] .ab-keyboard-hints {
    border-top-color: #495057;
}

.ab-keyboard-hints kbd {
    background: #e9ecef;
    border: 1px solid #adb5bd;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-family: 'Courier New', Consolas, monospace;
    font-weight: 600;
    color: #212529;
    box-shadow: 0 2px 0 #adb5bd;
}

[data-bs-theme="dark"] .ab-keyboard-hints kbd {
    background: #495057;
    border-color: #6c757d;
    color: #f8f9fa;
    box-shadow: 0 2px 0 #343a40;
}

/* ==================== Audio Info Cards ==================== */

.audio-card {
    height: 100%;
    transition: all 0.2s ease;
}

.audio-a-card {
    border-left: 4px solid #052c65;
}

.audio-b-card {
    border-left: 4px solid #198754;
}

.audio-card .card-header {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.audio-a-card .card-header {
    background: rgba(5, 44, 101, 0.08);
}

.audio-b-card .card-header {
    background: rgba(25, 135, 84, 0.08);
}

[data-bs-theme="dark"] .audio-a-card .card-header {
    background: rgba(5, 44, 101, 0.2);
}

[data-bs-theme="dark"] .audio-b-card .card-header {
    background: rgba(25, 135, 84, 0.2);
}

/* ==================== Comparison Table ==================== */

.comparison-table th {
    font-weight: 600;
    background: #f8f9fa;
}

[data-bs-theme="dark"] .comparison-table th {
    background: #2d3748;
}

.comparison-table .stat-value {
    font-family: 'Courier New', Consolas, monospace;
    font-weight: 500;
}

.comparison-table .stat-diff {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.comparison-table .stat-diff.positive {
    background: rgba(40, 167, 69, 0.15);
    color: #198754;
}

.comparison-table .stat-diff.negative {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.comparison-table .stat-diff.neutral {
    background: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    .ab-player-controls {
        gap: 8px;
    }

    .ab-play-btn {
        width: 48px;
        height: 48px;
    }

    .ab-play-btn .play-icon,
    .ab-play-btn .pause-icon {
        width: 20px;
        height: 20px;
    }

    .ab-control-btn {
        width: 36px;
        height: 36px;
    }

    .ab-control-btn .control-icon {
        width: 16px;
        height: 16px;
    }

    .ab-switch-btn {
        padding: 6px 12px;
    }

    .ab-switch-btn .switch-text {
        display: none;
    }

    .ab-volume-slider {
        width: 60px;
    }

    .ab-speed-control select {
        min-width: 60px;
        font-size: 12px;
    }

    .ab-keyboard-hints {
        display: none;
    }

    .ab-control-divider {
        display: none;
    }
}

@media (max-width: 576px) {
    .ab-toggle-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }

    .ab-volume-control {
        display: none;
    }

    .ab-time-display {
        font-size: 12px;
    }
}
