/* ==============================================================
1. RESET & VARIABLES (SlideServe Corporate Branding Colors)
============================================================== */
:root {
    --brand-navy: #0c2b3d;
    --brand-navy-hover: #061620;
    --brand-navy-light: #f0f4f8;
    --brand-amber: #ffbe2f;
    --brand-amber-hover: #e0a524;
    --brand-amber-light: #fffdf0;
    --text-dark: #0c2b3d;
    --text-body: #2c3e50;
    --text-muted: #7f8c8d;
    --bg-gray: #f5f7fa;
    --border-light: #eef2f5;
    --ss-header-height:55px;
}

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

/*body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-body);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 100vh;
    overflow: hidden;
    letter-spacing: -0.01em;
}*/

/* ==============================================================
   2. PRIMARY SIDE PANEL
   ============================================================== */
.ssa-panel-container {
    width: 100%;
    max-width: 480px;
    height: calc(100vh - var(--ss-header-height)) !important;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-light);
    box-shadow: -15px 0 35px -10px rgba(12, 43, 61, 0.18), -5px 0 15px -4px rgba(12, 43, 61, 0.05);
    position: fixed;
    right: 0px;
    top: var(--ss-header-height) !important;
    transition: box-shadow 0.6s ease;
    z-index: 1000;
}

.ssa-panel-container.is-playing {
    animation: panelShadowPulse 2.4s ease-in-out infinite;
}

@keyframes panelShadowPulse {
    0%, 100% {
        box-shadow: -15px 0 35px -10px rgba(12, 43, 61, 0.18), -5px 0 15px -4px rgba(12, 43, 61, 0.05);
    }
    50% {
        box-shadow: -22px 0 50px -10px rgba(12, 43, 61, 0.28), -8px 0 22px -4px rgba(12, 43, 61, 0.10);
    }
}



.ssa-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
}

.ssa-logo-wrapper { display: flex; align-items: center; gap: 12px; }

.ssa-logo-img {
    height: 28px; width: auto; object-fit: contain;
    user-select: none; pointer-events: none;
    filter: brightness(0.1) contrast(1.1);
}

.ssa-logo-divider {
    border-left: 1px solid #cbd5e1;
    height: 20px; padding-left: 12px;
    display: flex; align-items: center;
}

.ssa-logo-subtitle {
    font-size: 10px; font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.ssa-header-actions { display: flex; align-items: center; gap: 12px; }

.ssa-status-badge {
    padding: 6px 12px; border-radius: 99px;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 190, 47, 0.3);
    background: var(--brand-amber-light);
    color: var(--text-dark);
}

.ssa-status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand-amber);
    animation: pulse-ring 1.5s infinite;
}

.ssa-close-btn {
    background: none; border: none; color: #94a3b8;
    cursor: pointer; padding: 6px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

.ssa-close-btn:hover { background: #f1f5f9; color: var(--brand-amber); }

/* ==============================================================
   3. ACOUSTIC SIGNAL WAVE — REDESIGNED SPECTRUM BARS
   ============================================================== */
.ssa-wave-section {
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: 14px 24px;
    flex-shrink: 0;
    position: relative;
}

.ssa-wave-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}

.ssa-wave-label {
    font-size: 9px; font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.ssa-voice-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand-amber);
    flex-shrink: 0;
    animation: pulse-ring 1.5s infinite;
}

/* Voice dropdown */
.ssa-voice-picker { position: relative; }

.ssa-voice-trigger {
    background: var(--brand-amber-light);
    border: 1px solid rgba(255, 190, 47, 0.4);
    color: var(--brand-navy);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 99px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    transition: all 0.2s;
}

.ssa-voice-trigger:hover {
    background: #fff8dd;
    border-color: var(--brand-amber);
}

.ssa-voice-trigger-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.ssa-voice-caret {
    width: 10px; height: 10px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.ssa-voice-picker.open .ssa-voice-caret { transform: rotate(180deg); }

.ssa-voice-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 250px;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(12, 43, 61, 0.15);
    z-index: 100;
    padding: 6px;
}

.ssa-voice-picker.open .ssa-voice-menu { display: block; }

.ssa-voice-menu::-webkit-scrollbar { width: 5px; }
.ssa-voice-menu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

