/* ═══════════════════════════════════════════════════════════════════════════
   PROFESSIONAL SPLIT LAYOUT
   Clean, modern, swiss-style typography
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg-surface: #050505;
    --bg-pane: #0a0a0a;
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #52525b;
    
    /* Professional Accent: Electric Blue */
    --accent: #3b82f6; 
    --accent-glow: rgba(59, 130, 246, 0.5);
    
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --split-height: 42vh;
}

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

body {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ─── Top Pane (Header) ─────────────────────────────────────────────────── */
.top-pane {
    height: var(--split-height);
    background: 
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 60%),
        linear-gradient(to bottom, #080808 0%, #030303 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10;
}

/* Subtle noise texture for premium feel */
.top-pane::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    mix-blend-mode: overlay;
}

.header-content {
    text-align: center;
    max-width: 800px;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
    transform: translateY(-10px); /* Visual optical center */
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(4px);
    text-transform: uppercase;
}

/* Pulsing dot in the pill */
.tag-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

.title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 5rem); /* Much larger */
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin-bottom: 1.25rem;
    color: #ffffff;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 40ch;
    margin: 0 auto;
    line-height: 1.5;
    letter-spacing: -0.01em;
    opacity: 0.8;
}

/* ─── Floating Play Button (FAB) ────────────────────────────────────────── */
.play-fab {
    position: absolute;
    bottom: -36px; /* Slightly larger overlap */
    left: 8%;
    width: 72px;   /* Larger button */
    height: 72px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset; /* Inner subtle border */
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
}

.play-fab:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

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

.play-fab svg {
    width: 32px;
    height: 32px;
}

#playIcon { margin-left: 5px; } 

/* ─── Duration Badge ────────────────────────────────────────────────────── */
.duration-badge {
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
}

.sep { margin: 0 0.5rem; opacity: 0.3; }

/* ─── Bottom Pane (Transcript) ──────────────────────────────────────────── */

.bottom-pane {
    flex: 1;
    background: var(--bg-pane);
    position: relative;
    overflow: hidden;
}

.transcript-viewport {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 2rem 2rem 5rem 2rem;
    
    /* Hide Scrollbar */
    scrollbar-width: none;
}
.transcript-viewport::-webkit-scrollbar { display: none; }

.transcript-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.6;
    font-weight: 400;
    color: var(--text-tertiary); /* Dimmed by default */
    text-align: left;
}

/* ─── Word Highlighting ─────────────────────────────────────────────────── */
.word {
    display: inline-block;
    transition: color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    margin-right: 0.25em;
    padding: 0.1em 0;
}

.word:hover {
    color: var(--text-secondary);
}

/* Active Word Styling */
.word.current {
    color: var(--text-primary);
    font-weight: 500;
    transform: scale(1.03);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* Spoken Words */
.word.spoken {
    color: var(--text-secondary);
    transition: color 0.5s ease;
}

/* ─── Embedded Images ───────────────────────────────────────────────────── */
.transcript-image {
    display: block;
    width: auto;
    max-width: 80%;
    max-height: 350px;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    margin: 3rem auto; /* Center horizontally */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.transcript-image:hover {
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ─── Fade Masks ────────────────────────────────────────────────────────── */
.fade-mask-top {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 80px;
    background: linear-gradient(to bottom, var(--bg-pane), transparent);
    pointer-events: none;
}

.fade-mask-bottom {
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 120px;
    background: linear-gradient(to top, var(--bg-pane), transparent);
    pointer-events: none;
}

.paragraph-break {
    display: block;
    height: 2.5rem;
}

.hidden { display: none; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .play-fab {
        left: 50%;
        transform: translateX(-50%);
        bottom: -32px;
    }
    
    .play-fab:hover {
        transform: translateX(-50%) scale(1.1);
    }
    
    .transcript-content {
        font-size: 1.25rem;
    }
}
