/* -----------------------------------
   Global & Theme
----------------------------------- */

:root {
  --bg: #121212;
  --surface: #202124;
  --surface-elevated: #292a2d;
  --surface-soft: #1f1f1f;
  --border-subtle: #3c4043;
  --border-strong: #5f6368;

  --text-primary: #e8eaed; /* text primary */
  --text-secondary: #9aa0a6;
  --accent-primary: #1a73e8;        /* Google blue */
  --accent-primary-strong: #185abc;
  --accent-yellow: #fbbc04;         /* Google yellow */
  --accent-green: #34a853;          /* Google green */

  --radius-pill: 999px;
  --radius-card: 14px;
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.45);
  --transition-fast: 0.15s ease;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

/* -----------------------------------
   Native mobile safety tweaks (TWA-safe)
----------------------------------- */

button {
  touch-action: manipulation;
}

body {
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 24px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2933 0, var(--bg) 55%);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
}

.page {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* -----------------------------------
   Mode Toggle (9:16 / 16:9 / PiP)
----------------------------------- */

.mode-toggle {
  width: 100%;
  max-width: 360px;
  background: rgba(32, 33, 36, 0.95);
  border-radius: var(--radius-pill);
  padding: 4px;
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(95, 99, 104, 0.6);
  backdrop-filter: blur(10px);
}

.mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              transform var(--transition-fast);
}

.mode-btn:hover {
  background: rgba(95, 99, 104, 0.2);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-strong));
  color: #fff;
  transform: translateY(-1px);
}

/* -----------------------------------
   Exports strip (bottom, horizontal thumbnails)
----------------------------------- */

/* -----------------------------------
   Exports strip (bottom, horizontal thumbnails)
----------------------------------- */

.exports-strip {
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;        /* center arrows + scroller */
  gap: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: 16px;
  background: rgba(32, 33, 36, 0.96);
  border: 1px solid rgba(95, 99, 104, 0.6);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
  min-height: 90px;           /* 🔹 always “thick”, even when empty */
}

.exports-strip-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Scroll arrows */
.exports-scroll-btn {
  border: none;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  background: #303134;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.exports-scroll-btn:hover {
  background: #3c4043;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.exports-scroll-left {
  margin-right: 2px;
}

.exports-scroll-right {
  margin-left: 2px;
}

.exports-scroller {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  min-height: 70px;           /* 🔹 keeps inner area tall even with no cards */
}

/* Scrollbar styling */
.exports-scroller::-webkit-scrollbar {
  height: 4px;
}
.exports-scroller::-webkit-scrollbar-track {
  background: transparent;
}
.exports-scroller::-webkit-scrollbar-thumb {
  background: rgba(95, 99, 104, 0.7);
  border-radius: 999px;
}

/* -----------------------------------
   Info Marquee (under exports strip)
----------------------------------- */

.marquee-bar {
  width: 100%;
  max-width: 960px;
  margin-top: 6px;
  padding: 4px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid rgba(95, 99, 104, 0.6);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.55);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.marquee-inner {
  overflow: hidden;      /* viewport for the scrolling line */
  white-space: nowrap;
}

.marquee-track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: marquee-scroll 30s linear infinite;
}

/* individual message “chips” */
.marquee-track span {
  margin-right: 32px;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    /* Move left by half of its own width.
       We’ll duplicate the content exactly twice in JS,
       so -50% lands us on the second copy → seamless loop. */
    transform: translateX(-50%);
  }
}



/* Individual export thumbnail card */
.export-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border-radius: 12px;
  background: #303134;
  border: 1px solid rgba(95, 99, 104, 0.7);
  min-width: 120px;
  max-width: 140px;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
  color: var(--text-primary);
}

.export-card:hover {
  background: #3c4043;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
  border-color: rgba(138, 180, 248, 0.8);
}

.export-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.export-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.export-label {
  padding: 4px 8px 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Delete button on export thumbnail */
.export-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.7);
  color: #fce4ec;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition-fast),
              border-color var(--transition-fast),
              transform var(--transition-fast);
}

.export-delete-btn:hover {
  background: rgba(244, 67, 54, 0.85);
  border-color: rgba(255, 205, 210, 0.9);
  transform: translateY(-1px);
}


/* -----------------------------------
   Video Preview Container
----------------------------------- */

.video-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: var(--radius-card) var(--radius-card) 0 0; /* top only */
  overflow: visible;
  margin-bottom: 0; /* no gap before status bar */
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  
}



