/* Narration Engine Styles
   Reusable CSS for the narration/autoplay/speaker-notes UI.
   Override CSS custom properties to theme for different presentations. */

:root {
    --narration-accent: #61F393;
    --narration-accent-gradient: linear-gradient(135deg, #61F393 0%, #4ade80 100%);
    --narration-bg: rgba(10, 22, 40, 0.85);
    --narration-bg-solid: rgba(10, 22, 40, 0.9);
    --narration-bg-opaque: rgba(10, 22, 40, 0.97);
    --narration-text: white;
    --narration-text-muted: rgba(255,255,255,0.7);
    --narration-text-dim: rgba(255,255,255,0.4);
    --narration-border: rgba(255,255,255,0.1);
    --narration-danger: rgba(239, 68, 68, 0.2);
    --narration-danger-hover: rgba(239, 68, 68, 0.4);
}

/* ========== Play Button Overlay ========== */
#autoplay-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--narration-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}
#autoplay-overlay.visible {
    opacity: 1;
    visibility: visible;
}
#play-button {
    background: var(--narration-accent-gradient);
    border: none;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(97, 243, 147, 0.4);
    transition: all 0.3s ease;
}
#play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 30px 80px rgba(97, 243, 147, 0.5);
}
#play-button svg {
    width: 60px;
    height: 60px;
    margin-left: 10px;
    fill: #0a1628;
}
#play-button-container {
    text-align: center;
}
#play-button-container h2 {
    color: var(--narration-text);
    font-size: 2rem;
    margin-bottom: 30px;
}
#play-button-container p {
    color: var(--narration-text-muted);
    margin-top: 20px;
    font-size: 1rem;
}

/* ========== Start Presentation Button ========== */
#start-presentation-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--narration-bg);
    color: var(--narration-text);
    border: 1px solid var(--narration-border);
    padding: 10px 16px;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
#start-presentation-btn:hover {
    background: rgba(10, 22, 40, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.2);
}
#start-presentation-btn svg {
    fill: var(--narration-accent);
    width: 16px;
    height: 16px;
}
#start-presentation-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ========== Progress Bar ========== */
#presentation-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(97, 243, 147, 0.2);
    z-index: 10000;
    display: none;
}
#presentation-progress.active {
    display: block;
}
#presentation-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #61F393, #4ade80);
    width: 0%;
    transition: width 0.3s ease;
}

/* ========== Control Bar ========== */
#presentation-controls {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--narration-bg-solid);
    padding: 10px 20px;
    border-radius: 40px;
    display: none;
    align-items: center;
    gap: 16px;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.5s ease-out;
    backdrop-filter: blur(10px);
}
#presentation-controls:hover,
#presentation-controls.visible {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}
#presentation-controls.active {
    display: flex;
}
#presentation-controls button {
    background: none;
    border: none;
    color: var(--narration-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
#presentation-controls button:hover {
    background: rgba(255,255,255,0.1);
}
#presentation-controls button svg {
    width: 24px;
    height: 24px;
    fill: var(--narration-text);
}
#presentation-controls .slide-info {
    color: var(--narration-text-muted);
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}
#presentation-controls #stop-btn {
    background: var(--narration-danger);
}
#presentation-controls #stop-btn:hover {
    background: var(--narration-danger-hover);
}

/* ========== Subtitles ========== */
#subtitles {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 800px;
    width: 90%;
    text-align: center;
    z-index: 9998;
    display: none;
    pointer-events: none;
}
#subtitles.active {
    display: block;
}
#subtitles-text {
    display: inline-block;
    background: rgba(0, 0, 0, 0.55);
    color: var(--narration-text);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 400;
    max-width: 100%;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* ========== Speed Selector ========== */
#speed-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}
#speed-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--narration-text);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 55px;
}
#speed-btn:hover {
    background: rgba(255,255,255,0.2);
}
#speed-menu {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 22, 40, 0.98);
    border-radius: 12px;
    padding: 8px 0;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    border: 1px solid var(--narration-border);
}
#speed-menu.visible {
    display: flex;
}
#speed-menu button {
    background: none;
    border: none;
    color: var(--narration-text);
    padding: 10px 24px;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}
#speed-menu button:hover {
    background: rgba(255,255,255,0.1);
}
#speed-menu button.active {
    color: var(--narration-accent);
    font-weight: 700;
}

/* ========== Subtitle Toggle ========== */
#subtitle-toggle {
    opacity: 0.6;
}
#subtitle-toggle.active {
    opacity: 1;
    color: var(--narration-accent);
}

/* ========== Narration Panel (Speaker Notes) ========== */
#narration-toggle {
    position: fixed;
    bottom: 24px;
    left: 200px;
    z-index: 10000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #1a1a2e;
    color: var(--narration-text);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.2s;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
}
#narration-toggle:hover {
    opacity: 1;
    transform: scale(1.05);
}
#narration-toggle.active {
    opacity: 0;
    pointer-events: none;
}

#narration-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--narration-bg-opaque);
    color: var(--narration-text);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
    visibility: hidden;
    max-height: 35vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
}
#narration-panel.visible {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.3s ease, visibility 0s linear 0s;
}

#narration-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--narration-border);
    position: sticky;
    top: 0;
    background: rgba(10, 22, 40, 0.98);
}
#narration-panel-header h3 {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--narration-accent);
    font-weight: 600;
}
#narration-panel-header .slide-badge {
    background: rgba(97, 243, 147, 0.2);
    color: var(--narration-accent);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
#narration-panel-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 8px;
    font-size: 1.2rem;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s;
}
#narration-panel-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--narration-text);
}

#narration-panel-content {
    padding: 24px 32px 32px;
}
#narration-panel-content .narration-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.9);
    margin: 0;
    font-weight: 400;
}
#narration-panel-content .no-narration {
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
    font-style: italic;
}

#narration-panel-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--narration-border);
    font-size: 0.75rem;
    color: var(--narration-text-dim);
    display: flex;
    gap: 16px;
}
#narration-panel-footer kbd {
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: inherit;
}
