/* Enhanced Audio Player Styles */
.audio-player-enhanced {
    position: relative;
}

/* Seek Bar Enhancements */
#seekBarContainer {
    position: relative;
    background: linear-gradient(to right, #e5e7eb, #e5e7eb);
    border-radius: 9999px;
    height: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#seekBarContainer:hover {
    height: 14px;
    background: linear-gradient(to right, #d1d5db, #d1d5db);
}

#progressBar {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 9999px;
    height: 100%;
    position: relative;
    transition: width 0.1s ease;
}

#progressBar .seek-handle {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: #1d4ed8;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    opacity: 0;
}

#seekBarContainer:hover #progressBar .seek-handle {
    opacity: 1;
}

#progressBar .seek-handle:active {
    cursor: grabbing;
    transform: translateY(-50%) scale(1.2);
}

/* Sentence Progress Bar */
#sentenceSeekBar {
    position: relative;
    background: #e5e7eb;
    border-radius: 9999px;
    height: 8px;
    cursor: pointer;
    transition: height 0.2s ease;
}

#sentenceSeekBar:hover {
    height: 10px;
}

#sentenceProgressBar {
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 9999px;
    height: 100%;
    transition: width 0.3s ease;
}

/* Button States */
.audio-control-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.audio-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-control-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.audio-control-btn:not(:disabled):active {
    transform: translateY(0);
}

/* Time Display */
.time-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Current Sentence Highlight */
#currentSentence {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#currentSentence.playing {
    background: linear-gradient(90deg, #fef3c7, #fbbf24);
    border-left-color: #f59e0b;
    animation: pulse-sentence 2s infinite;
}

@keyframes pulse-sentence {
    0%, 100% {
        background: linear-gradient(90deg, #fef3c7, #fbbf24);
    }
    50% {
        background: linear-gradient(90deg, #fbbf24, #fef3c7);
    }
}

/* Loading State */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Chapter Selection Enhancement */
.chapter-item {
    transition: all 0.2s ease;
}

.chapter-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chapter-item.selected {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border: 2px solid #8b5cf6;
}

/* Settings Panel Enhancements */
#settingsPanel {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slider Enhancements */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #3b82f6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: #3b82f6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

/* Progress Indicators */
.progress-container {
    position: relative;
}

.progress-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.progress-container:hover .progress-tooltip {
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .audio-control-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    #seekBarContainer {
        height: 16px;
    }

    #sentenceSeekBar {
        height: 12px;
    }

    .time-display {
        font-size: 0.75rem;
    }
}

/* Accessibility Enhancements */
.audio-control-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

input[type="range"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #seekBarContainer {
        background: linear-gradient(to right, #374151, #374151);
    }

    #seekBarContainer:hover {
        background: linear-gradient(to right, #4b5563, #4b5563);
    }

    #sentenceSeekBar {
        background: #374151;
    }

    .time-display {
        color: #9ca3af;
    }

    #settingsPanel {
        background: rgba(31, 41, 55, 0.95);
        color: #f9fafb;
    }
}