/* 9:16 vertical mode (reaction top, original bottom) */
.video-container.mode-916 {
  aspect-ratio: 9 / 16;
  max-width: 390px;  /* smaller vertical preview on desktop */
  margin-left: auto;
  margin-right: auto;
}

.video-container.mode-916 .top-strip,
.video-container.mode-916 .bottom-strip {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-container.mode-916 .top-strip {
  top: 0;
  height: 25%;
}

.video-container.mode-916 .bottom-strip {
  bottom: 0;
  height: 75%;
}

/* 9:16 size variants (reaction height) */
/* Base: reaction 25%, original 75% (defined above) */

.video-container.mode-916.size-35 .top-strip {
  height: 35%;
}

.video-container.mode-916.size-35 .bottom-strip {
  height: 65%;
}

.video-container.mode-916.size-50 .top-strip {
  height: 50%;
}

.video-container.mode-916.size-50 .bottom-strip {
  height: 50%;
}


/* Center layout helper */
.zoom-center {
  display: flex;
  align-items: center;
}

/* 16:9 horizontal mode (reaction left, original right) */
.video-container.mode-169 {
  aspect-ratio: 16 / 9;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.video-container.mode-169 .top-strip,
.video-container.mode-169 .bottom-strip {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 16:9 SIZE VARIANTS (reaction width %) */
/* Base (no class): 50% reaction / 50% original */

/* First click: 25% reaction / 75% original */
.video-container.mode-169.hsize-25 .top-strip {
  width: 25%;
}

.video-container.mode-169.hsize-25 .bottom-strip {
  width: 75%;
  left: 25%;
}

/* Second click: 35% reaction / 65% original */
.video-container.mode-169.hsize-35 .top-strip {
  width: 35%;
}

.video-container.mode-169.hsize-35 .bottom-strip {
  width: 65%;
  left: 35%;
}


.video-container.mode-169 .top-strip {
  left: 0;      /* reaction on left */
}

.video-container.mode-169 .bottom-strip {
  left: 50%;    /* original on right */
}

/* PiP mode: full-screen reaction, small original bottom-left */
.video-container.mode-pip {
  aspect-ratio: 16 / 9;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Reaction takes the whole frame */
.video-container.mode-pip .top-strip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

/* PiP window in bottom-left */
.video-container.mode-pip .bottom-strip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 24%;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  z-index: 2;
}

/* Default PiP: 1:1 */
.video-container.mode-pip .strip-inner-bottom {
  width: 100%;
  aspect-ratio: 1 / 1;
}

/* PiP 9:16 variant */
.video-container.mode-pip.pip-916 .strip-inner-bottom {
  aspect-ratio: 9 / 16;
}

/* Shared strip base */
.strip-inner {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Reaction video full coverage */
.reaction-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%; /* center by default */
  background: #000;
}


/* ORIGINAL WRAPPER: blurred bg + foreground */
.original-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Blurred background video */
.original-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px);
  transform: scale(1.1);
  opacity: 0.9;
}

/* Foreground original (zoomed) */
.original-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;  /* center by default */
  background: transparent;
  transform-origin: center center;
}



/* -----------------------------------
   Countdown Overlay
----------------------------------- */

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 700;
  color: #f9fafb;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.9));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

/* -----------------------------------
   Record button overlay (top-left)
----------------------------------- */

.record-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  pointer-events: none;  /* let video receive clicks except on inner */
  z-index: 5;
}

.record-overlay-inner {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: calc(10px + var(--safe-top)) 0 0 calc(10px + var(--safe-left));
 /* offset from top-left */
}

/* -----------------------------------
   Nudge Pad (bottom-right)
----------------------------------- */

.nudge-pad {
  position: absolute;
  right: calc(16px + var(--safe-right));
  bottom: calc(16px + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.75);
  border-radius: 999px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 35;
  backdrop-filter: blur(10px);
}

.nudge-pad-hidden {
  display: none;
}

/* AUDIO MIX PAD (bottom-right, above nudge pad) */
.audio-pad {
  position: absolute;
  right: calc(16px + var(--safe-right));
  bottom: calc(90px + var(--safe-bottom));        /* a bit above the nudge pad */
  background: rgba(0, 0, 0, 0.85);
  border-radius: 16px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 36;           /* slightly above nudge pad */
  backdrop-filter: blur(10px);
}

.audio-pad-hidden {
  display: none;
}

.audio-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #fff;
}

