@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   1. TECH GIANT DESIGN SYSTEM & RESET
   ========================================================================== */
:root {
  /* Slate/Titanium Dark Slate Palette */
  --bg-app: hsl(224, 25%, 3.5%);
  --bg-card: hsla(224, 22%, 7%, 0.6);
  --border-subtle: hsla(0, 0%, 100%, 0.05);
  --border-hover: hsla(0, 0%, 100%, 0.1);
  --border-glow-cyan: hsla(187, 92%, 46%, 0.25);
  --border-glow-red: hsla(0, 84%, 60%, 0.25);
  
  /* Accents */
  --accent-cyan: hsl(187, 92%, 46%);
  --accent-cyan-glow: hsla(187, 92%, 46%, 0.15);
  --accent-red: hsl(0, 84%, 60%);
  --accent-red-glow: hsla(0, 84%, 60%, 0.2);
  --accent-green: hsl(142, 70%, 45%);
  --accent-green-glow: hsla(142, 70%, 45%, 0.15);
  --accent-gold: hsl(45, 95%, 50%);
  
  /* Text scales */
  --text-primary: hsl(0, 0%, 98%);
  --text-secondary: hsl(220, 12%, 72%);
  --text-muted: hsl(220, 8%, 46%);
  
  /* Border radius & transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --radius-circle: 50%;
  
  --bg-dialog: hsla(224, 25%, 7%, 0.92);
  --dialog-backdrop: rgba(2, 3, 5, 0.8);
  --dialog-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  
  --bg-toast: hsla(224, 25%, 7%, 0.85);
  --toast-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  letter-spacing: -0.015em;
}

/* Subtle glowing background orbs */
body::before, body::after {
  content: '';
  position: absolute;
  width: 45vw;
  height: 45vw;
  border-radius: var(--radius-circle);
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.06;
}

body::before {
  top: -10%;
  right: 5%;
  background: var(--accent-cyan);
}

body::after {
  bottom: -5%;
  left: 5%;
  background: var(--accent-red);
}

/* Custom minimal scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsla(0, 0%, 100%, 0.08);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: hsla(0, 0%, 100%, 0.18);
}

/* ==========================================================================
   2. REUSABLE PREMIUM CARD & BUTTON STYLES
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6);
  transition: all var(--transition-normal);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

/* 
   Prevent browser hit-testing and event bubbling bugs on inner icon/label elements inside buttons.
   Especially critical inside containers utilizing backdrop-filter (like .viewport-stage), 
   where nested SVGs or spans can block/intercept clicks while still showing a pointer cursor.
*/
button * {
  pointer-events: none;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-app);
}

.btn-primary:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: hsla(0, 0%, 100%, 0.04);
  color: var(--text-primary);
  border: 1px solid hsla(0, 0%, 100%, 0.06);
}

.btn-secondary:hover:not(:disabled) {
  background: hsla(0, 0%, 100%, 0.08);
  border-color: hsla(0, 0%, 100%, 0.12);
  transform: translateY(-1.5px);
}

.btn-danger {
  background: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-red-glow);
}

.btn-danger:hover:not(:disabled) {
  background: hsl(0, 84%, 64%);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 24px hsla(0, 84%, 60%, 0.35);
}

.btn:disabled {
  background: hsla(0, 0%, 100%, 0.02) !important;
  color: var(--text-muted) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   3. STICKY HEADER & CORE NAV
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 16px 40px;
  z-index: 100;
  background: hsla(224, 25%, 3.5%, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  header {
    padding: 16px 20px;
  }
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  cursor: pointer;
  letter-spacing: -0.04em;
  margin: 0;
  padding: 0;
}

.logo svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent-cyan);
}

.logo-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-cyan);
  background: var(--accent-cyan-glow);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  margin-left: 2px;
}

.header-center-info {
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .header-center-info {
    display: none;
  }
}