.ssa-voice-menu-empty {
    padding: 14px 10px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.ssa-voice-option {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.15s;
}

.ssa-voice-option:hover { background: var(--brand-amber-light); }

.ssa-voice-option.selected {
    background: var(--brand-navy);
    color: #ffffff;
}

.ssa-voice-option-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.ssa-voice-option-lang {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.ssa-voice-option.selected .ssa-voice-option-lang { color: var(--brand-amber); }

.ssa-wave-viewport {
    height: 40px; width: 100%;
    background:
        radial-gradient(120% 80% at 50% 50%, rgba(255,255,255,0.9) 0%, rgba(240,244,248,0.6) 60%, rgba(232,238,244,0.4) 100%),
        linear-gradient(180deg, #fafbfd 0%, #eef2f7 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 2px rgba(12, 43, 61, 0.05), 0 1px 0 rgba(255,255,255,0.6);
}

/* Soft glow that wakes up while reading */
.ssa-wave-viewport::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(60% 120% at 50% 50%, rgba(255, 190, 47, 0.18), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.ssa-wave-viewport.active::after { opacity: 1; }

/* Subtle horizontal centerline */
.ssa-wave-viewport::before {
    content: '';
    position: absolute;
    left: 10px; right: 10px;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(12, 43, 61, 0.10), transparent);
    pointer-events: none;
}

.ssa-wave-svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    pointer-events: none;
}

.ssa-wave-svg path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.4s ease, stroke-width 0.4s ease;
}

.ssa-wave-svg .wave-back  { stroke: rgba(12, 43, 61, 0.16); stroke-width: 1; opacity: 0.5; }
.ssa-wave-svg .wave-front { stroke: url(#audioWaveGrad);   stroke-width: 1.4; opacity: 0.8; }

.ssa-wave-viewport.active .wave-back  { stroke: rgba(12, 43, 61, 0.20); stroke-width: 1.2; opacity: 0.5; }
.ssa-wave-viewport.active .wave-front { stroke-width: 1.8; opacity: 1; filter: drop-shadow(0 1px 4px rgba(255, 190, 47, 0.45)); }



.ssa-wave-idle-text {
    position: absolute;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    transition: opacity 0.3s;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 99px;
}

.ssa-wave-idle-text.hidden-fade { opacity: 0; }

.ssa-wave-idle-text svg {
    color: var(--brand-amber);
    animation: bounce-gentle 1.5s infinite;
}

/* ==============================================================
   4. TRANSCRIPT
   ============================================================== */
.ssa-transcript-viewport {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-gray);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ssa-transcript-viewport::-webkit-scrollbar { width: 5px; }
.ssa-transcript-viewport::-webkit-scrollbar-track { background: transparent; }
.ssa-transcript-viewport::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.ssa-transcript-viewport::-webkit-scrollbar-thumb:hover { background: var(--brand-amber); }

.slide-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 20px 18px 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(12, 43, 61, 0.02);
    display: flex;
    gap: 10px;
    align-items: start;
}

.slide-item:hover {
    box-shadow: 0 10px 24px rgba(12, 43, 61, 0.04);
    border-color: #e2e8f0;
}

.slide-item.active-slide {
    border-left: 3px solid var(--brand-amber);
    background-color: var(--brand-amber-light);
    box-shadow: inset 2px 0 10px rgba(255, 190, 47, 0.03), 0 8px 20px rgba(12, 43, 61, 0.03);
    padding-left: 9px;
}

.slide-badge-idx {
    width: 24px; height: 24px; border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-dark);
    font-weight: 700; font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
    transition: background 0.3s, color 0.3s;
}

.slide-item.active-slide .slide-badge-idx {
    background: var(--brand-navy); color: #ffffff;
}


.slide-body-content { flex-grow: 1; min-width: 0; }

.slide-header-title {
    font-size: 14px; font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 6px;
    line-height: 1.4;
}

.slide-body-text {
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.65;
    font-weight: 500;
    letter-spacing: -0.005em;
    word-wrap: break-word;
}

/* ==============================================================
   5. READING HIGHLIGHT (only injected on active slide)
   ============================================================== */
.word {
    display: inline-block;
    border-radius: 5px;
    padding: 1px 3px;
    margin: 0 -1px;
    color: inherit;
    transition: color 0.35s ease, background-color 0.45s ease, transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s ease, text-shadow 0.35s ease;
    will-change: transform, background-color;
}

.word.highlight {
    color: #ffffff;
    font-weight: 700;
    background: linear-gradient(120deg, var(--brand-navy) 0%, #1d5a7d 45%, var(--brand-amber) 100%);
    background-size: 220% 100%;
    background-position: 0% 50%;
    box-shadow: 0 6px 18px -4px rgba(12, 43, 61, 0.35), 0 0 0 1px rgba(255, 190, 47, 0.35);
    text-shadow: 0 1px 2px rgba(12, 43, 61, 0.35);
    transform: translateY(-1px) scale(1.04);
    animation: aiGradientShift 2.4s ease-in-out infinite, wordPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.word.read {
    color: var(--brand-navy);
    font-weight: 600;
    background: linear-gradient(180deg, transparent 65%, rgba(255, 190, 47, 0.35) 65%, rgba(255, 190, 47, 0.35) 92%, transparent 92%);
    border-radius: 2px;
}

@keyframes wordPop {
    0%   { transform: translateY(0) scale(1); }
    60%  { transform: translateY(-2px) scale(1.08); }
    100% { transform: translateY(-1px) scale(1.04); }
}


/* ==============================================================
   6. AUDIO CONTROLLER
   ============================================================== */
.ssa-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    padding: 24px;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 -10px 40px -12px rgba(12, 43, 61, 0.08);
}

.ssa-player-card { display: flex; align-items: center; gap: 20px; }

.ssa-slide-art-cover {
    width: 100px; height: 100px;
    border-radius: 16px;
    background-color: #0c2b3d;
    background-image: url('https://cdn0.slideserve.com/696284/sea-ice-algae-dt.jpg');
    background-size: cover;
    background-position: center;
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(12, 43, 61, 0.1);
    box-shadow: 0 8px 16px rgba(12, 43, 61, 0.08);
    transition: all 0.3s;
}

/* ~70% image visible; subtle scrims top+bottom for legibility, soft brand tint + vignette */
.ssa-slide-art-cover::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(120% 90% at 50% 50%, #00000061 55%, rgba(12, 43, 61, 0.35) 100%),
        linear-gradient(180deg, rgb(12 43 61 / 84%) 0%, rgba(12, 43, 61, 0) 22%, rgb(12 43 61 / 42%) 70%, rgb(12 43 61 / 83%) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Brand color wash on hover/active — keeps the image readable but adds personality */
.ssa-slide-art-cover::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,190,47,0.18) 0%, rgba(12,43,61,0.10) 50%, rgba(29,111,156,0.20) 100%);
    mix-blend-mode: overlay;
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.ssa-slide-art-cover:hover::after { opacity: 0.9; }



.ssa-slide-art-meta {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
}

.ssa-slide-art-num {
    font-size: 8px; font-weight: 800;
    letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--brand-amber);
}

.ssa-slide-art-pulse {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--brand-amber);
    animation: pulse-ring 1.5s infinite;
}