.audio-label {
  min-width: 70px;
  text-align: right;
  opacity: 0.8;
}

.audio-slider {
  width: 140px;
}


.nudge-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.nudge-arrow,
.nudge-center {
  border: none;
  outline: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8f8f8;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nudge-center {
  width: 32px;
  height: 32px;
  font-weight: 600;
}

.nudge-arrow:hover,
.nudge-center:hover {
  background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 768px) {
  .nudge-pad {
    right: 8px;
    bottom: 8px;
    transform: scale(0.9);
    transform-origin: bottom right;
  }
}


.record-overlay-btn {
  position: relative;
  width: 48px;  /* smaller */
  height: 48px;
  border-radius: 50%;
  /* IDLE (NOT RECORDING) = GREEN */
  border: 2px solid rgba(129, 199, 132, 0.95);           /* light green */
  background: rgba(46, 125, 50, 0.35);                  /* green, semi-transparent */
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  outline: none;
  color: transparent; /* hide text visually */
  font-size: 0;
}

/* Inner icon (idle = green circle) */
.record-overlay-btn::before {
  content: "";
  position: absolute;
  inset: 12px;               /* smaller inner icon */
  border-radius: 50%;
  background: rgba(129, 199, 132, 0.96);                /* green inner circle */
  transition: border-radius var(--transition-fast),
              background var(--transition-fast),
              inset var(--transition-fast),
              border-color var(--transition-fast);
}

/* Hover: slightly brighter when idle */
.record-overlay-btn:hover {
  background: rgba(56, 142, 60, 0.5);
}

/* Recording state: RED circle/square */
.record-overlay-btn.recording {
  border-color: rgba(248, 113, 113, 0.95);              /* red border */
  background: rgba(220, 38, 38, 0.45);                  /* red background */
}

/* Recording icon: sharp red square */
.record-overlay-btn.recording::before {
  border-radius: 4px;        /* sharp square */
  inset: 15px;
  background: rgba(248, 113, 113, 1);
}


/* Label under the circle */
.record-overlay-label {
  font-size: 0.75rem;
  color: #ffffff;
  font-weight: 700;          /* bold */
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

 /* -----------------------------------
    Compact Controls Strip (3 per row)
    Matches mode strip but tighter
 ----------------------------------- */

.control-strip {
  width: 100%;
  max-width: 820px;
  background: rgba(32, 33, 36, 0.90);
  border-radius: var(--radius-pill);
  padding: 4px 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  border: 1px solid rgba(95, 99, 104, 0.4);
  backdrop-filter: blur(12px);
  margin: 8px auto;
  /* add this: */
  margin-bottom: 16px;
}

.tools-strip {
  display: inline-flex;
  gap: 6px;
  padding: 4px 6px;

  background: rgba(32, 33, 36, 0.96);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(95, 99, 104, 0.6);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);

  width: fit-content;   /* strip only as wide as needed */
  margin: 0 auto 12px auto;  /* <-- perfect centering */
}


.tools-strip .control-btn {
  flex: 0 0 auto;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.tools-strip .control-btn:hover {
  background-color: #5fb0f7;
  color: black;                /* readable on light blue */
  border-color: #3ea6ff;
}


/* Let the tools use the same pill buttons, but allow flex shrinking */
.tools-strip .control-btn {
  flex: 0 0 auto;
}

/* Make the shuffle button look like a compact icon */
.tools-shuffle-btn {
  width: 40px;
  padding-inline: 0;
  font-size: 1rem;
  justify-content: center;
}

 /* Uniform control button styling matching mode strip */
 .control-btn {
   border: none;
   background: transparent;
   color: var(--text-secondary);
   font-weight: 500;
   padding: 6px 6px;           /* reduced from 10px+ */
   cursor: pointer;
   border-radius: calc(var(--radius-pill) - 4px); /* slightly sharper pills */
   font-size: 0.78rem;         /* slightly smaller text */
   letter-spacing: 0.03em;
   text-transform: uppercase;
   display: flex;
   align-items: center;
   justify-content: center;
   white-space: nowrap;
   transition: background var(--transition-fast),
               color var(--transition-fast),
               transform var(--transition-fast);
 }

 .control-btn:hover {
   background: rgba(95, 99, 104, 0.22);
   color: var(--text-primary);
   transform: translateY(-1px);
 }

 .control-btn.active {
   background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-strong));
   color: #fff;
   transform: translateY(-1px);
 }