.privacy-bullet {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: hsla(0, 0%, 100%, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bullet-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.bullet-dot.pulse {
  animation: bulletPulse 2s infinite;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: hsla(0, 0%, 100%, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.badge-live::before {
  content: '';
  width: 5px;
  height: 5px;
  background-color: var(--accent-cyan);
  border-radius: var(--radius-circle);
  box-shadow: 0 0 6px var(--accent-cyan);
  animation: dotBlink 1.5s infinite alternate;
}

.badge-security svg {
  width: 12px;
  height: 12px;
  color: var(--accent-cyan);
}

/* ==========================================================================
   4. CORE WORKSPACE GRID (Cinema Monitor Full Width)
   ========================================================================== */
.workspace-container {
  max-width: 1360px;
  margin: 40px auto 60px;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@media (max-width: 768px) {
  .workspace-container {
    padding: 0 16px;
    margin: 25px auto 45px;
  }
}

/* 4.1 Large Cinema Viewport Stage */
.main-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.viewport-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 75vh;
  overflow: hidden;
  background: #030509;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 45px rgba(0,0,0,0.9);
  border: 1px solid var(--border-subtle);
  transition: aspect-ratio var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
}

/* Smart glowing borders representing work states */
.viewport-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
  transition: border var(--transition-normal);
}

.viewport-stage.recording-active::after {
  border-color: var(--accent-red);
  box-shadow: inset 0 0 20px hsla(0, 84%, 60%, 0.08);
}

.viewport-stage.sharing-active::after {
  border-color: var(--accent-cyan);
  box-shadow: inset 0 0 20px hsla(187, 92%, 46%, 0.08);
}

.stage-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.006) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.006) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
  pointer-events: none;
  z-index: 1;
}

.stage-scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 2;
}

.viewport-video-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: blur(45px) brightness(0.55) saturate(1.3);
  opacity: 0.55;
  pointer-events: none;
  display: none;
  transition: opacity var(--transition-normal);
}

.viewport-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 3;
  display: none;
}

/* Top-Left active floating status pill */
.stage-indicator {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(3, 5, 9, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 5;
  transition: all var(--transition-fast);
}

.stage-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background-color: var(--text-muted);
  box-shadow: none;
}

.stage-indicator.active .dot {
  animation: blinkRed 1.2s infinite alternate;
}

/* Center radar HUD placeholder target */
.stage-placeholder {
  z-index: 4;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px;
  transition: opacity var(--transition-normal);
}

.hud-radar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.hud-circle-orbit {
  position: absolute;
  border: 1px dashed rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-circle);
}

.hud-circle-orbit.path-1 {
  width: 120px;
  height: 120px;
  animation: spinCw 40s linear infinite;
}

.hud-circle-orbit.path-2 {
  width: 90px;
  height: 90px;
  border-style: solid;
  border-width: 1px;
  border-color: rgba(6, 182, 212, 0.08) transparent;
  animation: spinCcw 15s linear infinite;
}

.hud-circle-orbit.path-3 {
  width: 60px;
  height: 60px;
  border-color: rgba(6, 182, 212, 0.2);
  animation: pulseGlow 3s ease-in-out infinite;
}

.hud-center-node {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-circle);
  background: hsla(187, 92%, 46%, 0.06);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 20px var(--accent-cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--accent-cyan);
}

.hud-center-node svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity 0.5s ease;
}

.hud-icon-screen { opacity: 1; }
.hud-icon-mic { opacity: 0; }
.hud-icon-sys { opacity: 0; }

.hud-radar-wrapper:hover .hud-icon-screen { opacity: 0; }
.hud-radar-wrapper:hover .hud-icon-mic { opacity: 1; }

.placeholder-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.placeholder-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 320px;
  line-height: 1.6;
}

/* In-Screen giant start button */
.btn-hud-capture {
  background: var(--text-primary) !important;
  color: var(--bg-app) !important;
  border-radius: var(--radius-pill) !important;
  padding: 13px 26px !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 24px var(--accent-cyan-glow) !important;
  transition: all var(--transition-fast) !important;
  border: 1px solid transparent !important;
}

.btn-hud-capture:hover {
  background: #ffffff !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 12px 30px hsla(187, 92%, 46%, 0.35) !important;
}

/* ==========================================================================
   5. METAMORPHIC HUD CAPSULE TOOLBAR (Overlay on Viewport Bottom)
   ========================================================================= */
.viewport-floating-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  background: hsla(224, 20%, 8%, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.98;
  transition: all var(--transition-normal);
  pointer-events: auto;
}

.viewport-floating-bar.hidden {
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden; /* Prevent any potential layout overlapping or hit-testing interference when hidden */
}

.float-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  align-self: center; /* Aggressively force cross-axis centering */
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.float-btn-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.float-btn-icon svg {
  width: 100%;
  height: 100%;
}

