/* ============================================
   Interpreter Practice Studio — style.css
   Color Palette:
     --dark-aqua:   #08708a
     --light-aqua:  #56b1bf
     --pink:        #c54a71
     --yellow:      #ffe932
     --sand:        #d0d3c5
     --red:         #d73a31
     --dark-green:  #032b2f
   ============================================ */

   :root {
    --dark-aqua: #08708a;
    --light-aqua: #56b1bf;
    --pink: #c54a71;
    --yellow: #ffe932;
    --sand: #d0d3c5;
    --red: #d73a31;
    --dark-green: #032b2f;
    --bg: #021e21;
    --card: #043a40;
    --input: #065460;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--sand);
    min-height: 100vh;
}

/* ── Nav ── */
.nav {
    background: var(--dark-green);
    border-bottom: 2px solid var(--dark-aqua);
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 20px;
    gap: 6px;
}
.nav-logo {
    color: var(--yellow);
    font-weight: 800;
    font-size: 17px;
    margin-right: 24px;
}
.nav-btn {
    background: transparent;
    color: var(--sand);
    border: none;
    padding: 7px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.08); }
.nav-btn.active { background: var(--dark-aqua); color: #fff; }
.nav-info {
    margin-left: auto;
    color: var(--light-aqua);
    font-size: 11px;
}

/* ── Pages ── */
.page { padding: 18px; display: none; }
.page.active { display: block; }
.page-flex { display: none; }
.page-flex.active { display: flex; padding: 18px; gap: 16px; height: calc(100vh - 56px); }

/* ── Cards ── */
.card {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
}

/* ── Buttons ── */
.btn {
    background: var(--dark-aqua);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { background: #333; color: #666; cursor: not-allowed; filter: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-pink { background: var(--pink); }
.btn-red { background: var(--red); }
.btn-input { background: var(--input); }
.btn-yellow { background: var(--yellow); color: var(--dark-green); }
.btn.active { background: var(--yellow); color: var(--dark-green); }

/* ── Inputs ── */
.input, .select, .textarea {
    background: var(--input);
    border: 1px solid var(--dark-aqua);
    border-radius: 6px;
    color: var(--sand);
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    font-family: inherit;
}
.textarea {
    min-height: 120px;
    font-family: monospace;
    resize: vertical;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--light-aqua);
}

/* ── Sidebar (Practice) ── */
.sidebar {
    width: 260px;
    min-width: 200px;
    background: var(--card);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar h3 { color: var(--light-aqua); font-size: 15px; margin-bottom: 10px; }
.sidebar-filters { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.sidebar-list { flex: 1; overflow-y: auto; }
.speech-item {
    padding: 9px 11px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.speech-item:hover { background: rgba(255,255,255,0.06); }
.speech-item.selected {
    background: var(--dark-aqua);
    border-color: var(--light-aqua);
}
.speech-item-title { color: var(--sand); font-size: 13px; font-weight: 600; }
.speech-item-meta { color: var(--light-aqua); font-size: 11px; margin-top: 3px; }

/* ── Player ── */
.player { margin-bottom: 14px; }
.player-title { color: var(--yellow); font-size: 18px; font-weight: 700; }
.player-lang {
    background: var(--input);
    padding: 3px 10px;
    border-radius: 16px;
    color: var(--light-aqua);
    font-size: 12px;
}
.progress-bar {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    height: 7px;
    margin: 12px 0;
    cursor: pointer;
    position: relative;
}
.progress-fill {
    background: linear-gradient(90deg, var(--light-aqua), var(--pink));
    height: 100%;
    border-radius: 4px;
    transition: width 0.1s;
}
.controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.time-display {
    margin-left: auto;
    color: var(--sand);
    font-family: monospace;
    font-size: 15px;
}

/* ── Transcript ── */
.transcript-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.transcript-header h3 { color: var(--light-aqua); font-size: 14px; }
.transcript-body {
    flex: 1;
    background: var(--card);
    border-radius: 12px;
    padding: 18px;
    overflow-y: auto;
    line-height: 2;
}
.cue-line {
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: 16px;
}
.cue-line.active {
    background: rgba(86,177,191,0.15);
    border-left-color: var(--yellow);
    color: #fff;
}
.cue-time {
    color: var(--light-aqua);
    font-size: 11px;
    font-family: monospace;
    margin-right: 8px;
}
.cue-word {
    cursor: pointer;
    padding: 1px 2px;
    border-radius: 3px;
    transition: all 0.15s;
}
.cue-word:hover {
    background: var(--dark-aqua);
    color: var(--yellow);
}

/* ── Video ── */
.video-embed {
    width: 100%;
    border-radius: 8px;
    border: none;
    margin-bottom: 12px;
}
video.video-embed { max-height: 320px; background: #000; }
iframe.video-embed { height: 300px; }

/* ── Loading spinner ── */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--light-aqua);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Flash notification ── */
.flash {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--pink);
    color: #fff;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    z-index: 999;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Error box ── */
.error-box {
    background: rgba(215,58,49,0.15);
    border: 1px solid var(--red);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
}
.error-box small { color: #888; font-size: 11px; display: block; margin-top: 3px; }

/* ── Vocab Table ── */
.vocab-table { width: 100%; border-collapse: collapse; }
.vocab-table th {
    color: var(--light-aqua);
    padding: 10px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 2px solid var(--dark-aqua);
}
.vocab-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.vocab-word { color: var(--yellow); font-weight: 600; font-size: 14px; }
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
}
.status-badge.active { background: rgba(86,177,191,0.2); color: var(--light-aqua); }
.status-badge.archived { background: rgba(255,255,255,0.06); color: #777; }

/* ── Review Cards ── */
.review-grid { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.review-option {
    background: var(--card);
    border: 2px solid var(--light-aqua);
    border-radius: 16px;
    padding: 28px 34px;
    cursor: pointer;
    text-align: center;
    width: 180px;
    transition: transform 0.2s;
}
.review-option:hover { transform: scale(1.05); }
.review-option .icon { font-size: 36px; margin-bottom: 10px; }
.review-option .label { font-weight: 700; font-size: 17px; }

.flashcard {
    border: 2px solid var(--light-aqua);
    border-radius: 18px;
    padding: 44px;
    cursor: pointer;
    text-align: center;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card);
    transition: all 0.3s;
}
.flashcard.flipped { background: linear-gradient(135deg, var(--dark-aqua), var(--card)); }
.flashcard .main-word { font-size: 30px; font-weight: 700; }
.flashcard .hint { color: #555; font-size: 11px; margin-top: 10px; }

/* ── Media Manager ── */
.media-list-item {
    background: var(--card);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}
.media-list-item .icon { font-size: 24px; }
.media-list-item .info { flex: 1; min-width: 0; }
.media-list-item .info .title { color: var(--sand); font-weight: 600; font-size: 14px; }
.media-list-item .info .meta { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.media-list-item .info .meta span { font-size: 11px; }
.no-subs { color: var(--red); }
.has-subs { color: var(--light-aqua); }

/* ── Subtitle preview ── */
.sub-preview {
    margin-top: 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 10px;
}
.sub-preview .label { color: var(--light-aqua); font-size: 11px; margin-bottom: 6px; }
.sub-preview .cue { color: var(--sand); font-size: 12px; margin-bottom: 4px; }
.sub-preview .cue .ts { color: var(--light-aqua); font-family: monospace; margin-right: 6px; }

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 18px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 14px; }
.mb-lg { margin-bottom: 20px; }
.text-center { text-align: center; }
.max-w-md { max-width: 760px; margin: 0 auto; }
.hidden { display: none !important; }
.overflow-auto { overflow-y: auto; }