/* ===========================
   PDF Reader - Styles
   =========================== */

/* PDF Reader Layout */
.pdf-reader-layout {
    display: flex;
    gap: 2rem;
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 500px;
}

/* PDF Viewer Panel (Left) */
.pdf-viewer-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* PDF Toolbar */
.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.pdf-upload-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pdf-upload-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pdf-upload-btn:hover {
    background: var(--primary-hover);
}

.pdf-filename {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Navigation Controls */
.pdf-nav-controls,
.pdf-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pdf-nav-btn,
.pdf-zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pdf-nav-btn:hover:not(:disabled),
.pdf-zoom-btn:hover:not(:disabled) {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

.pdf-nav-btn:disabled,
.pdf-zoom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdf-page-indicator,
.pdf-zoom-level {
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: center;
}

/* PDF Container */
.pdf-container {
    flex: 1;
    position: relative;
    overflow: auto;
    background: #525659;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
}

.pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    gap: 1rem;
}

.pdf-placeholder p:first-child {
    font-size: 4rem;
}

.pdf-placeholder p:last-child {
    font-size: 1rem;
}

.pdf-canvas {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: white;
}

/* Highlight Layer (pour la surbrillance) */
.pdf-highlight-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.pdf-text-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* Sentence Highlight */
.sentence-highlight {
    position: absolute;
    background: rgba(255, 235, 59, 0.4);
    border-radius: 2px;
    transition: all 0.15s ease;
    pointer-events: none;
}

.sentence-highlight.active {
    background: rgba(255, 193, 7, 0.6);
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

/* PDF Controls Panel (Right) */
.pdf-controls-panel {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Playback Controls */
.pdf-playback-controls {
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.playback-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.playback-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.play-btn {
    background: linear-gradient(135deg, var(--aurora-navy) 0%, var(--aurora-blue) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.play-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

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

.play-btn.playing {
    background: linear-gradient(135deg, var(--aurora-orange) 0%, #d96229 100%);
}

.stop-btn {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.stop-btn:hover:not(:disabled) {
    background: var(--surface-color);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

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

/* Progress Bar */
.progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-color);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    margin-top: -4px;
}

.progress-bar::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--bg-color) 0%);
}

.progress-bar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-display {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Playback Options */
.playback-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-control label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.speed-selector {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    background: var(--surface-color);
    cursor: pointer;
}

.sentence-nav {
    display: flex;
    gap: 0.5rem;
}

.sentence-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sentence-nav-btn:hover:not(:disabled) {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

.sentence-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Current Sentence Panel */
.current-sentence-panel {
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.current-sentence-panel h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.current-sentence {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    min-height: 3rem;
    max-height: 6rem;
    overflow-y: auto;
}

/* Reading Stats */
.reading-stats {
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-around;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Voice selector in PDF panel */
.pdf-controls-panel .voice-selector-container {
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
}

/* Waveform in PDF panel */
.pdf-controls-panel .waveform-container {
    height: 100px;
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 0.5rem;
}

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

@media (max-width: 1024px) {
    .pdf-reader-layout {
        flex-direction: column;
        height: auto;
    }

    .pdf-viewer-panel {
        min-height: 400px;
    }

    .pdf-controls-panel {
        flex: 0 0 auto;
    }

    .pdf-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 640px) {
    .pdf-reader-layout {
        gap: 1rem;
    }

    .pdf-toolbar {
        padding: 0.5rem;
    }

    .pdf-upload-container {
        width: 100%;
    }

    .pdf-nav-controls,
    .pdf-zoom-controls {
        width: 100%;
        justify-content: center;
    }

    .pdf-controls-panel {
        gap: 1rem;
    }

    .playback-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}
