:root {
  --bg: #101218;
  --bg-elevated: #171b22;
  --bg-soft: #1e2330;
  --fg: #f5f7ff;
  --fg-muted: #a5afc4;
  --accent: #4cc3ff;
  --accent-soft: rgba(76, 195, 255, 0.2);
  --danger: #ff6b81;
  --border: #262b36;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.4);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-fast: 0.15s ease-out;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

[data-theme="light"] {
  --bg: #f3f5fb;
  --bg-elevated: #ffffff;
  --bg-soft: #e5ebfb;
  --fg: #11141a;
  --fg-muted: #4b556a;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.15);
  --danger: #b91c1c;
  --border: #d0d7ea;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.12);
}
/* Neon / cyberpunk tema */
html[data-theme="neon"] {
  --bg: #020617;
  --bg-elevated: #020617;
  --card: #020617;
  --accent: #22d3ee;
  --accent-soft: rgba(244, 114, 182, 0.18);
  --accent-strong: rgba(244, 114, 182, 0.45);
  --text: #f9fafb;
  --muted: #a5b4fc;
  --border: #4c1d95;
  --shadow-soft: 0 20px 50px rgba(15, 23, 42, 0.95);
  --input-bg: #020617;
}

html[data-theme="neon"] body {
  background:
    radial-gradient(circle at top, rgba(56,189,248,0.35) 0, #020617 40%, #020617 100%),
    radial-gradient(circle at 0 100%, rgba(244,114,182,0.4), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(129,140,248,0.4), transparent 60%);
}

/* Amber / warm tema */
html[data-theme="amber"] {
  --bg: #111827;
  --bg-elevated: #0b1120;
  --card: #111827;
  --accent: #fb923c;
  --accent-soft: rgba(251, 146, 60, 0.18);
  --accent-strong: rgba(251, 146, 60, 0.45);
  --text: #fef3c7;
  --muted: #fbbf24;
  --border: #78350f;
  --shadow-soft: 0 20px 50px rgba(15, 23, 42, 0.95);
  --input-bg: #020617;
}

html[data-theme="amber"] body {
  background:
    radial-gradient(circle at top, rgba(248,250,252,0.06), transparent 55%),
    radial-gradient(circle at 0 100%, rgba(251,191,36,0.4), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(249,115,22,0.4), transparent 60%),
    #111827;
}

/* Monochrome tema */
html[data-theme="mono"] {
  --bg: #050505;
  --bg-elevated: #0b0b0b;
  --card: #111111;
  --accent: #e5e5e5;
  --accent-soft: rgba(229, 229, 229, 0.1);
  --accent-strong: rgba(229, 229, 229, 0.3);
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --border: #262626;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.9);
  --input-bg: #090909;
}

html[data-theme="mono"] body {
  background:
    radial-gradient(circle at top, #111 0, #000 45%, #000 100%);
  filter: grayscale(0.95);
}
/* Global */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, #191d26 0, var(--bg) 40%);
  color: var(--fg);
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* Header */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-soft));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

.title-area h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.lens-block,
.slider-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}

.lens-block select,
.slider-block input[type="range"] {
  min-width: 180px;
}

label {
  color: var(--fg-muted);
}

select,
input[type="number"] {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg);
  padding: 6px 8px;
  font-size: 0.86rem;
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

[data-theme="light"] select,
[data-theme="light"] input[type="number"] {
  background: #fff;
}

select:focus,
input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

/* Range sliders */

input[type="range"] {
  appearance: none;
  width: 240px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent-soft),
    rgba(148, 163, 184, 0.4)
  );
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-elevated);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
}

/* Tabs */

.tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg-muted);
  padding: 8px 4px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

.tab-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--fg);
  transform: translateY(-1px);
}

.tab-btn:hover {
  border-color: var(--accent);
}

.tabs {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  padding: 16px 18px 20px;
}

.tab-pane {
  display: none;
}

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

/* Layout in tabs */

.tab-grid {
  display: grid;
  gap: 18px;
}