.ssa-slide-art-footer { position: relative; z-index: 2; }

.ssa-slide-art-title {
    font-size: 11px; font-weight: 800;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ssa-slide-art-tag {
    font-size: 7px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.ssa-playback-center { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }

.ssa-track-info { margin-bottom: 12px; }

.ssa-track-badge-row { display: flex; align-items: center; gap: 6px; }

.ssa-track-pill {
    font-size: 8px; font-weight: 800;
    letter-spacing: 0.1em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 6px;
    background: var(--brand-amber-light);
    color: var(--text-dark);
    border: 1px solid rgba(255, 190, 47, 0.4);
}

.ssa-track-index-label {
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
}

.ssa-track-title {
    font-size: 15px; font-weight: 800;
    color: var(--text-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 4px;
}

.ssa-timeline-box {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 10px; font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.ssa-slider-wrapper { position: relative; width: 100%; margin-bottom: 16px; }

.ssa-timeline-range {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 5px;
    border-radius: 99px;
    background: #e2e8f0;
    outline: none;
    transition: all 0.25s;
    cursor: pointer;
}

.ssa-timeline-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--brand-navy);
    border: 2px solid var(--brand-amber);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
}
.ssa-timeline-range::-webkit-slider-thumb:hover { transform: scale(1.3); }

.ssa-timeline-range::-moz-range-thumb {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--brand-navy);
    border: 2px solid var(--brand-amber);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
}
.ssa-timeline-range::-moz-range-thumb:hover { transform: scale(1.3); }

.ssa-toolbar { display: flex; align-items: center; justify-content: space-between; }

.ssa-tool-btn {
    background: none; border: none; cursor: pointer;
    padding: 8px; border-radius: 8px;
    color: var(--brand-navy);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

.ssa-tool-btn:hover { background: #f1f5f9; color: var(--brand-amber-hover); }

.ssa-tool-btn.btn-play-pause:hover {
    color: var(--brand-amber-hover);
    transform: scale(1.05);
}

.ssa-tool-btn.active { color: var(--brand-amber); }

.ssa-speed-wrapper { position: relative; }

.ssa-speed-label { font-size: 11px; font-weight: 800; }

.ssa-speed-menu {
    display: none;
    position: absolute;
    bottom: 100%; right: 0;
    margin-bottom: 10px;
    width: 100px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(12, 43, 61, 0.12);
    overflow: hidden;
    z-index: 50;
}

.ssa-speed-menu.show { display: block; }

.ssa-speed-option {
    width: 100%; background: none; border: none;
    text-align: left;
    padding: 8px 14px;
    font-size: 11px; font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ssa-speed-option:hover {
    background: var(--brand-amber-light);
    color: var(--brand-amber-hover);
}

.hidden { display: none !important; }

/* ==============================================================
   7. ANIMATIONS
   ============================================================== */
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(255, 190, 47, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(255, 190, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 190, 47, 0); }
}
@keyframes bounce-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes aiGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@media (max-width: 640px) {
    body { align-items: flex-end; }
    .ssa-panel-container { max-width: 100%; height: 100vh; }
}