/* ═══════════════════════════════════════════════
   EasyContentFromAI — Transcript Tool
   Styles scoped exclusively to /transcript page.
   Loaded ONLY on Transcript/Index via layout section.
   Depends on: base.css (tokens, reset, shared)
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════
   HERO / EMPTY STATE SCREEN
   ═══════════════════════════════════════════════ */
.hero-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    min-height: calc(100vh - var(--header-h));
}

.hero-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 14px;
}

.hero-title {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 12px;
}

.hero-title-accent {
    color: var(--primary);
}

.hero-sub {
    font-size: 1.0625rem;
    color: var(--text-2);
    max-width: 440px;
    margin: 0 auto 32px;
    line-height: 1.65;
}

/* ── Search Box ─────────────────────────────────────────────────────────── */
.search-box {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 520px;
}

/* ═══════════════════════════════════════════════
   ACTIVE WORKSPACE LAYOUT
   ═══════════════════════════════════════════════ */
.workspace-container {
    width: 70%;
    margin: 0 auto;
}

@media (max-width: 1280px) {
    .workspace-container {
        width: 85%;
    }
}

@media (max-width: 1024px) {
    .workspace-container {
        width: 95%;
    }
}

@media (max-width: 768px) {
    .workspace-container {
        width: 100%;
    }
}

.workspace {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - var(--header-h));
    align-items: start;
}

/* ═══════════════════════════════════════════════
   SIDEBAR PANEL
   ═══════════════════════════════════════════════ */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 0;
    max-height: calc(100vh - var(--header-h) - 32px);
    overflow-y: auto;
}
.sidebar-panel::-webkit-scrollbar {
    width: 3px;
}
.sidebar-panel::-webkit-scrollbar-thumb {
    background: var(--border-md);
    border-radius: 3px;
}

/* ═══════════════════════════════════════════════
   CARD (sidebar container)
   ═══════════════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
}

/* ═══════════════════════════════════════════════
   SIDE SEARCH FORM
   ═══════════════════════════════════════════════ */
.side-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
}

.side-search-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.side-search-row .input-wrap {
    flex: 1;
}
.side-search-row .text-input {
    height: 36px;
    font-size: 0.875rem;
    padding-left: 34px;
}
.side-search-row .input-icon {
    left: 10px;
}
.side-search-row .btn-primary {
    height: 36px;
    padding: 0 12px;
    font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════
   ERROR ALERT (inline in sidebar)
   ═══════════════════════════════════════════════ */
.alert-error {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 12px;
    background: var(--error-bg);
    border: 1px solid var(--error-bd);
    border-radius: var(--r-sm);
    font-size: 0.875rem;
    color: var(--error);
    line-height: 1.5;
}
.alert-error svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ═══════════════════════════════════════════════
   VIDEO METADATA CARD
   ═══════════════════════════════════════════════ */
.meta-grid {
    display: flex;
    flex-direction: column;
}

.meta-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.meta-row:first-child {
    padding-top: 0;
}
.meta-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.meta-key {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
}

.meta-val {
    font-size: 0.9375rem;
    color: var(--text-2);
    line-height: 1.4;
    word-break: break-word;
}
.meta-val.strong {
    font-weight: 600;
    color: var(--text);
}

/* ═══════════════════════════════════════════════
   TRANSCRIPT PANE
   ═══════════════════════════════════════════════ */
.transcript-pane {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    height: calc(100vh - var(--header-h) - 32px);
    min-height: 480px;
}

/* ═══════════════════════════════════════════════
   PANE TOOLBAR
   ═══════════════════════════════════════════════ */
.pane-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    min-height: 52px;
    flex-shrink: 0;
    background: var(--bg);
}

.toolbar-filter {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 260px;
}
.toolbar-filter svg {
    position: absolute;
    left: 8px;
    color: var(--text-3);
    pointer-events: none;
}

.filter-input {
    width: 100%;
    height: 30px;
    padding: 0 10px 0 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 0.875rem;
    font-family: var(--font);
    outline: none;
}
.filter-input::placeholder {
    color: var(--text-3);
}
.filter-input:hover {
    border-color: var(--border-md);
}
.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.toolbar-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   TRANSCRIPT BODY & ROWS
   ═══════════════════════════════════════════════ */
.transcript-body {
    flex: 1;
    overflow-y: auto;
}
.transcript-body::-webkit-scrollbar {
    width: 5px;
}
.transcript-body::-webkit-scrollbar-track {
    background: transparent;
}
.transcript-body::-webkit-scrollbar-thumb {
    background: var(--border-md);
    border-radius: 3px;
}

.transcript-list {
    display: flex;
    flex-direction: column;
}

.transcript-row {
    display: flex;
    gap: 12px;
    padding: 8px 14px;
    align-items: baseline;
    border-bottom: 1px solid #f1f5f9;
}
.transcript-row:hover {
    background: var(--bg);
}
.transcript-row.hidden {
    display: none !important;
}