.float-btn:hover {
  background: hsla(0, 0%, 100%, 0.05);
  color: var(--text-primary);
}

.float-btn.active {
  color: var(--accent-cyan);
  background: var(--accent-cyan-glow);
}

.float-btn.disabled, .float-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: transparent !important;
  color: var(--text-muted) !important;
}

.float-divider {
  width: 1px;
  height: 20px;
  background: hsla(0, 0%, 100%, 0.08);
  margin: 0 4px;
}

/* Setup Config groups */
.float-setup-group {
  display: flex;
  align-items: center;
  align-self: center; /* Aggressively force cross-axis centering inside parent capsule bar */
  gap: 6px;
}

/* Integrated Popover Options Card Bubble */
.settings-popover-container {
  position: relative;
  display: flex;        /* Convert to standard flex block to prevent baseline alignment bugs */
  align-items: center;  /* Center the button child */
  align-self: center;   /* Aggressively force cross-axis centering in the setup group */
  width: max-content;   /* Force the container to tightly fit only the button, ignoring absolutely positioned popover width */
}

.float-settings-popover {
  position: absolute;
  bottom: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 100;
  width: 320px;
  padding: 16px;
  background: hsla(224, 25%, 5%, 0.9);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: var(--radius-md);
  text-align: left;
}

/* Triangle indicator pointing down */
.float-settings-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: hsla(224, 25%, 5%, 0.9) transparent transparent transparent;
}

.float-settings-popover.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.popover-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popover-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Quality preset pills inside Popover */
.quality-pills {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quality-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: hsla(0, 0%, 100%, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quality-pill:hover {
  background: hsla(0, 0%, 100%, 0.04);
}

.quality-pill.selected {
  border-color: var(--accent-cyan);
  background: hsla(187, 92%, 46%, 0.04);
}

.quality-pill .q-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.quality-pill.selected .q-label {
  color: var(--text-primary);
}

.quality-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  background: hsla(0, 0%, 100%, 0.05);
  border-radius: 4px;
  color: var(--text-secondary);
}

.quality-pill.selected .quality-badge {
  background: var(--accent-cyan);
  color: var(--bg-app);
}

.mini-visualizer-wrap {
  width: 36px;
  height: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  flex-shrink: 0;
  box-shadow: none;
}

.mini-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Left timer & pause slide components */
.float-timer-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: hsla(0, 84%, 60%, 0.1);
  border: 1px solid hsla(0, 84%, 60%, 0.25);
  border-radius: var(--radius-pill);
  color: var(--accent-red);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.float-timer-wrapper .record-indicator-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
  animation: dotBlink 1.2s infinite alternate;
}

.float-pause-btn {
  background: hsla(0, 0%, 100%, 0.03) !important;
  border: 1px solid var(--border-subtle) !important;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-circle) !important;
  padding: 0 !important;
  justify-content: center;
}

.float-pause-btn:hover {
  background: hsla(0, 0%, 100%, 0.08) !important;
  border-color: var(--border-hover) !important;
  color: var(--text-primary) !important;
}

.float-pause-btn svg {
  width: 12px;
  height: 12px;
}

/* Master Action control Buttons inside capsule */
.btn-float-record {
  border-radius: var(--radius-pill) !important;
  padding: 8px 18px !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-circle);
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.btn-float-record:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-float-record.recording-mode {
  background: var(--accent-red) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 15px var(--accent-red-glow) !important;
}

.btn-float-record.recording-mode .record-indicator-dot {
  background-color: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  animation: pulseWhite 1.5s infinite;
}

.btn-float-stop {
  border-radius: var(--radius-pill) !important;
  padding: 8px 18px !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   8. DISASTER RECOVERY OVERLAYS
   ========================================================================== */
.crash-banner {
  display: none;
  max-width: 1360px;
  margin: 20px auto 0;
  padding: 0 28px;
  animation: slideUp var(--transition-normal);
}

@media (max-width: 768px) {
  .crash-banner {
    padding: 0 16px;
  }
}

.crash-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, hsla(45, 95%, 50%, 0.08), hsla(0, 0%, 100%, 0.01));
}

@media (max-width: 768px) {
  .crash-card {
    flex-direction: column;
    align-items: stretch;
  }
}

.crash-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crash-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-circle);
  background: hsla(45, 95%, 50%, 0.1);
  border: 1px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.crash-icon svg {
  width: 18px;
  height: 18px;
}