/* -----------------------------------
   Gear overlay for controls
----------------------------------- */

.controls-overlay {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: calc(10px + var(--safe-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 6; /* above video and record overlay */
}

.gear-btn {
  position: relative;
  width: 48px;   /* same footprint as record button */
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(138, 180, 248, 0.75);
  background: rgba(26, 115, 232, 0.75);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  outline: none;
  color: var(--text-primary);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.gear-btn:hover {
  background: rgba(26, 115, 232, 0.95);
  border-color: rgba(138, 180, 248, 1);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.9);
}

.gear-btn:active {
  transform: scale(0.96) translateY(1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

/* Vertical controls menu that reuses strip styling */
.controls-menu {
  background: rgba(32, 33, 36, 0.96);
  border-radius: 20px;              /* was: var(--radius-pill) */
  padding: 10px 8px;                /* was: 6px 6px */
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(95, 99, 104, 0.7);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 70vh;
  overflow-y: auto;
}

.controls-menu.collapsed {
  display: none;
}

/* Reuse existing .control-strip styling but vertical & compact */
.controls-menu.control-strip {
  margin: 0;
  max-width: none;
  width: auto;
  margin-bottom: 0;
}

/* Make each control full-width in the menu */
.controls-menu .control-btn,
.controls-menu .control-zoom-btn {
  width: 100%;
  justify-content: flex-start;
  padding-top: 6px;                 /* ensure text has room */
  padding-bottom: 6px;
  box-sizing: border-box;
}



 /* Zoom chip compact */
 .control-zoom-btn {
   padding: 0px;
   display: flex;
   align-items: center;
   justify-content: center;
 }

 .zoom-group {
   display: inline-flex;
   align-items: center;
   background: rgba(32,33,36,0.95);
   border-radius: calc(var(--radius-pill) - 6px);
   padding: 3px 6px;            /* tighter */
   border: 1px solid rgba(60, 64, 67, 0.7);
   box-shadow: 0 5px 12px rgba(0,0,0,0.38);
 }

 .zoom-btn {
   width: 24px;
   height: 24px;
   border-radius: 999px;
   border: none;
   background: #303134;
   color: var(--text-primary);
   cursor: pointer;
   font-size: 0.90rem;
   display: flex;
   align-items: center;
   justify-content: center;
   transition: background var(--transition-fast), transform var(--transition-fast);
 }

 .zoom-btn:hover {
   background: #3c4043;
   transform: translateY(-0.5px);
 }

 .zoom-value {
   min-width: 46px;         /* more compact */
   text-align: center;
   font-variant-numeric: tabular-nums;
   font-size: 0.78rem;
   color: var(--text-secondary);
 }

.controls-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

/*Padding for the gear icon and label*/
.controls-overlay-inner-padding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 0 0; /* mirror record overlay offset */
}

/* Match the style of "Record / Stop" */
.controls-label {
  font-size: 0.75rem;
  color: #ffffff;
  font-weight: 700; 
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  margin-top: 4px;
}



/* -----------------------------------
   Primary Action Buttons Row
----------------------------------- */

.buttons-row {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.action-btn {
  flex: 1;
  padding: 10px 14px;
  background: var(--accent-primary);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.5);
  transition: background var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.action-btn:hover {
  background: var(--accent-primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(26, 115, 232, 0.6);
}

/* 🎞️ Showroom button */
.showroom-btn {
  background: var(--accent-yellow);
  color: #202124;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(251, 188, 4, 0.55);
}

.showroom-btn:hover {
  background: #f9ab00;
  box-shadow: 0 16px 32px rgba(251, 188, 4, 0.65);
}

/* ⬆️ Upload button */
.upload-btn {
  background: var(--accent-primary);
  color: #ffffff;
}

/* -----------------------------------
   Status & Download
----------------------------------- */

.status-bar {
  margin-top: -10px;   /* CANCEL OUT THE PAGE GAP */
  margin-bottom: 8px;
  width: 100%;
  padding: 6px 10px;
  background: rgba(32, 33, 36, 0.96);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  border: 1px solid rgba(95, 99, 104, 0.7);
  border-top: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;

  /* 🔥 FORCE SINGLE LINE */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    gap: 8px;
  }


#status {
  margin: 0;
  font-size: 0.86rem;
  text-align: left;
  color: var(--text-secondary);
  flex: 1;
}

#downloadContainer {
  margin-top: 0;
  white-space: nowrap;
}

/* When 9:16 mode is active, keep narrow vertical width */
#videoContainer.mode-916 + .status-bar {
  max-width: 390px;
}

/* 16:9 and PiP share the wider width */
#videoContainer.mode-169 + .status-bar,
#videoContainer.mode-pip + .status-bar {
  max-width: 900px;
}


/* -----------------------------------
   Showroom Overlay
----------------------------------- */

.showroom-panel {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.9));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.showroom-panel.open {
  display: flex;
}

