/* AIHA Cinema Player Styles - Premium Dark Glassmorphic Design */
:root {
  --bg-main: #08090d;
  --bg-card: rgba(18, 23, 34, 0.75);
  --bg-card-hover: rgba(28, 36, 52, 0.85);
  --bg-input: rgba(13, 17, 26, 0.85);
  --border-color: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(99, 102, 241, 0.4);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-width: 380px;
  --header-height: 60px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* App Shell */
.player-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
              var(--bg-main);
}

/* Top Navigation Bar */
.top-nav {
  height: var(--header-height);
  min-height: var(--header-height);
  background: rgba(13, 17, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: linear-gradient(90deg, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

/* Extension Status Pill */
.ext-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}
.ext-status-pill:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: #f1f5f9;
}
.ext-status-pill.connected {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
  color: #6ee7b7;
}
.ext-status-pill.no-config {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
}
.ext-status-pill.disconnected {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

.ext-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ext-dot.checking { background: #64748b; animation: pulse-dot 1.2s infinite; }
.ext-dot.connected { background: #34d399; box-shadow: 0 0 6px #34d399; }
.ext-dot.disconnected { background: #f87171; box-shadow: 0 0 6px rgba(248, 113, 113, 0.6); }
.ext-dot.no-config { background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.6); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}


/* Film Meta Bar */
.film-meta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  max-width: 420px;
}

.film-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.film-code-badge:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(99, 102, 241, 0.6);
  color: #ffffff;
}

.badge-edit {
  font-size: 10px;
  opacity: 0.7;
}

.film-file-name {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* Top Actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.action-btn.highlight {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  border-color: rgba(139, 92, 246, 0.4);
  color: #e0e7ff;
}

.action-btn.highlight:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.4));
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.action-btn.icon-only {
  padding: 6px 9px;
  font-size: 14px;
}

/* Dropdown Menu */
.dropdown-wrap {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(18, 23, 34, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 190px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 100;
}

.dropdown-wrap.open .dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-menu button {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  padding: 8px 12px;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-menu button:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #ffffff;
}

/* Workspace Layout */
.workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height));
  position: relative;
  overflow: hidden;
}

/* Cinema Section (Left / Center) */
.cinema-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  background: #000000;
  position: relative;
  overflow: hidden;
}

.video-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
}

#aihaVideo {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000000;
  display: block;
}

/* Drop Zone / Empty State */
.drop-zone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.5) 0%, rgba(8, 9, 13, 0.95) 100%);
  z-index: 20;
  transition: all 0.2s ease;
}

.drop-zone.dragover {
  background: rgba(99, 102, 241, 0.15);
  border: 2px dashed var(--primary);
}

.drop-zone.hidden {
  display: none;
}

