/* ==========================================================================
   Target-Size Media Shrinker - Responsive Design System & Styles
   Optimized for Mobile, Tablet, Laptop, and Ultrawide PC displays
   ========================================================================== */

:root {
  --bg-dark: #0a0d16;
  --bg-surface: #111625;
  --bg-card: #161c30;
  --bg-card-hover: #1c243d;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #5865f2;
  
  --text-main: #f0f4fc;
  --text-muted: #8c9bb5;
  --text-sub: #5d6d8c;

  --accent-discord: #5865f2;
  --accent-nitro: #eb459e;
  --accent-slack: #e01e5a;
  --accent-github: #2ea44f;
  --accent-email: #ea4335;
  --accent-cyan: #00d2ff;
  --accent-green: #10b981;
  --accent-warning: #f59e0b;

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

  --shadow-glow: 0 0 25px rgba(88, 101, 242, 0.25);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* Strict Box Model & Zero Overflow */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(88, 101, 242, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(0, 210, 255, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 24px);
}

/* Header */
header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(17, 22, 37, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 0;
  gap: 12px;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-icon {
  font-size: clamp(22px, 4vw, 28px);
  filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.4));
  flex-shrink: 0;
}

.logo-title {
  font-size: clamp(16px, 3.5vw, 20px);
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff, #8c9bb5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.logo-title span {
  background: linear-gradient(135deg, #00d2ff, #5865f2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.privacy-badge, .tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 500;
  white-space: nowrap;
}

.privacy-badge {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.tech-badge {
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.3);
  color: #818cf8;
}

/* Main Content */
main {
  flex: 1;
  padding: clamp(24px, 4vw, 40px) 0 clamp(40px, 6vw, 60px);
  width: 100%;
}

/* Hero Section */
.hero {
  text-align: center;
  max-width: 820px;
  margin: 0 auto clamp(24px, 4vw, 40px);
  padding: 0 8px;
}

.hero h1 {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin-bottom: 12px;
  word-break: break-word;
}

.hero p {
  font-size: clamp(14px, 2.2vw, 16px);
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-highlight {
  color: #00d2ff;
  font-weight: 600;
}

/* Upload Dropzone */
.upload-card {
  background: var(--bg-surface);
  border: 2px dashed rgba(88, 101, 242, 0.35);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 50px) clamp(16px, 4vw, 30px);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  max-width: 100%;
}

.upload-card:hover, .upload-card.drag-active {
  border-color: #00d2ff;
  background: rgba(22, 28, 48, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 210, 255, 0.15);
}

.drop-icon {
  font-size: clamp(40px, 8vw, 54px);
  margin-bottom: 14px;
  display: inline-block;
}

.upload-card h3 {
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 700;
  margin-bottom: 8px;
}

.upload-card p {
  color: var(--text-muted);
  font-size: clamp(12px, 2.5vw, 14px);
  margin-bottom: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.drop-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
  min-height: 42px;
}

.btn-primary {
  background: linear-gradient(135deg, #00d2ff, #5865f2);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

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

.btn-danger {
  background: rgba(234, 67, 53, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(234, 67, 53, 0.4);
}

.btn-danger:hover {
  background: rgba(234, 67, 53, 0.35);
}

.btn-large {
  padding: 14px 24px;
  font-size: clamp(15px, 2.5vw, 16px);
  width: 100%;
}

/* Sample Quick Actions */
.sample-bar {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sample-label {
  font-size: 13px;
  color: var(--text-sub);
  width: 100%;
  text-align: center;
}

.sample-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: normal;
  text-align: center;
}

.sample-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: #00d2ff;
}

/* ==========================================================================
   Workspace Grid (Desktop 2-col, Mobile/Tablet 1-col, NO Horizontal Blowout)
   ========================================================================== */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(16px, 2.5vw, 28px);
  align-items: start;
  width: 100%;
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Panels */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow-card);
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

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

.panel-title {
  font-size: clamp(16px, 3vw, 18px);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Source Media Details */
.source-preview-box {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
}

.source-preview-box video, .source-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  width: 100%;
}

.meta-item {
  background: var(--bg-card);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  min-width: 0;
  overflow: hidden;
}

.meta-label {
  font-size: 10px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.meta-val {
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  white-space: nowrap;
}

.audio-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.audio-badge.mute {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Video Trimmer */
.trim-control {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  width: 100%;
}

.trim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  flex-wrap: wrap;
  gap: 6px;
}

.trim-timeline {
  position: relative;
  height: 32px;
  background: #0d111d;
  border-radius: var(--radius-sm);
  margin: 10px 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.trim-range-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 210, 255, 0.25);
  border-left: 3px solid #00d2ff;
  border-right: 3px solid #00d2ff;
  pointer-events: none;
}

.trim-slider {
  position: absolute;
  width: 100%;
  appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 10;
  height: 32px;
  margin: 0;
}

.trim-slider::-webkit-slider-thumb {
  pointer-events: auto;
  appearance: none;
  width: 16px;
  height: 32px;
  background: #00d2ff;
  border-radius: 3px;
  cursor: ew-resize;
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.6);
}

.trim-slider::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 32px;
  background: #00d2ff;
  border-radius: 3px;
  cursor: ew-resize;
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.6);
  border: none;
}