.showroom-inner {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(95, 99, 104, 0.7);
}

.showroom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-primary);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast),
              color var(--transition-fast);
}

.close-btn:hover {
  background: rgba(95, 99, 104, 0.2);
  color: #fff;
}

/* GRID of video thumbnails */
.showroom-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding-top: 4px;
}

.showroom-card {
  background: var(--surface-elevated);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition-fast),
              background var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
  border: 1px solid transparent;
}

.showroom-card:hover {
  background: #303134;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  border-color: rgba(138, 180, 248, 0.4);
}

.showroom-thumb {
  width: 100%;
  border-radius: 10px;
  background: #000;
}

.showroom-label {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -----------------------------------
   Small Screens
----------------------------------- */

@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .mode-toggle {
    max-width: 280px;
  }

  .zoom-controls {
    max-width: 100%;
  }

  .buttons-row {
    flex-direction: column;
  }

  .action-btn {
    max-width: 100%;
  }

  .exports-strip {
    border-radius: 16px;
  }
}

/* -----------------------------------
   Credit Badge
----------------------------------- */

.credit-badge {
  margin-top: 0;                  /* was 8px – now flush with the top */
  margin-bottom: 8px;
  padding: 4px 10px;              /* slimmer */
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.96);
  border: 1px solid rgba(95, 99, 104, 0.8);
  font-size: 0.8rem;
  color: var(--text-secondary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);

  /* single-line layout */
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;            /* keep all on one line */
}


/* Generic row container inside the credit badge */
.cb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;   /* let it size naturally for one-line pill */
}


/* Email / main label */
.cb-email {
  color: var(--text-primary);
  font-weight: 500;
}

/* Credits text */
.cb-credits {
  color: var(--text-secondary);
}

/* Watermark note */
.cb-watermark {
  color: var(--text-secondary);
  font-style: italic;
}

/* Suspended status */
.cb-status {
  color: #ff8a80;
}

/* Small separator dot */
.cb-dot {
  opacity: 0.6;
}

/* Base link/button style inside badge */
.cb-link {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(95, 99, 104, 0.8);
  background: #303134;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast),
              transform var(--transition-fast);
}

.cb-link:hover {
  background: #3c4043;
  color: #fff;
  border-color: rgba(138, 180, 248, 0.9);
  transform: translateY(-1px);
}

/* Blue variant (Log in / Sign up / Sign out / Recharge) */
.cb-link-blue {
  color: #1a73e8;
  border-color: rgba(138, 180, 248, 0.9);
  background: rgba(26, 115, 232, 0.12);
}

.cb-link-blue:hover {
  color: #ffffff;
  background: rgba(26, 115, 232, 0.35);
  border-color: rgba(138, 180, 248, 1);
}


/* Push Recharge all the way to the right on second row */
.cb-recharge {
  margin-left: auto;
}

