/* ==========================================================================
   Kamos Reels - 9:16 Vertical Video Studio & Timeline Editor
   Design System: Kamos Dark Glassmorphism & Neon Fluid Aesthetics
   ========================================================================== */

:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #12161f;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(28, 36, 56, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 242, 254, 0.5);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #9d4edd;
  --accent-pink: #ff2a85;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;

  --grad-neon: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #9d4edd 100%);
  --grad-record: linear-gradient(135deg, #ff2a85 0%, #ef4444 100%);
  --grad-glass: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%);
  
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.25);
  --shadow-record: 0 0 30px rgba(255, 42, 133, 0.4);
  --shadow-card: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans JP', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 242, 254, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(157, 78, 221, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(18, 24, 38, 0.5) 0px, transparent 100%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* App Header */
.reels-header {
  height: 64px;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--grad-neon);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.35);
  color: #050811;
  font-weight: 800;
  font-size: 16px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title span.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 12px;
  text-transform: uppercase;
}

/* Sub-Navbar (Below Kamos Header) */
.reels-subnav {
  margin: 78px auto 0 auto;
  max-width: 1600px;
  width: calc(100% - 48px);
  height: 54px;
  background: rgba(18, 24, 38, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Mode Switcher Tabs */
.mode-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 4px;
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s ease;
}

.mode-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.mode-tab.active {
  background: var(--grad-neon);
  color: #050811;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.3);
}

/* Main Container Layout */
.app-container {
  flex: 1;
  display: flex;
  gap: 24px;
  padding: 16px 24px 24px 24px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Left/Right Sidebar Panels */
.control-panel {
  width: 380px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
  overflow-y: auto;
  max-height: calc(100vh - 165px);
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title span.material-symbols-outlined {
  font-size: 16px;
  color: var(--accent-cyan);
}

/* Grid of Layout Selectors */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.layout-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.layout-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.layout-card.active {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.layout-preview-icon {
  width: 52px;
  height: 92px;
  border-radius: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-card.active .layout-preview-icon {
  border-color: var(--accent-cyan);
}

.layout-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

/* Layout Preview Schematics */
.preview-cam-full {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.4), rgba(79, 172, 254, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.preview-screen-bg {
  width: 100%;
  height: 100%;
  background: #1a2234;
  position: relative;
}

.preview-pip-circle {
  position: absolute;
  bottom: 8px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-pink);
  border: 1.5px solid #fff;
}

.preview-split-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: #1a2234;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.preview-split-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: rgba(0, 242, 254, 0.35);
}

/* Input / Dropdown / Switch Styling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.select-control, .input-control {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.select-control:focus, .input-control:focus {
  border-color: var(--accent-cyan);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.switch-label {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .2s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--grad-neon);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: #050811;
}

/* Center Stage (9:16 Canvas & Viewport) */
.stage-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 0;
}

.phone-mockup {
  position: relative;
  width: 360px;
  height: 640px; /* Exact 9:16 ratio */
  background: #000;
  border-radius: 36px;
  box-shadow: 
    0 0 0 10px #1c2230,
    0 0 0 12px rgba(255, 255, 255, 0.1),
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 242, 254, 0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.phone-notch {
  position: absolute;
  top: 8px;
  width: 100px;
  height: 18px;
  background: #1c2230;
  border-radius: 10px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.notch-camera {
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}

/* 9:16 Canvas Core (Studio & Editor) */
#renderCanvas, #editorCanvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}

/* Interactive PinP Overlay in UI */
.pip-interactive-box {
  position: absolute;
  z-index: 30;
  cursor: move;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 242, 254, 0.4);
  touch-action: none;
  transition: border-radius 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pip-interactive-box.circle {
  border-radius: 50%;
}
.pip-interactive-box.rounded {
  border-radius: 20px;
}
.pip-interactive-box.square {
  border-radius: 6px;
}

.pip-resize-handle {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: var(--accent-cyan);
  border: 2px solid #000;
  border-radius: 50%;
  cursor: se-resize;
}

/* Safe Zone & Guides Overlay */
.safe-zone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  display: none;
}

.safe-zone-overlay.active {
  display: block;
}

.safe-zone-top {
  position: absolute;
  top: 40px;
  left: 12px;
  right: 12px;
  border-top: 1px dashed rgba(245, 158, 11, 0.6);
}

.safe-zone-bottom {
  position: absolute;
  bottom: 80px;
  left: 12px;
  right: 12px;
  border-bottom: 1px dashed rgba(245, 158, 11, 0.6);
}

.safe-zone-badge {
  position: absolute;
  font-size: 9px;
  color: var(--accent-amber);
  background: rgba(0,0,0,0.6);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Recording Status Indicator on Canvas */
.canvas-live-badge {
  position: absolute;
  top: 32px;
  left: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  z-index: 35;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-rose);
  border-radius: 50%;
  animation: pulse-rec 1.2s infinite ease-in-out;
}

@keyframes pulse-rec {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* Countdown Overlay */
.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.countdown-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.countdown-number {
  font-size: 120px;
  font-weight: 900;
  background: var(--grad-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: zoom-fade 1s infinite cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes zoom-fade {
  0% { transform: scale(0.6); opacity: 0; }
  40% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Control Dock / Floating Bar */
.control-dock {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 20px;
  box-shadow: var(--shadow-card);
}

.btn-record {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--grad-record);
  border: 3px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-record);
}

.btn-record:hover {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(255, 42, 133, 0.6);
}

.btn-record.recording {
  border-radius: 14px;
  background: var(--accent-rose);
  animation: pulse-border 1.5s infinite;
}

.btn-record.recording span {
  font-size: 24px;
}

.dock-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-main);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.dock-btn.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Audio VU Meter */
.vu-meter-container {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}

.vu-meter-bar {
  width: 40px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.vu-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 60%, #f59e0b 85%, #ef4444 100%);
  transition: width 0.05s ease;
}

/* ==========================================================================
   TIMELINE EDITOR VIEW & CONTROLS
   ========================================================================== */
.timeline-studio {
  display: none;
  flex-direction: column;
  width: 100%;
  gap: 20px;
}

.timeline-studio.active {
  display: flex;
}

.editor-grid {
  display: grid;
  grid-template-columns: 360px 1fr 340px;
  gap: 20px;
  width: 100%;
  min-height: calc(100vh - 120px);
}

/* Editor Center Stage (Timeline & Track area) */
.timeline-center-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

.timeline-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.timecode-display {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0,0,0,0.4);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

/* Visual Timeline Box */
.timeline-track-container {
  position: relative;
  background: #080a0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  user-select: none;
}

.timeline-ruler {
  height: 20px;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  padding: 0 4px;
}

/* Video Track with Trim Handles */
.video-track-wrapper {
  position: relative;
  height: 64px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

.video-thumbnails-strip {
  width: 100%;
  height: 100%;
  display: flex;
  opacity: 0.6;
  pointer-events: none;
}

.trim-selection-window {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  right: 0%;
  border-top: 2px solid var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  pointer-events: none;
}

.trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  background: var(--accent-cyan);
  cursor: ew-resize;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

/* Multi-Clip Segment Blocks on Track */
.clip-segment-overlay-container {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
  z-index: 5;
}

.clip-segment-block {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 1.5px solid rgba(0, 242, 254, 0.4);
  background: rgba(0, 242, 254, 0.05);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px;
}

.clip-segment-block:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
}

.clip-segment-block.selected {
  border: 2px solid var(--accent-cyan);
  background: rgba(0, 242, 254, 0.18);
  box-shadow: inset 0 0 12px rgba(0, 242, 254, 0.3);
}

.clip-segment-block.disabled {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(239, 68, 68, 0.4);
  opacity: 0.4;
}

.clip-badge-tag {
  font-size: 9px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent-cyan);
  padding: 1px 4px;
  border-radius: 3px;
  pointer-events: none;
}

.clip-split-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  pointer-events: none;
}

/* Clip Item in Sidebar */
.clip-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.clip-item-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.clip-item-card.selected {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
}

.trim-handle::after {
  content: "||";
  font-size: 8px;
  color: #000;
  font-weight: 900;
}

.trim-handle.in-handle {
  left: 0%;
  transform: translateX(0);
}

.trim-handle.out-handle {
  right: 0%;
  transform: translateX(0);
}

/* Playhead Scrubber */
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2px;
  background: var(--accent-pink);
  z-index: 25;
  pointer-events: none;
  box-shadow: 0 0 8px var(--accent-pink);
}

.playhead-head {
  position: absolute;
  top: -6px;
  left: -5px;
  width: 12px;
  height: 12px;
  background: var(--accent-pink);
  transform: rotate(45deg);
  border-radius: 2px;
}

/* Overlay / Subtitle Track */
.text-track-wrapper {
  position: relative;
  height: 38px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255,255,255,0.1);
  overflow: hidden;
}

.text-track-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 10%;
  width: 50%;
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.4), rgba(79, 172, 254, 0.4));
  border: 1px solid var(--accent-purple);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
}

/* Text / Telop Editor Items */
.caption-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
}

.caption-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.caption-item.active {
  border-color: var(--accent-purple);
  background: rgba(157, 78, 221, 0.08);
}

.caption-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

/* Exporting Overlay Modal */
.export-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.export-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.export-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8), var(--shadow-glow);
}

.export-progress-ring {
  width: 80px;
  height: 80px;
  position: relative;
}

/* Button Variants */
.btn-primary {
  background: var(--grad-neon);
  color: #050811;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 242, 254, 0.3);
  transition: all 0.2s;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 242, 254, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .app-container {
    flex-direction: column;
    align-items: center;
  }
  .control-panel {
    width: 100%;
    max-width: 600px;
    max-height: none;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
}