/* ── Timestamp badge ────────────────────────────────────────────────────── */
.ts-badge {
    font-size: 0.75rem;
    font-family: var(--mono);
    font-weight: 500;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Transcript text ────────────────────────────────────────────────────── */
.ts-text {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text);
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* ── Filter highlight ───────────────────────────────────────────────────── */
.highlight-match {
    background: var(--primary-bg);
    color: var(--primary-dk);
    border-radius: 2px;
    padding: 0 2px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   SKELETON LOADER (static, no animation)
   ═══════════════════════════════════════════════ */
#skeletonLoader {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-pulse {
    height: 14px;
    border-radius: 4px;
    background: var(--surface-2);
}

/* Width utility classes */
.sk-w50 {
    width: 50%;
}
.sk-w60 {
    width: 60%;
}
.sk-w70 {
    width: 70%;
}
.sk-w75 {
    width: 75%;
}
.sk-w80 {
    width: 80%;
}
.sk-w85 {
    width: 85%;
}
.sk-w90 {
    width: 90%;
}
.sk-w100 {
    width: 100%;
}

/* ═══════════════════════════════════════════════
   HOW IT WORKS (transcript page info section)
   ═══════════════════════════════════════════════ */
.transcript-how {
    background: var(--bg);
}

.how-steps {
    list-style: none;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.how-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.how-step-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.how-step-body {
    flex: 1;
}

.how-step-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.how-step-desc {
    font-size: 0.9375rem;
    color: var(--text-2);
    line-height: 1.7;
}

.how-step-desc code {
    font-family: var(--mono);
    font-size: 0.875em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--text);
}

/* ═══════════════════════════════════════════════
   FAQ SECTION (transcript page)
   ═══════════════════════════════════════════════ */
.lp-faq {
    background: var(--surface);
}

.faq-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.15s;
}
.faq-item[open] {
    border-color: var(--primary-bd);
    background: var(--primary-bg);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    user-select: none;
    gap: 12px;
}
.faq-question::-webkit-details-marker {
    display: none;
}
.faq-question::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-3);
    flex-shrink: 0;
    line-height: 1;
}
.faq-item[open] .faq-question::after {
    content: "−";
    color: var(--primary);
}

.faq-answer {
    padding: 0 20px 16px;
    font-size: 0.9375rem;
    color: var(--text-2);
    line-height: 1.7;
}
.faq-answer a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: var(--primary-bd);
    text-underline-offset: 2px;
}
.faq-answer a:hover {
    color: var(--primary-dk);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — TRANSCRIPT PAGE ONLY
   ═══════════════════════════════════════════════ */

/* ─ Tablet (≤ 1024 px) ──────────────────────── */
@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 240px 1fr;
        padding: 12px;
        gap: 12px;
    }
    .sidebar-panel {
        max-height: calc(100vh - var(--header-h) - 24px);
    }
    .transcript-pane {
        height: calc(100vh - var(--header-h) - 24px);
    }

    /* Hide button labels at tablet — icon only */
    .toolbar-actions .btn-sm span {
        display: none;
    }
}

/* ─ Mobile (≤ 768 px) ───────────────────────── */
@media (max-width: 768px) {
    /* Workspace stacks vertically */
    .workspace {
        grid-template-columns: 1fr;
        height: auto;
        padding: 12px;
        gap: 12px;
    }
    .sidebar-panel {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    .transcript-pane {
        height: 72vh;
        min-height: 380px;
    }

    /* Hero screen */
    .hero-screen {
        min-height: calc(100vh - var(--header-h));
        padding: 40px 16px;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-sub {
        font-size: 1rem;
        max-width: 100%;
    }

    /* Search box stacks */
    .search-box {
        flex-direction: column;
        max-width: 100%;
    }
    .search-box .btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Toolbar wraps */
    .pane-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
        min-height: auto;
    }
    .toolbar-filter {
        order: 2;
        max-width: none;
        width: 100%;
    }
    .toolbar-actions {
        order: 1;
        width: 100%;
        flex-wrap: wrap;
    }
    /* Restore labels on mobile where space is dedicated */
    .toolbar-actions .btn-sm span {
        display: inline;
    }

    /* FAQ */
    .faq-question {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    .faq-answer {
        padding: 0 16px 14px;
        font-size: 0.9rem;
    }

    /* How it works */
    .how-step {
        gap: 14px;
    }
    .how-step-num {
        width: 34px;
        height: 34px;
        font-size: 0.8125rem;
    }
}

/* ─ Small Mobile (≤ 480 px) ─────────────────── */
@media (max-width: 480px) {
    .workspace {
        padding: 8px;
        gap: 8px;
    }
    .card {
        padding: 12px;
    }
    .transcript-row {
        padding: 7px 12px;
        gap: 10px;
    }
    .pane-toolbar {
        padding: 8px;
    }
}

/* ─ Short Viewport (≤ 680 px height) ────────── */
@media (max-height: 680px) {
    .hero-screen {
        justify-content: flex-start;
        padding-top: 40px;
        min-height: auto;
    }
    .transcript-pane {
        min-height: 340px;
    }
}

/* ═══════════════════════════════════════════════
   PRINT — transcript page
   ═══════════════════════════════════════════════ */
@media print {
    .sidebar-panel,
    .pane-toolbar {
        display: none !important;
    }

    .workspace {
        display: block;
        padding: 0;
        height: auto;
    }
    .transcript-pane {
        border: none;
        height: auto;
        overflow: visible;
    }
    .transcript-body {
        overflow: visible;
    }
    .transcript-row {
        border-bottom: 1px solid #ddd;
        break-inside: avoid;
        padding: 5px 0;
    }
    .ts-badge {
        background: none;
        border-color: #ccc;
        color: #666;
    }
    .ts-text {
        color: #000;
    }
}