.drop-card {
  text-align: center;
  max-width: 480px;
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  background: rgba(18, 23, 34, 0.6);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.drop-icon {
  font-size: 54px;
  margin-bottom: 16px;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.drop-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.drop-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.drop-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.drop-hint {
  font-size: 12px;
  color: #a5b4fc;
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-hover);
}

/* Subtitle Floating Overlay */
.subtitle-overlay {
  position: absolute;
  bottom: 45px; /* Mặc định: Chân video */
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  min-width: 200px;
  text-align: center;
  pointer-events: auto;
  cursor: grab;
  z-index: 25;
  user-select: none;
  touch-action: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: outline 0.15s ease;
}

.subtitle-overlay:hover {
  outline: 1px dashed rgba(255, 255, 255, 0.25);
}

.subtitle-overlay.is-dragging {
  cursor: grabbing !important;
  outline: 2px dashed rgba(99, 102, 241, 0.8) !important;
  background: rgba(0, 0, 0, 0.25);
}

.subtitle-overlay.bottom-pos {
  top: auto;
  bottom: 45px;
}

.subtitle-overlay.top-pos {
  top: 36px;
  bottom: auto;
}

.subtitle-overlay.hidden-overlay {
  display: none !important;
}

.sub-line {
  display: block;
  padding: 2px 8px;
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  border: none !important;
  margin-bottom: 2px;
}

.sub-vi {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
  letter-spacing: 0.8px;
  -webkit-text-stroke: 3.5px #000000;
  paint-order: stroke fill;
  text-shadow: 
    0 0 2px #000,
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    0 3px 8px rgba(0, 0, 0, 0.9);
}

.sub-orig {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.25;
  -webkit-text-stroke: 2.5px #000000;
  paint-order: stroke fill;
  text-shadow: 0 0 3px #000, 1px 1px 0 #000, -1px -1px 0 #000;
  opacity: 0.9;
}

.sub-vi:empty, .sub-orig:empty {
  display: none;
}

/* Cinema Toast */
.cinema-toast {
  position: absolute;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 40;
}

.cinema-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Cinema Controls Bar */
.cinema-controls {
  height: 84px;
  background: linear-gradient(180deg, rgba(13, 17, 26, 0.88) 0%, rgba(8, 9, 13, 0.98) 100%);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 30;
}

/* Timeline Container */
.timeline-container {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.timeline-buffered, .timeline-played {
  position: absolute;
  height: 5px;
  border-radius: 3px;
  pointer-events: none;
  top: 5.5px;
}

.timeline-buffered {
  width: 0%;
  background: rgba(255, 255, 255, 0.22);
}

.timeline-played {
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.timeline-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5), 0 0 12px var(--primary-glow);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.timeline-slider:hover::-webkit-slider-thumb {
  transform: scale(1.3);
}

.timeline-hover-time {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  display: none;
  z-index: 10;
}

/* Cue Markers on timeline */
.timeline-cue-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  height: 5px;
  top: 5.5px;
}

.cue-marker {
  position: absolute;
  width: 2px;
  height: 5px;
  background: rgba(254, 240, 138, 0.65);
  transform: translateX(-50%);
}

/* Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.controls-group.center-group {
  gap: 10px;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.ctrl-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
}

.ctrl-btn.play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  font-size: 15px;
  padding: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.ctrl-btn.play-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: scale(1.06);
}

.ctrl-btn.ai-btn {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

.ctrl-btn.ai-btn:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.55);
}

.ctrl-btn.icon-only {
  padding: 6px 8px;
  font-size: 14px;
}

.status-dot-off {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.status-dot-on {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Time display */
.time-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  margin-left: 6px;
}

.time-sep {
  opacity: 0.5;
}

/* Offset timing pill */
.offset-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
}

.offset-label {
  color: var(--text-dim);
}

#offsetValueText {
  color: #a5b4fc;
  font-weight: 600;
  min-width: 32px;
  text-align: center;
}

.offset-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.offset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Volume Wrap */
.volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 64px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

/* Speed Select */
.speed-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.speed-select:hover {
  border-color: var(--border-hover);
}

.speed-select option {
  background: #111827;
  color: #ffffff;
}

/* Transcript Sidebar (Right) */
.transcript-sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: rgba(13, 17, 26, 0.95);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
  z-index: 40;
}

.transcript-sidebar.collapsed {
  width: 0;
  border-left-color: transparent;
  transform: translateX(100%);
  display: none;
}

/* Sidebar Header */
.sidebar-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-with-badge h2 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.cue-count-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

.pill-toggle {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-toggle.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* Search Bar */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--primary);
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
  display: none;
}

/* Cue Scroll Area */
.cue-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.cue-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.cue-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.cue-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.cue-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Empty Transcript */
.empty-transcript {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-transcript p {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.empty-transcript small {
  font-size: 12px;
  line-height: 1.4;
  display: block;
}

/* Cue Cards */
.cue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cue-card {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.cue-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(2px);
}

.cue-card.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.cue-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cue-time-badge {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #818cf8;
}

.cue-speaker-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.cue-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cue-card:hover .cue-actions {
  opacity: 1;
}

.cue-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 11px;
}

.cue-copy-btn:hover {
  color: #ffffff;
}

.cue-text-vi {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 2px;
}

.cue-text-orig {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

.footer-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.footer-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.footer-btn.danger {
  color: #f87171;
}

.footer-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 90%;
  max-width: 620px;
  background: rgba(18, 23, 34, 0.98);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.modal-sm {
  max-width: 420px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(13, 17, 26, 0.6);
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, textarea, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: #ffffff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-input:focus, textarea:focus, .form-select:focus {
  border-color: var(--primary);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #a5b4fc;
}

/* Polish Status Box */
.polish-status-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #c7d2fe;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  transition: width 0.3s ease;
}

/* Cache File List in Modal */
.cache-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.cache-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.cache-item:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
}

.cache-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cache-item-icon {
  font-size: 20px;
}

.cache-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.cache-item-size {
  font-size: 11px;
  color: var(--text-dim);
}

.loading-cache {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  :root {
    --sidebar-width: 300px;
  }
  .film-meta-bar {
    display: none;
  }
}