.crash-info {
  display: flex;
  flex-direction: column;
}

.crash-headline {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-gold);
}

.crash-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.crash-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   9. COMPILE EXPORT STATION & PREVIEW HUB
   ========================================================================== */
.compile-station {
  display: none;
  max-width: 1360px;
  margin: 0 auto 35px;
  padding: 0 28px;
  animation: slideUp var(--transition-normal);
}

@media (max-width: 768px) {
  .compile-station {
    padding: 0 16px;
  }
}

.compile-card {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
}

@media (max-width: 850px) {
  .compile-card {
    grid-template-columns: 1fr;
  }
}

.compile-player-wrapper {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 16/9;
}

.compile-player-wrapper video {
  width: 100%;
  height: 100%;
  display: block;
}

.compile-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.compile-title-h {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.compile-sub-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

.compile-meta-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.compile-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: hsla(0, 0%, 100%, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-align: center;
}

.compile-meta-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.compile-meta-value {
  font-size: 0.9rem;
  font-weight: 800;
}

.download-desk {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-name-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-name-input-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.file-name-input {
  background: hsla(0, 0%, 100%, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  transition: all var(--transition-fast);
}

.file-name-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: hsla(0, 0%, 100%, 0.04);
}

.download-actions-row {
  display: flex;
  gap: 8px;
}

.btn-download-act {
  flex: 1;
}

/* ==========================================================================
   11. ANIMATIONS & DIALOG OVERLAYS
   ========================================================================== */
@keyframes dotBlink {
  0% { opacity: 0.25; }
  100% { opacity: 1; }
}

@keyframes bulletPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes blinkRed {
  0% {
    background-color: hsla(0, 84%, 60%, 0.3);
    box-shadow: 0 0 2px hsla(0, 84%, 60%, 0.2);
  }
  100% {
    background-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
  }
}

@keyframes spinCw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinCcw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
    box-shadow: 0 0 15px var(--accent-cyan-glow);
  }
}