/* Preset Cards Grid */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

@media (max-width: 600px) {
  .preset-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-width: 0;
}

.preset-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.preset-card.active {
  border-color: #00d2ff;
  background: rgba(0, 210, 255, 0.08);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.15);
}

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

.preset-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  white-space: nowrap;
}

.preset-card.active .preset-badge {
  background: #00d2ff;
  color: #0a0d16;
}

.preset-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.preset-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

/* Custom Size Box */
.custom-size-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.custom-input-group {
  display: flex;
  align-items: center;
  background: #0c0f1b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  flex: 1;
  min-width: 140px;
}

.custom-input-group input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  outline: none;
}

.custom-input-group select {
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

/* Live Math Visualizer */
.math-visualizer {
  background: linear-gradient(180deg, #13192c 0%, #171d33 100%);
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: var(--radius-md);
  padding: clamp(14px, 2.5vw, 18px);
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  width: 100%;
  overflow: hidden;
}

.math-visualizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.math-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #00d2ff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.calc-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

@media (max-width: 640px) {
  .calc-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 400px) {
  .calc-stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.calc-stat {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 0;
  overflow: hidden;
}

.calc-stat-label {
  font-size: 10px;
  color: var(--text-sub);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-stat-val {
  font-size: clamp(13px, 2.2vw, 15px);
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bpp-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.bpp-badge.optimal {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.bpp-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.bpp-badge.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Warnings and Alerts */
.alert-container {
  margin-top: 8px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-word;
}

.alert-item.warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.alert-item.tip {
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.25);
  color: #38bdf8;
}

.alert-item.info {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Command preview (Strictly scrollable, NEVER stretches container) */
.command-preview-box {
  background: #090c15;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #64748b;
  overflow-x: auto;
  white-space: nowrap;
  width: 100%;
  max-width: 100%;
  display: block;
}

/* Advanced Options Accordion */
details.tuning-details {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
  width: 100%;
}

details.tuning-details summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  flex-wrap: wrap;
  gap: 6px;
}

details.tuning-details summary::-webkit-details-marker {
  display: none;
}

.tuning-content {
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

@media (max-width: 600px) {
  .tuning-content {
    grid-template-columns: minmax(0, 1fr);
  }
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.control-item label {
  font-size: 12px;
  color: var(--text-muted);
}

.control-item select, .control-item input[type="range"] {
  background: #0d111d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 6px 8px;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-main);
  user-select: none;
}

/* Progress Section */
.progress-box {
  background: var(--bg-card);
  border: 1px solid rgba(88, 101, 242, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.15);
  width: 100%;
}

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

.progress-status {
  font-size: 13px;
  font-weight: 600;
  color: #00d2ff;
}

.progress-percent {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #090c15;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00d2ff, #5865f2);
  border-radius: var(--radius-full);
  transition: width 0.15s ease;
  box-shadow: 0 0 10px #00d2ff;
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-sub);
  flex-wrap: wrap;
  gap: 6px;
}

/* Log Drawer */
.log-toggle-bar {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.log-drawer {
  display: none;
  background: #05070c;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 8px;
  max-height: 160px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #7dd3fc;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
  width: 100%;
}

.log-drawer.open {
  display: block;
}

/* Results Section */
.result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 32px);
  box-shadow: var(--shadow-card);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}

.result-banner {
  text-align: center;
  margin-bottom: 24px;
}

.status-badge {
  display: inline-block;
  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  max-width: 100%;
  word-break: break-word;
}

.status-badge.verified {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.savings-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 210, 255, 0.15);
  color: #38bdf8;
}

/* Result Stats Row */
.result-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}

@media (max-width: 600px) {
  .result-stats-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.result-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  min-width: 0;
}

.result-stat-label {
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.result-stat-value {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

/* Comparison Grid */
.result-preview-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  width: 100%;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

@media (max-width: 680px) {
  .comparison-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.comparison-pane {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.comparison-pane video, .comparison-pane img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.comparison-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  z-index: 5;
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.result-actions .btn {
  flex: 1 1 auto;
  min-width: 180px;
}

@media (max-width: 500px) {
  .result-actions .btn {
    width: 100%;
  }
}

/* Utilities */
.hidden {
  display: none !important;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #00d2ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

footer {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  width: 100%;
}
/* ==========================================================================
   Tool Suite Navigation & Multi-Tool Styles
   ========================================================================== */

.tool-nav-bar {
  background: rgba(14, 18, 32, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0;
  position: sticky;
  top: 64px;
  z-index: 90;
  backdrop-filter: blur(8px);
}

.nav-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 680px) {
  header {
    position: relative;
  }
  .tool-nav-bar {
    top: 0;
    padding: 6px 0;
  }
  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    overflow-x: visible;
  }
  .nav-tab {
    justify-content: center;
    padding: 8px 4px;
    font-size: clamp(11.5px, 3.2vw, 13px);
    width: 100%;
    border-radius: 10px;
    text-align: center;
    min-height: 42px;
  }
}

.nav-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
}

.nav-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-tab.active {
  background: rgba(0, 210, 255, 0.12);
  border-color: #00d2ff;
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.2);
}

.tab-icon {
  font-size: 15px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-content.active {
  display: block;
}

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

/* Direct Target Input Card */
.direct-target-box {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.08) 0%, rgba(88, 101, 242, 0.08) 100%);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.target-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.main-size-input {
  background: #090c15;
  border: 1px solid rgba(0, 210, 255, 0.4);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 8px 12px;
  flex: 1;
  min-width: 100px;
  outline: none;
  transition: all 0.2s;
}

.main-size-input:focus {
  border-color: #00d2ff;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.35);
}

.unit-select {
  background: #090c15;
  border: 1px solid rgba(0, 210, 255, 0.4);
  border-radius: var(--radius-sm);
  color: #00d2ff;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  outline: none;
}

/* Quick Preset Chips */
.quick-preset-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.preset-chip:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-chip.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #34d399;
  font-weight: 600;
}

/* PDF info box */
.pdf-info-box {
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 14px;
}

/* Converter Mode Selector */
.converter-mode-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 30px;
  max-width: 500px;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
  white-space: nowrap;
}

.mode-btn.active {
  background: linear-gradient(135deg, #00d2ff, #5865f2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35);
}

/* ==========================================================================
   Non-Intrusive, Zero-CLS Ad Containers (Desktop & Mobile Optimized)
   ========================================================================== */
.ad-slot-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 28px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.ad-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.ad-box {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: rgba(17, 22, 37, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s;
}

.ad-box:hover {
  border-color: rgba(88, 101, 242, 0.3);
}

.ad-placeholder-text {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mobile Ad Sizing */
@media (max-width: 768px) {
  .ad-box {
    max-width: 320px;
    min-height: 50px;
  }
}

/* ==========================================================================
   SEO Knowledgebase, Guides & FAQ Accordions
   ========================================================================== */
.seo-section {
  width: 100%;
  max-width: 1000px;
  margin: 50px auto 40px;
  padding: 0 16px;
}

.seo-header {
  text-align: center;
  margin-bottom: 36px;
}

.seo-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.seo-header p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 680px;
  margin: 0 auto;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.seo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s;
}

.seo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 101, 242, 0.35);
}

.seo-card-icon {
  font-size: 28px;
  margin-bottom: 14px;
  display: inline-block;
}

.seo-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.seo-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Platform Limits Table */
.limits-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  padding: 20px;
}

.limits-table-wrapper h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.limits-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.limits-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.limits-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.limits-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
}

.badge-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-discord { background: rgba(88, 101, 242, 0.2); color: #8ea1e1; }
.badge-slack { background: rgba(224, 30, 90, 0.2); color: #f06a8f; }
.badge-gmail { background: rgba(234, 67, 53, 0.2); color: #f28b82; }
.badge-portal { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* FAQ Accordion */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.faq-summary {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: '＋';
  font-size: 16px;
  color: var(--accent-cyan);
  transition: transform 0.2s;
}

details[open] .faq-summary::after {
  content: '−';
}

.faq-content {
  padding: 0 20px 20px 20px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Semantic Footer Links */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 13px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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