/* PicDriver Camera Settings Simulator & Photography Learning Studio Design System */

:root {
  --bg-primary: #0c0e14;
  --bg-secondary: #121620;
  --bg-tertiary: #181d2c;
  --bg-card: #151a27;
  --bg-surface: #1e2436;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #38bdf8;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-indigo: #6366f1;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;
  
  --vf-oled: #05070a;
  --vf-meter-green: #22c55e;
  --vf-meter-amber: #f59e0b;
  --vf-meter-red: #ef4444;
  --vf-grid: rgba(255, 255, 255, 0.28);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  --font-lcd: 'Courier New', Courier, monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header & Navigation */
.site-header {
  background-color: #000000;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text span {
  color: var(--accent-cyan);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-cyan);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Tool Strip Container */
.tool-strip-section {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  position: relative;
}

.tool-strip-wrapper {
  max-width: 1440px;
  margin: 0 auto;
}

.tool-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.tool-strip-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.tool-strip-counter {
  background-color: var(--bg-tertiary);
  color: var(--accent-amber);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.tool-chips-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.tool-chips-scroll::-webkit-scrollbar {
  height: 4px;
}

.tool-chips-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.tool-chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  white-space: nowrap;
}

.tool-chip:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.tool-chip.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.15));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* Active Tool Banner */
.active-tool-banner {
  width: 100%;
  max-width: 1440px;
  margin: 1.25rem auto 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(21, 26, 39, 0.9), rgba(18, 22, 32, 0.9));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.banner-top-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.banner-tag {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.banner-pill {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.banner-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.banner-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 900px;
  line-height: 1.5;
}

/* 4 Mode Navigation Tabs */
.mode-nav-tabs {
  width: 100%;
  max-width: 1440px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
}

.mode-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  white-space: nowrap;
}

.mode-tab-btn:hover {
  color: var(--text-primary);
}