/* Gold Recharge Button */
.cb-recharge {
  background: linear-gradient(135deg, #f9d976, #f39f36);
  color: #000 !important;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
}

.cb-recharge:hover {
  background: linear-gradient(135deg, #ffe29f, #ffa94d);
}

.cb-signout {
  font-size: 1.1rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
  text-decoration: none !important;   /* <-- removes underline */
}

.cb-signout:hover {
  color: var(--accent-primary);
  text-decoration: none !important;   /* <-- prevents underline on hover */
}


/* -----------------------------------
   Keep / Discard Recording Modal
----------------------------------- */

.kd-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40; /* between showroom and paywall */
}

.kd-overlay.open {
  display: flex;
}

.kd-modal {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px 18px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(95, 99, 104, 0.7);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kd-title {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text-primary);
}

.kd-text {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.kd-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.kd-btn {
  min-width: 90px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast),
              transform var(--transition-fast);
}

/* Export settings inside Keep/Discard modal */
.kd-export-section {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #202124;
  border: 1px solid rgba(95, 99, 104, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kd-export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kd-export-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.kd-export-advanced-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(138, 180, 248, 0.8);
  background: rgba(26, 115, 232, 0.12);
  color: #1a73e8;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), transform var(--transition-fast);
}

.kd-export-advanced-btn:hover {
  background: rgba(26, 115, 232, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Simple slider mode */
.kd-export-simple {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kd-export-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

#exportSpeedQuality {
  width: 100%;
}

/* Advanced mode fields */
.kd-export-advanced {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kd-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kd-field label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.kd-field select {
  background: #303134;
  border-radius: 8px;
  border: 1px solid rgba(95, 99, 104, 0.9);
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 4px 8px;
}

/* Generic hidden helper */
.kd-hidden {
  display: none !important;
}


/* Discard = red */
.kd-btn-discard {
  background: #3c1f24;
  color: #ff8a80;
  border-color: rgba(255, 138, 128, 0.5);
}

.kd-btn-discard:hover {
  background: #4a242a;
  color: #ffecec;
  transform: translateY(-1px);
}

/* Keep = green */
.kd-btn-keep {
  background: #1b4b34;
  color: #b9f6ca;
  border-color: rgba(129, 199, 132, 0.6);
}

.kd-btn-keep:hover {
  background: #1f5c3e;
  color: #e8f5e9;
  transform: translateY(-1px);
}


/* -----------------------------------
   Paywall Modal
----------------------------------- */

.paywall-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.paywall-overlay.open {
  display: flex;
}

.paywall-inner {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px 18px 14px;
  width: 90%;
  max-width: 460px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(138, 180, 248, 0.6);
}

.paywall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.paywall-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.paywall-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.paywall-packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.paywall-pack-btn {
  border-radius: 14px;
  border: 1px solid rgba(95, 99, 104, 0.8);
  background: #303134;
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 10px 10px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  transition: background var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
}

.paywall-pack-btn:hover {
  background: #3c4043;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
  border-color: rgba(138, 180, 248, 0.9);
}

.paywall-pack-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.paywall-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}


/* -----------------------------------
   Paywall Modal
----------------------------------- */

.paywall-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.paywall-overlay.open {
  display: flex;
}

.paywall-inner {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px 18px 14px;
  width: 90%;
  max-width: 460px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(138, 180, 248, 0.6);
}

.paywall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.paywall-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.paywall-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.paywall-packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.paywall-pack-btn {
  border-radius: 14px;
  border: 1px solid rgba(95, 99, 104, 0.8);
  background: #303134;
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 10px 10px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  transition: background var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
}

.paywall-pack-btn:hover {
  background: #3c4043;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
  border-color: rgba(138, 180, 248, 0.9);
}

.paywall-pack-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.paywall-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* -----------------------------------
   Auth / Admin Pages
----------------------------------- */

.auth-body {
  margin: 0;
  padding: 24px;
  background: radial-gradient(circle at top, #1f2933 0, var(--bg) 55%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background: rgba(32, 33, 36, 0.98);
  border-radius: 18px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(95, 99, 104, 0.8);
}

.auth-container h1 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.87rem;
  color: var(--text-secondary);
}

.auth-form input {
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(95, 99, 104, 0.9);
  background: #202124;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.auth-submit-btn {
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.5);
  transition: background var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.auth-submit-btn:hover {
  background: var(--accent-primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(26, 115, 232, 0.6);
}

.auth-alt,
.auth-back {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.auth-alt a,
.auth-back a {
  color: var(--accent-primary);
  text-decoration: none;
}

.auth-alt a:hover,
.auth-back a:hover {
  text-decoration: underline;
}

.auth-flashes {
  margin-bottom: 10px;
}

.auth-flash {
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.auth-flash-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.8);
}

.auth-flash-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.8);
}

/* Admin */

.admin-container {
  width: 100%;
  max-width: 900px;
  background: rgba(32, 33, 36, 0.98);
  border-radius: 18px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(95, 99, 104, 0.8);
}

.admin-container h1 {
  margin-top: 0;
  margin-bottom: 10px;
}

.admin-container h2 {
  margin-top: 18px;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.admin-table-wrapper {
  overflow-x: auto;
  margin-bottom: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-table th,
.admin-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(95, 99, 104, 0.6);
}

.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.admin-inline-form select,
.admin-inline-form input {
  font-size: 0.8rem;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(95, 99, 104, 0.9);
  background: #202124;
  color: var(--text-primary);
}

.admin-inline-form button {
  padding: 4px 8px;
  border-radius: 999px;
  border: none;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
}