.tab-grid.two {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.control-row {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-row label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 0.86rem;
}

.info-row > div {
  flex: 1;
}

/* EV meter */

.ev-meter {
  margin-top: 4px;
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.ev-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  transform: translateX(0%);
}

/* Warnings */

.warning-box {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
  background: rgba(148, 163, 184, 0.05);
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* AOV */

.aov-svg {
  width: 100%;
  max-width: 260px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at top, #1f2937, #020617);
  border: 1px solid var(--border);
}

.aov-circle {
  fill: rgba(15, 23, 42, 0.7);
  stroke: rgba(148, 163, 184, 0.4);
  stroke-width: 1;
}

.aov-line {
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.aov-text {
  fill: var(--fg-muted);
  font-size: 0.8rem;
}

#aov-line-left, #aov-line-right {
  transition: x2 0.2s ease, y2 0.2s ease;
} 
/* Histogram */

.histogram-canvas {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at bottom, #020617, #111827);
  border: 1px solid var(--border);
}

/* DOF */

.dof-results {
  background: rgba(148, 163, 184, 0.04);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.note {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* Bokeh panel */

.bokeh-panel {
  position: relative;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(circle at top, #111827, #020617);
  border: 1px solid var(--border);
}

.bokeh-background {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, #22d3ee 0, transparent 50%),
    radial-gradient(circle at 80% 30%, #f97316 0, transparent 55%),
    radial-gradient(circle at 20% 80%, #a855f7 0, transparent 55%);
  filter: blur(10px);
}

.bokeh-subject {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  text-shadow: 0 0 12px rgba(15, 23, 42, 0.8);
}

.bokeh-lights {
  position: absolute;
  inset: 0;
}

/* ND preview */

/* ND TAB – gerçek foto ile önizleme */

.nd-preview {
  position: relative;
  height: 300px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  overflow: hidden;
}

/* Burada gerçek foto var */
.nd-photo {
  position: absolute;
  inset: 0;
  background:
    url("../img/nd_scene.jpg") center center / cover no-repeat,
    linear-gradient(
      to bottom,
      #0b1120 0,
      #0f172a 40%,
      #020617 41%,
      #020617 100%
    );
  background-blend-mode: normal;
  filter: saturate(1.05) contrast(1.05);
  filter: var(--nd-base-filter, none);
  transition: 0.15s ease;
}

/* Temaya göre biraz farklı tint verebiliriz */
html[data-theme="light"] .nd-photo {
  filter: saturate(1.1) contrast(1.05);
}
html[data-theme="neon"] .nd-photo {
  filter: saturate(1.2) contrast(1.1);
}
html[data-theme="amber"] .nd-photo {
  filter: saturate(1.15) contrast(1.05) hue-rotate(-10deg);
}
html[data-theme="mono"] .nd-photo {
  filter: grayscale(0.9) contrast(1.1);
}

/* JS’nin over/under’a göre güncellediği overlay */
.nd-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0, #000 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s linear, background 0.15s linear;
}
.nd-scene {
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.nd-overlay {
  position: absolute;
  inset: 0;
  background: #020617;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

/* LIVE */

.starfield {
  height: 200px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at bottom, #020617, #000);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.starfield::before,
.starfield::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #ffffff 0.5px, transparent 0.5px);
  opacity: 0.5;
}

/* METEO */

.meteo-summary {
  font-size: 0.9rem;
  background: rgba(148, 163, 184, 0.04);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

/* Buttons */

button {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg);
  padding: 6px 10px;
  font-size: 0.84rem;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast), box-shadow var(--transition-fast);
}

button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Footer */

.app-footer {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-align: center;
}
/* ΔEV görünümü */

.ev-delta {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.9;
}

#exp-delta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* Kameradan EV ölçümü – minimal layout */

.camera-ev {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.camera-ev-preview {
  position: relative;
  flex: 0 0 90px;
  height: 90px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top, #1e293b, #020617);
}

.camera-ev-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.05);
}

.camera-ev-controls {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
}

#camera-ev-btn {
  align-self: flex-start;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at top, var(--accent-soft), transparent);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

#camera-ev-btn:hover {
  border-color: var(--accent);
}

.camera-ev-readout {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
  font-size: 0.8rem;
}

.camera-ev-readout .label {
  color: var(--muted);
}

#camera-ev-value,
#camera-brightness-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
}

/* Mobilde kompakt kalsın */
@media (max-width: 768px) {
  .camera-ev {
    flex-direction: row;
  }

  .camera-ev-preview {
    flex: 0 0 80px;
    height: 80px;
  }
}

.sweet-spot-pill {
  margin-top: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: none; /* default: gizli */
  align-items: center;
  gap: 0.25rem;
  border: 1px solid rgba(74, 222, 128, 0.7);
  color: #bbf7d0;
  background: radial-gradient(circle at top left,
    rgba(22, 163, 74, 0.4),
    rgba(15, 23, 42, 0.9)
  );
}

.sweet-spot-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.9);
}

.sweet-spot-pill.active {
  display: inline-flex;
}

.dof-presets {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8rem;
}

.dof-presets-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.7rem;
}

.dof-preset-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--surface-soft);
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.05s ease;
}

.dof-preset-btn:hover {
  transform: translateY(-1px);
}

.dof-preset-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* Sweet spot açıklama notu (EXP + DOF için ortak) */
.sweet-spot-note {
  display: none;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.sweet-spot-note.active {
  display: block;
}

.nd-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.nd-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.nd-group label {
  font-size: 0.8rem;
  color: var(--muted);
}

.nd-group input[type="range"] {
  width: 100%;
}

.nd-cpl-group .checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nd-cpl-group select {
  margin-top: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--surface-soft);
  font-size: 0.75rem;
}

.nd-summary {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.nd-total-note {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.nd-exposure {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.nd-preview-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.7);
}

.nd-preview-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

.nd-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: radial-gradient(
    circle at center,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.4),
    transparent 70%
  );
}

.exp-quick-controls {
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.quick-group {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
}

.quick-group select {
  padding: 0.25rem 0.5rem;
  border-radius: .35rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

.nd-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.nd-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.nd-group label {
  font-size: 0.8rem;
  color: var(--muted);
}

.nd-group input[type="range"] {
  width: 100%;
}

.nd-summary {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.nd-total-label {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.nd-exposure {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.nd-exposure-col {
  flex: 1 1 160px;
  font-size: 0.85rem;
}

.nd-exposure-col h3 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.nd-preview-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.7);
  margin-bottom: 0.5rem;
}

.nd-preview-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

.nd-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.2s ease;
  background: radial-gradient(
    circle at center,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0.4),
    transparent 70%
  );
}

.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.exp-left, .exp-right {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

#camera-ev-video {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: .5rem;
}

#camera-ev-canvas {
  display: none;
}

.nd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.25rem;
}

.nd-left,
.nd-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nd-summary-block {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.85rem;
}

.nd-summary-block h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.nd-preview-wrapper {
  position: relative;
  margin-top: 0.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.7);
}

.nd-preview-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

.nd-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: radial-gradient(
    circle at center,
    rgba(15, 23, 42, 0.75),
    rgba(15, 23, 42, 0.4),
    transparent 70%
  );
}