/* ==========================================================================
   Video Watermark Remover - Production Stylesheet
   SEOWebChecker Suite
   ========================================================================== */

:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0a0f1d;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-surface: #1e293b;
  --bg-input: rgba(15, 23, 42, 0.9);
  --bg-glass: rgba(15, 23, 42, 0.65);

  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-medium: rgba(148, 163, 184, 0.22);
  --border-focus: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --accent-blue: #0284c7;
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.35);
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #6366f1 100%);
  --accent-gradient-hover: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #4f46e5 100%);

  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.12);
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.12);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.12);
  --status-info: #0ea5e9;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.2);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  --container-max: 1280px;
}

/* Light Theme Overrides */
body.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-input: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.8);

  --border-subtle: rgba(100, 116, 139, 0.15);
  --border-medium: rgba(100, 116, 139, 0.28);
  --border-focus: #0284c7;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(2, 132, 199, 0.15);
}

/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(99, 102, 241, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Links & Typography */
a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #7dd3fc;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
}

img, video, canvas {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ==========================================================================
   Navbar & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-normal);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.brand-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dropdown-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 240px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-fast);
  z-index: 100;
  list-style: none;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  color: var(--accent-cyan);
  background: var(--bg-surface);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn, .mobile-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover, .mobile-toggle-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.theme-icon-sun {
  display: none;
}

body.theme-light .theme-icon-sun {
  display: block;
}

body.theme-light .theme-icon-moon {
  display: none;
}

.mobile-toggle-btn {
  display: none;
}

/* ==========================================================================
   Hero Section & Badges
   ========================================================================== */
.hero-section {
  padding: 3.5rem 0 2rem;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  animation: pulse-glow 3s infinite;
}

.hero-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-success);
  box-shadow: 0 0 8px var(--status-success);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.hero-title .gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 760px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
}

.trust-badges-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 1rem;
}

.trust-badge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.trust-badge-item svg {
  color: var(--accent-cyan);
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Main Studio & Workspace Container
   ========================================================================== */
.studio-section {
  padding: 1.5rem 0 4.5rem;
}

.studio-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

/* Dropzone Styles */
.dropzone-container {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.35);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.dropzone-container:hover, .dropzone-container.dragover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

.dropzone-icon-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--accent-cyan);
  transition: transform var(--transition-fast);
}

.dropzone-container:hover .dropzone-icon-circle {
  transform: scale(1.1);
}

.dropzone-icon-circle svg {
  width: 38px;
  height: 38px;
}

.dropzone-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.dropzone-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.dropzone-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
  transition: all var(--transition-fast);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: var(--status-danger);
  color: #ffffff;
}

.dropzone-formats-tag {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Video Meta Banner
   ========================================================================== */
.video-meta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
}

.meta-info-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.meta-pill strong {
  color: var(--text-primary);
  font-weight: 600;
}

.meta-pill.pill-active {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
}

/* ==========================================================================
   Workspace Layout (Canvas Studio & Control Sidebar)
   ========================================================================== */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Canvas Viewport */
.canvas-viewport-card {
  background: #000000;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.canvas-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  z-index: 10;
}

.view-mode-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
}

.view-tab-btn {
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.view-tab-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
}

.viewport-stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

/* Active Source Video (rendered behind canvas so browser keeps video decoder awake and active) */
#sourceVideoPlayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.001;
  pointer-events: none;
  z-index: 1;
}

/* Interactive & Output Canvases */
.studio-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 2;
}

/* Overlay Layer for Bounding Box Handles */
.interactive-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: crosshair;
  z-index: 3;
}

/* Watermark Selection Bounding Box */
.watermark-box {
  position: absolute;
  border: 2px solid var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4), inset 0 0 10px rgba(56, 189, 248, 0.1);
  cursor: move;
  z-index: 20;
  transition: border-color var(--transition-fast);
}

.watermark-box.active {
  border: 2px solid #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.7);
}

.watermark-box-tag {
  position: absolute;
  top: -24px;
  left: -2px;
  background: #0284c7;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* 8 Bounding Box Resize Handles */
.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 2px;
  z-index: 25;
}

.handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.handle-n  { top: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.handle-e  { top: calc(50% - 5px); right: -6px; cursor: ew-resize; }
.handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.handle-s  { bottom: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.handle-w  { top: calc(50% - 5px); left: -6px; cursor: ew-resize; }

/* Split View Comparison Divider */
.split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  z-index: 30;
  box-shadow: 0 0 10px rgba(0,0,0,0.8);
  cursor: ew-resize;
  display: none;
}

.split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0284c7;
  border: 2px solid #ffffff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  font-size: 12px;
}

/* Viewport Video Controls Bar */
.viewport-controls-bar {
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 10;
}

.timeline-scrubber-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  outline: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-cyan);
  transition: transform var(--transition-fast);
}

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

.time-counter {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 90px;
  text-align: right;
}

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

.playback-left, .playback-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-control-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-control-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent-cyan);
}

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

/* ==========================================================================
   Sidebar Settings & Algorithm Controls
   ========================================================================== */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.control-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Method Selection Cards */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.method-option {
  position: relative;
  cursor: pointer;
}

.method-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.method-box {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
  text-align: center;
  background: var(--bg-surface);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.method-box svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.method-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.method-option input:checked + .method-box {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.method-option input:checked + .method-box svg {
  color: var(--accent-cyan);
}

/* Form Controls & Range Sliders */
.form-group {
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.form-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.form-val-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.form-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-surface);
  outline: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* Multi-Box Manager */
.box-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.box-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.box-item-row.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.box-item-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.box-item-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

.box-action-btn {
  color: var(--status-danger);
  padding: 0.2rem;
  border-radius: 3px;
  transition: background var(--transition-fast);
}

.box-action-btn:hover {
  background: var(--status-danger-bg);
}

.preset-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.preset-pill {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.preset-pill:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

/* Time Range Settings */
.time-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.time-input-field {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.time-input-field:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

/* Export & Download Card */
.export-card {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.select-field {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.btn-export {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.export-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ==========================================================================
   Processing & Export Overlay
   ========================================================================== */
.processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 29, 0.92);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.spinner-ring {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

.processing-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.processing-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.export-progress-bar-wrap {
  width: 100%;
  max-width: 420px;
  height: 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.export-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.15s ease-out;
}

.progress-stats-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Content & Guide Sections
   ========================================================================== */
.section-spacer {
  padding: 4.5rem 0;
}

.section-header-center {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3rem;
}

.section-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* 3-Step Guide Cards */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  transition: all var(--transition-normal);
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-md);
}

.step-number-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}

.step-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.step-card-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
}

.feature-card:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.feature-icon-box {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-icon-box svg {
  width: 26px;
  height: 26px;
}

.feature-card-title {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.feature-card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Comparison Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.comparison-table th, .comparison-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th {
  background: var(--bg-surface);
  font-weight: 700;
  color: var(--text-primary);
}

.comparison-table th.highlight-col, .comparison-table td.highlight-col {
  background: rgba(56, 189, 248, 0.05);
  border-left: 2px solid var(--accent-cyan);
  border-right: 2px solid var(--accent-cyan);
}

.check-icon {
  color: var(--status-success);
  font-weight: 700;
}

.cross-icon {
  color: var(--status-danger);
  font-weight: 700;
}

/* Accordion FAQ */
.faq-list {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--border-focus);
}

.faq-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.faq-chevron {
  width: 20px;
  height: 20px;
  color: var(--accent-cyan);
  transition: transform var(--transition-normal);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-content {
  padding: 0 1.5rem 1.25rem;
  display: none;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.open .faq-content {
  display: block;
}

/* Related Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.tool-link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.tool-link-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.tool-link-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-link-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.tool-link-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Footer & Cookie Banner & Toasts
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand-desc {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 320px;
}

.footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slide-in 0.25s ease forwards;
  max-width: 380px;
}

.toast-success { border-color: var(--status-success); }
.toast-error   { border-color: var(--status-danger); }
.toast-info    { border-color: var(--accent-cyan); }

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  max-width: 460px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cookie-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Error Banner */
.error-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}

.error-banner button {
  color: var(--status-danger);
  font-weight: bold;
}

/* Keyframes */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-medium);
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    display: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
  }

  .mobile-toggle-btn {
    display: flex;
  }
}