.mode-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.mode-tab-badge {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.mode-tab-btn.active .mode-tab-badge {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

/* 6 Featured Metric Cards - Horizontal Strip */
.metrics-section {
  width: 100%;
  max-width: 1440px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  width: 100%;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--accent-emerald);
  margin-top: 0.25rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Studio Workspace */
.studio-main {
  width: 100%;
  max-width: 1440px;
  margin: 1.25rem auto 2rem;
  padding: 0 1.5rem;
  flex: 1;
}

.studio-grid {
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 1.5rem;
  align-items: start;
}

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

/* Left Column: Virtual Viewfinder & Optics */
.viewfinder-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.camera-body-frame {
  background: #11141c;
  border: 2px solid #232a3d;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}

/* Camera Top Controls Bar */
.camera-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.camera-brand-stamp {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.camera-brand-stamp span {
  color: var(--accent-cyan);
}

.camera-status-indicators {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
}

.status-dot.pulsing {
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* Viewfinder Viewport */
.viewfinder-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 3px solid #000000;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
}

#sim-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Viewfinder HUD Overlays */
.viewfinder-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem;
  box-sizing: border-box;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.hud-group {
  display: flex;
  gap: 0.5rem;
}

.hud-pill {
  background: rgba(0, 0, 0, 0.55);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-pill.highlight {
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

/* Viewfinder Center Grid & Focus Area */
.hud-center {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.grid-thirds {
  width: 100%;
  height: 100%;
  position: absolute;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  transition: opacity 0.2s;
}

.grid-thirds.hidden {
  opacity: 0;
}

.grid-thirds div {
  border: 1px dashed var(--vf-grid);
}

.af-bracket-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  transition: var(--transition);
}

.af-bracket-center.focused {
  border-color: var(--vf-meter-green);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.af-bracket-center::before,
.af-bracket-center::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.6);
}

.af-bracket-center::before {
  top: 50%;
  left: -6px;
  right: -6px;
  height: 1px;
  transform: translateY(-50%);
}

.af-bracket-center::after {
  left: 50%;
  top: -6px;
  bottom: -6px;
  width: 1px;
  transform: translateX(-50%);
}

/* HUD Bottom Exposure Meter & Bar */
.hud-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.exposure-meter-bar {
  background: rgba(0, 0, 0, 0.7);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
}

.meter-scale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.meter-ticks {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 12px;
}

.meter-tick {
  width: 2px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
}

.meter-tick.major {
  height: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.meter-tick.active {
  background: var(--vf-meter-green);
  box-shadow: 0 0 6px var(--vf-meter-green);
}

.meter-tick.active.warning {
  background: var(--vf-meter-amber);
  box-shadow: 0 0 6px var(--vf-meter-amber);
}

.meter-tick.active.danger {
  background: var(--vf-meter-red);
  box-shadow: 0 0 6px var(--vf-meter-red);
}

.hud-readouts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.85);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.readout-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.readout-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.readout-val {
  color: var(--accent-cyan);
}

.readout-val.amber {
  color: var(--accent-amber);
}

.readout-val.emerald {
  color: var(--accent-emerald);
}

/* Mini Histogram Canvas */
.mini-histogram-wrap {
  position: absolute;
  bottom: 5rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  pointer-events: none;
  transition: opacity 0.2s;
}

.mini-histogram-wrap.hidden {
  opacity: 0;
}

#histogram-canvas {
  display: block;
  width: 100px;
  height: 50px;
}

/* Viewfinder Action & Controls Bar */
.viewfinder-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.shutter-btn-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shutter-btn {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: 2px solid #f87171;
  color: #ffffff;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transition: transform 0.1s, box-shadow 0.1s;
}

.shutter-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

.vf-hud-toggles {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vf-toggle-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.vf-toggle-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.vf-toggle-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Secondary Visualizations: Exposure Triangle & Iris */
.optics-visual-deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .optics-visual-deck {
    grid-template-columns: 1fr;
  }
}

.visual-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.visual-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.visual-box-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.visual-box-badge {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.canvas-center-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
}

#triangle-canvas,
#iris-canvas {
  display: block;
  max-width: 100%;
}

/* Right Column: Controls, Finders & Questionnaire */
.controls-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.control-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.control-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* PASM Camera Mode Dial */
.mode-dial-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

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

.mode-dial-buttons {
  display: flex;
  gap: 0.35rem;
}

.mode-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.mode-explanation {
  font-size: 0.8rem;
  color: var(--accent-amber);
  margin-top: 0.25rem;
  width: 100%;
}

/* Exposure Sliders */
.slider-group {
  margin-bottom: 1rem;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.slider-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.slider-val-badge.locked {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: transparent;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.slider-ticks-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
}

/* Optics & Sensor Selectors */
.optics-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.styled-select {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.styled-select:focus {
  border-color: var(--accent-cyan);
}

/* Preset Chips for WB & Scenes */
.preset-chips-deck {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.preset-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.preset-chip.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  font-weight: 600;
}

/* "What Camera Settings Should I Use?" Diagnostic Questionnaire */
.wizard-box {
  background: linear-gradient(135deg, rgba(24, 29, 44, 0.7), rgba(18, 22, 32, 0.7));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.wizard-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wizard-badge {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.question-row {
  margin-bottom: 0.85rem;
}

.question-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.choice-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.choice-chip:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.choice-chip.selected {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Recommended Recipe Output Box */
.recipe-result-box {
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.recipe-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.recipe-triplets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.recipe-triplet-item {
  background: var(--bg-tertiary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.recipe-triplet-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.recipe-triplet-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.recipe-explanation {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.apply-recipe-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  border: none;
  color: #ffffff;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.apply-recipe-btn:hover {
  opacity: 0.9;
}

/* 20-Tool Matrix Table */
.matrix-section {
  width: 100%;
  max-width: 1440px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.matrix-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

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

.matrix-table th {
  background: var(--bg-secondary);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.matrix-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.matrix-table tr:last-child td {
  border-bottom: none;
}

.matrix-table tbody tr {
  cursor: pointer;
  transition: var(--transition);
}

.matrix-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.08);
  color: var(--text-primary);
}

.matrix-table tbody tr.active td {
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-cyan);
}

.matrix-table tbody tr.active .tool-name-cell {
  color: var(--accent-cyan);
  font-weight: 700;
}

.matrix-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.tool-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-badge.sim { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.tool-badge.calc { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.tool-badge.find { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.tool-badge.guide { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

/* Educational Photography Guide */
.guide-section {
  width: 100%;
  max-width: 1440px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}

.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.guide-card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

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

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

.rule-highlight {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* FAQ Accordion Section */
.faq-section {
  width: 100%;
  max-width: 1440px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 1.1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-question:hover {
  color: var(--accent-cyan);
}

.faq-chevron {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

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

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding-bottom: 1.25rem;
  transition: max-height 0.3s ease-in-out;
}

/* Footer */
.site-footer {
  background-color: #000000;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  padding: 2.5rem 1.5rem;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-brand span {
  color: var(--accent-cyan);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .header-container {
    padding: 0.75rem 1rem;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #000000;
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-links.open,
  .nav-links.show {
    display: flex;
  }
  
  .banner-title {
    font-size: 1.35rem;
  }
  
  .studio-main,
  .tool-strip-section,
  .active-tool-banner,
  .mode-nav-tabs,
  .metrics-section,
  .matrix-section,
  .guide-section,
  .faq-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .camera-body-frame {
    padding: 0.75rem;
  }
  
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Metric Card Interactivity & Jumps */
.metric-card {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, border-color 0.2s;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.15);
}

.metric-card:active {
  transform: translateY(-1px);
}

/* Pulse Highlight for Scrolled Controls */
@keyframes highlight-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.8);
    border-color: var(--accent-cyan);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(56, 189, 248, 0.45);
    border-color: var(--accent-cyan);
  }
  100% {
    box-shadow: none;
    border-color: var(--border-color);
  }
}

.highlight-pulse {
  animation: highlight-glow 1.4s ease-out;
}

/* Auto-Controlled Mode Indicator on Sliders */
.slider-group.auto-controlled {
  position: relative;
}

.slider-group.auto-controlled .slider-val-badge::after {
  content: ' AUTO';
  font-size: 0.65rem;
  color: var(--accent-amber);
  margin-left: 0.25rem;
  font-weight: 800;
}

.slider-group.auto-controlled input[type="range"] {
  opacity: 0.6;
}

/* Recipe Applied Success Toast */
.recipe-applied-toast {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.85rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  animation: toastFade 2.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastFade {
  0% { opacity: 0; transform: translateY(6px); }
  12% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* Shutter Curtain Animation */
.shutter-flash-fx {
  animation: shutterFlash 0.12s ease-out;
}

@keyframes shutterFlash {
  0% { filter: brightness(3.0) contrast(1.2); }
  50% { filter: brightness(1.8); }
  100% { filter: none; }
}


/* ==========================================================================
   Universal Mobile & Tablet Responsiveness Suite (320px - 1040px)
   ========================================================================== */

/* 1. Fluid Media & Canvas Scaling */
img, canvas, svg, video {
  max-width: 100% !important;
  height: auto !important;
}

/* 2. Responsive Touch-Scroll Tables */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

.table-responsive,
.table-container,
.table-wrap,
.table-wrapper,
.matrix-container,
.data-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 3. Tablet Breakpoint (<= 1040px) */
@media (max-width: 1040px) {
  .workspace,
  .studio-layout,
  .finder-workspace,
  .simulator-grid,
  .layout-grid,
  .remover-workspace {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .sidebar-panel,
  .controls-sidebar {
    border-left: none !important;
    border-top: 1px solid var(--border, rgba(255,255,255,0.1));
  }
}

/* 4. Mobile Portrait & Landscape (<= 768px) */
@media (max-width: 768px) {
  .site-header {
    height: auto !important;
    padding: 10px 16px !important;
  }

  .header-inner,
  .header-container {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
  }

  .logo,
  .brand-logo,
  .logo-wrap {
    font-size: 1.15rem !important;
  }

  .menu-toggle {
    display: block !important;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #0a0d14;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    z-index: 1000;
  }

  .nav-links.open {
    display: flex !important;
  }

  .hero {
    padding: 28px 16px 20px !important;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 5.5vw, 2.3rem) !important;
    line-height: 1.2 !important;
  }

  .hero p {
    font-size: 0.92rem !important;
  }

  .page-wrapper,
  .portal-main,
  .container {
    padding: 16px 12px 40px !important;
  }

  .workspace,
  .studio-layout,
  .finder-workspace,
  .remover-workspace {
    padding: 0 !important;
    gap: 16px !important;
  }

  .panel-card,
  .results-card,
  .sidebar-panel,
  .stage-area,
  .card {
    padding: 16px 14px !important;
    border-radius: 12px !important;
  }

  .metrics-grid,
  .data-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .calc-grid,
  .features-grid,
  .steps-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .tool-chips-grid,
  .chips-bar,
  .preset-chip-group,
  .mode-tabs {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .tool-chip,
  .preset-btn,
  .mode-tab-btn {
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
  }

  .btn-primary,
  .btn-secondary,
  .action-btn,
  .btn-action {
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }

  .btn-group,
  .action-btns,
  .download-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }

  th, td {
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
  }
}

/* 5. Small Handsets (<= 480px) */
@media (max-width: 480px) {
  .hero-pill,
  .hero-badge {
    font-size: 0.72rem !important;
    padding: 3px 10px !important;
  }

  .form-group {
    margin-bottom: 14px !important;
  }

  .form-control,
  .form-select,
  .control-input,
  .control-select,
  input[type="text"],
  input[type="number"],
  select {
    font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
    min-height: 42px;
  }

  .info-section,
  .guide-section,
  .faq-section {
    padding: 24px 12px !important;
  }
}