@keyframes pulseWhite {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* System Dialog Modal Overlay */
dialog {
  margin: auto;
  background: var(--bg-dialog);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  color: var(--text-primary);
  max-width: 450px;
  width: 90%;
  box-shadow: var(--dialog-shadow);
  z-index: 1000;
}

dialog::backdrop {
  background: var(--dialog-backdrop);
  backdrop-filter: blur(5px);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.dialog-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.dialog-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-close-btn:hover {
  background: hsla(0, 0%, 100%, 0.05);
  color: var(--text-primary);
}

.dialog-close-btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   12. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast-card {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  padding: 12px 18px;
  background: var(--bg-toast);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--toast-shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 0.8rem;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast-card.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-card.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
}

.toast-info .toast-icon {
  color: var(--accent-cyan);
}

.toast-warning .toast-icon {
  color: var(--accent-gold);
}

.toast-content {
  flex: 1;
  line-height: 1.4;
  font-weight: 600;
}

/* ==========================================================================
   13. PREMIUM INTERACTIVE HEADER ACTIONS
   ========================================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-action-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  background: hsla(0, 0%, 100%, 0.04);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.header-action-btn svg {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   13b. LANGUAGE SELECTOR DROPDOWN STYLING
   ========================================================================== */
.lang-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-chevron {
  font-size: 0.5rem;
  margin-left: 2px;
  opacity: 0.6;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-dropdown-wrapper.active .dropdown-chevron {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 130px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10001;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-dropdown-item {
  padding: 8px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.lang-dropdown-item:hover {
  background: hsla(0, 0%, 100%, 0.04);
  color: var(--text-primary);
}

.lang-dropdown-item.active {
  background: hsla(187, 92%, 46%, 0.1);
  color: var(--accent-cyan);
}

/* Light Theme overrides for dropdown menu */
body.theme-light .lang-dropdown-item:hover {
  background: hsla(220, 20%, 10%, 0.04);
}

body.theme-light .lang-dropdown-item.active {
  background: hsla(187, 92%, 46%, 0.06);
}

/* ==========================================================================
   14. ABOUT PROJECT PANEL STYLING
   ========================================================================== */
.about-dialog-panel {
  max-width: 580px !important;
  width: 90% !important;
  padding: 24px !important;
}

.about-dialog-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

.about-hero {
  text-align: center;
  background: hsla(0, 0%, 100%, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.about-media-wrapper {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  background: #020306;
}

.about-hud-image {
  width: 100%;
  height: auto;
  display: block;
}

.about-hero-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-cyan);
}

.about-hero-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .about-features {
    grid-template-columns: 1fr;
  }
}

.about-feature-card {
  display: flex;
  gap: 10px;
  background: hsla(0, 0%, 100%, 0.01);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.about-feature-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  margin-top: 2px;
}

.about-feature-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-feature-info h5 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.about-feature-info p {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.about-action-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.btn-about-close-act {
  padding: 10px 36px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border-radius: var(--radius-pill) !important;
}

/* ==========================================================================
   15. PREMIUM LIGHT THEME OVERRIDES
   ========================================================================== */
/* Nordic Light Theme Override */
body.theme-light {
  --bg-app: hsl(220, 20%, 92%);
  --bg-card: hsla(220, 20%, 100%, 0.94);
  --border-subtle: hsla(220, 20%, 10%, 0.12);
  --border-hover: hsla(220, 20%, 10%, 0.22);
  --border-glow-cyan: hsla(187, 92%, 46%, 0.4);
  --border-glow-red: hsla(0, 84%, 60%, 0.35);
  --accent-cyan: hsl(187, 92%, 46%);
  --accent-cyan-glow: hsla(187, 92%, 46%, 0.2);
  --accent-red: hsl(0, 84%, 60%);
  --accent-red-glow: hsla(0, 84%, 60%, 0.2);
  --text-primary: hsl(224, 25%, 12%);
  --text-secondary: hsl(220, 12%, 35%);
  --text-muted: hsl(220, 8%, 55%);
  
  --bg-dialog: hsla(220, 20%, 100%, 0.95);
  --dialog-backdrop: rgba(10, 15, 30, 0.4);
  --dialog-shadow: 0 30px 60px rgba(10, 15, 30, 0.15);
  
  --bg-toast: hsla(220, 20%, 100%, 0.9);
  --toast-shadow: 0 12px 30px rgba(10, 15, 30, 0.1);
}

/* Adjustments for Nordic Light Glassmorphism & High-Contrast Stage */
body.theme-light .glass-card {
  box-shadow: 0 20px 48px rgba(10, 15, 30, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.7);
  background: hsla(220, 20%, 100%, 0.95);
}

body.theme-light .viewport-stage {
  background: #ffffff !important;
  border: 1px solid rgba(220, 20%, 10%, 0.12) !important;
  box-shadow: 0 28px 70px rgba(10, 15, 30, 0.13), inset 0 1px 1px rgba(255, 255, 255, 1) !important;
}

body.theme-light .viewport-stage.sharing-active {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 28px 70px rgba(10, 15, 30, 0.13), 0 0 20px var(--accent-cyan-glow) !important;
}

body.theme-light .viewport-stage.recording-active {
  border-color: var(--accent-red) !important;
  box-shadow: 0 28px 70px rgba(10, 15, 30, 0.13), 0 0 20px var(--accent-red-glow) !important;
}

body.theme-light .quality-pill {
  background: hsla(220, 20%, 10%, 0.02);
}

body.theme-light .quality-pill:hover {
  background: hsla(220, 20%, 10%, 0.04);
}

body.theme-light .quality-pill.selected {
  background: hsla(187, 92%, 46%, 0.06);
}

body.theme-light .mini-visualizer-wrap {
  background: transparent;
}

body.theme-light header {
  background: hsla(220, 20%, 96%, 0.6);
  border-bottom-color: rgba(220, 20%, 10%, 0.08);
}

body.theme-light .header-action-btn:hover {
  background: hsla(220, 20%, 10%, 0.04);
  color: var(--text-primary);
  border-color: rgba(220, 20%, 10%, 0.08);
}

body.theme-light .about-hero {
  background: hsla(220, 20%, 10%, 0.02);
}

body.theme-light .about-feature-card {
  background: hsla(220, 20%, 10%, 0.01);
}

body.theme-light .compile-player-wrapper {
  background: #f0f2f5;
}

body.theme-light .file-name-input {
  background: #ffffff;
  color: var(--text-primary);
  border-color: rgba(220, 20%, 10%, 0.12);
}

body.theme-light .file-name-input:focus {
  border-color: var(--accent-cyan);
}

body.theme-light .viewport-video-blur {
  filter: blur(45px) brightness(0.85) saturate(1.2);
  opacity: 0.45;
}
