/* ─── Reset ─────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; width: 100%;
  overflow: hidden;
}

body {
  display: flex;
  font-family: Arial, sans-serif;
  color: #f0f0f0;
}

/* ─── Theme Variables ────────────────────────────────── */

[data-theme="amber"] {
  --bg:           #0f0d0a;
  --panel-bg:     #16120d;
  --panel-border: #2a2015;
  --text-primary: #f0d9a0;
  --text-dim:     #8a7050;
  --text-muted:   #4a3a25;
  --accent:       #e8a830;
  --dot-active:   #e8a830;
  --dot-inactive: #3a2e1a;
  --clock-card:   #1c1710;
  --clock-border: #2e2416;
  --quote-font:   'DM Serif Display', serif;
  --clock-font:   'Cormorant Garamond', serif;
  --hanoi-bg:     rgba(10, 8, 4, 0.6);
  --category-color: #c07820;
  --btn-bg:       rgba(232, 168, 48, 0.12);
  --btn-hover:    rgba(232, 168, 48, 0.28);
  --btn-text:     #e8a830;
  --switcher-bg:  rgba(22, 18, 13, 0.92);
}

[data-theme="glass"] {
  --bg:           #0a0e18;
  --panel-bg:     rgba(255,255,255,0.04);
  --panel-border: rgba(255,255,255,0.08);
  --text-primary: #e8eef8;
  --text-dim:     #6878a0;
  --text-muted:   #303850;
  --accent:       #5b9cf6;
  --dot-active:   #5b9cf6;
  --dot-inactive: #1e2540;
  --clock-card:   rgba(255,255,255,0.05);
  --clock-border: rgba(255,255,255,0.08);
  --quote-font:   'Cormorant Garamond', serif;
  --clock-font:   'Space Mono', monospace;
  --hanoi-bg:     rgba(0, 8, 30, 0.55);
  --category-color: #5b9cf6;
  --btn-bg:       rgba(91, 156, 246, 0.1);
  --btn-hover:    rgba(91, 156, 246, 0.25);
  --btn-text:     #5b9cf6;
  --switcher-bg:  rgba(10, 14, 24, 0.88);
}

[data-theme="ink"] {
  --bg:           #080808;
  --panel-bg:     #0e0e0e;
  --panel-border: #1a1a1a;
  --text-primary: #f2f2f2;
  --text-dim:     #555;
  --text-muted:   #252525;
  --accent:       #f2f2f2;
  --dot-active:   #f2f2f2;
  --dot-inactive: #1e1e1e;
  --clock-card:   #111;
  --clock-border: #1c1c1c;
  --quote-font:   'Patrick Hand', cursive;
  --clock-font:   'Space Mono', monospace;
  --hanoi-bg:     rgba(0,0,0,0.65);
  --category-color: #666;
  --btn-bg:       rgba(242,242,242,0.07);
  --btn-hover:    rgba(242,242,242,0.15);
  --btn-text:     #999;
  --switcher-bg:  rgba(8,8,8,0.92);
}

/* FOREST — deep green, earthy */
[data-theme="forest"] {
  --bg:           #080e09;
  --panel-bg:     #0d1510;
  --panel-border: #1a2e1e;
  --text-primary: #c8e6c0;
  --text-dim:     #5a8a60;
  --text-muted:   #1e3022;
  --accent:       #4caf6e;
  --dot-active:   #4caf6e;
  --dot-inactive: #1a2e1e;
  --clock-card:   #0f1a12;
  --clock-border: #1e3525;
  --quote-font:   'DM Serif Display', serif;
  --clock-font:   'Cormorant Garamond', serif;
  --hanoi-bg:     rgba(4, 10, 5, 0.65);
  --category-color: #4caf6e;
  --btn-bg:       rgba(76, 175, 110, 0.1);
  --btn-hover:    rgba(76, 175, 110, 0.25);
  --btn-text:     #4caf6e;
}

/* ROSE — warm pink dusk */
[data-theme="rose"] {
  --bg:           #0e080b;
  --panel-bg:     #160d11;
  --panel-border: #2a1520;
  --text-primary: #f0c8d8;
  --text-dim:     #9a6070;
  --text-muted:   #3a1e28;
  --accent:       #e06080;
  --dot-active:   #e06080;
  --dot-inactive: #2a1520;
  --clock-card:   #180e14;
  --clock-border: #2e1822;
  --quote-font:   'Cormorant Garamond', serif;
  --clock-font:   'Cormorant Garamond', serif;
  --hanoi-bg:     rgba(10, 4, 7, 0.65);
  --category-color: #c04060;
  --btn-bg:       rgba(224, 96, 128, 0.1);
  --btn-hover:    rgba(224, 96, 128, 0.25);
  --btn-text:     #e06080;
}

/* SLATE — cool blue-grey, corporate calm */
[data-theme="slate"] {
  --bg:           #090c10;
  --panel-bg:     #0e1318;
  --panel-border: #1a2230;
  --text-primary: #c8d8e8;
  --text-dim:     #5878a0;
  --text-muted:   #1a2535;
  --accent:       #7aa8d8;
  --dot-active:   #7aa8d8;
  --dot-inactive: #1a2535;
  --clock-card:   #101520;
  --clock-border: #1e2a3a;
  --quote-font:   'Patrick Hand', cursive;
  --clock-font:   'Space Mono', monospace;
  --hanoi-bg:     rgba(5, 8, 14, 0.65);
  --category-color: #5878a0;
  --btn-bg:       rgba(122, 168, 216, 0.1);
  --btn-hover:    rgba(122, 168, 216, 0.25);
  --btn-text:     #7aa8d8;
}

/* DUSK — purple violet night */
[data-theme="dusk"] {
  --bg:           #09080e;
  --panel-bg:     #100e18;
  --panel-border: #201a30;
  --text-primary: #d8c8f0;
  --text-dim:     #7060a8;
  --text-muted:   #201535;
  --accent:       #9870e0;
  --dot-active:   #9870e0;
  --dot-inactive: #201535;
  --clock-card:   #120f1c;
  --clock-border: #241a38;
  --quote-font:   'DM Serif Display', serif;
  --clock-font:   'Space Mono', monospace;
  --hanoi-bg:     rgba(6, 4, 12, 0.65);
  --category-color: #7855c0;
  --btn-bg:       rgba(152, 112, 224, 0.1);
  --btn-hover:    rgba(152, 112, 224, 0.25);
  --btn-text:     #9870e0;
}

/* COPPER — oxidised bronze, vintage terminal */
[data-theme="copper"] {
  --bg:           #0a0804;
  --panel-bg:     #130f08;
  --panel-border: #2a1e0a;
  --text-primary: #e8c890;
  --text-dim:     #907040;
  --text-muted:   #2a1e08;
  --accent:       #c87830;
  --dot-active:   #c87830;
  --dot-inactive: #2a1e08;
  --clock-card:   #160e06;
  --clock-border: #2e200a;
  --quote-font:   'Space Mono', monospace;
  --clock-font:   'Space Mono', monospace;
  --hanoi-bg:     rgba(8, 5, 2, 0.65);
  --category-color: #a06020;
  --btn-bg:       rgba(200, 120, 48, 0.1);
  --btn-hover:    rgba(200, 120, 48, 0.25);
  --btn-text:     #c87830;
}

/* ARCTIC — ice white on near-black */
[data-theme="arctic"] {
  --bg:           #060810;
  --panel-bg:     #0a0e18;
  --panel-border: #141e30;
  --text-primary: #e8f4ff;
  --text-dim:     #5888b8;
  --text-muted:   #0e1a2c;
  --accent:       #88ccff;
  --dot-active:   #88ccff;
  --dot-inactive: #0e1a2c;
  --clock-card:   #0c1220;
  --clock-border: #182030;
  --quote-font:   'Cormorant Garamond', serif;
  --clock-font:   'Space Mono', monospace;
  --hanoi-bg:     rgba(3, 5, 12, 0.65);
  --category-color: #5888b8;
  --btn-bg:       rgba(136, 204, 255, 0.08);
  --btn-hover:    rgba(136, 204, 255, 0.2);
  --btn-text:     #88ccff;
}

/* EMBER — deep red, smoldering */
[data-theme="ember"] {
  --bg:           #0e0604;
  --panel-bg:     #160a06;
  --panel-border: #2e1008;
  --text-primary: #f0d0b0;
  --text-dim:     #a05030;
  --text-muted:   #2e1008;
  --accent:       #e04020;
  --dot-active:   #e04020;
  --dot-inactive: #2e1008;
  --clock-card:   #180806;
  --clock-border: #301208;
  --quote-font:   'DM Serif Display', serif;
  --clock-font:   'Cormorant Garamond', serif;
  --hanoi-bg:     rgba(10, 3, 2, 0.65);
  --category-color: #c03018;
  --btn-bg:       rgba(224, 64, 32, 0.1);
  --btn-hover:    rgba(224, 64, 32, 0.25);
  --btn-text:     #e04020;
}

/* ─── Base Layout ────────────────────────────────────── */

body { background: var(--bg); }

[data-theme="glass"] body,
[data-theme="glass"] {
  background: radial-gradient(ellipse at 20% 50%, #0d1530 0%, #070a14 60%),
              radial-gradient(ellipse at 80% 20%, #0a1525 0%, transparent 50%);
}

#container {
  display: flex;
  height: 100vh;
  width: 100vw;
  min-width: 400px;
  min-height: 400px;
}

.panel {
  flex: 1;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  min-width: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  transition: none;
}

[data-theme="glass"] .panel {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ─── Left Panel ────────────────────────────────────── */

#left {
  flex: 0 0 30%;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 24px 24px;
}

/* ─── Category Filter Bar ────────────────────────────── */

#category-filters {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  gap: 6px;
  padding: 0 16px;
  z-index: 2;
  flex-wrap: wrap;
}

.cat-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid var(--category-color);
  color: var(--category-color);
  background: transparent;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, background 0.2s;
  white-space: nowrap;
}

.cat-btn.active {
  background: var(--category-color);
  color: var(--bg);
  opacity: 1;
}

.cat-btn:hover {
  opacity: 0.8;
}

#quote {
  font-family: var(--quote-font);
  font-size: 2rem;
  line-height: 1.65;
  color: var(--text-primary);
  text-align: left;
  width: 100%;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#quote.visible {
  opacity: 1;
  transform: translateY(0);
}

[data-theme="amber"] #quote { font-style: italic; }
[data-theme="glass"] #quote { font-style: italic; }

/* ─── Quote Counter ──────────────────────────────────── */

#quote-dots {
  position: absolute;
  bottom: 14px;
  left: 22px;
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  opacity: 0.5;
  z-index: 2;
  user-select: none;
}

/* ─── Center Panel ───────────────────────────────────── */

#center {
  padding: 5px;
  flex: 1 1 auto;
  min-width: 0;
}

.center-img {
  position: absolute;
  inset: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  object-fit: contain;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.9s ease;
  z-index: 1;
}

.center-img.active {
  opacity: 1;
  z-index: 2;
}

#nextArrow {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--btn-bg);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--btn-text);
  font-size: 0.85rem;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s, transform 0.15s;
  z-index: 10;
}

#nextArrow:hover {
  background: var(--btn-hover);
  transform: translateX(3px);
}

#nextArrow span {
  font-size: 0.65rem;
  opacity: 0.6;
}

/* Hanoi clock */
#hanoi-clock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #fff;
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.85);
  background: var(--hanoi-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 5;
  white-space: nowrap;
}

[data-theme="amber"] #hanoi-clock { font-family: 'Cormorant Garamond', serif; font-size: 2.8rem; }
[data-theme="glass"] #hanoi-clock { font-family: 'Space Mono', monospace; font-size: 2.2rem; }
[data-theme="ink"]   #hanoi-clock { font-family: 'Space Mono', monospace; font-size: 2.2rem; }

.colon {
  display: inline-block;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.clock-top    { top: 18px; bottom: auto; }
.clock-center { top: 50%; transform: translate(-50%, -50%) !important; }
.clock-bottom { bottom: 18px; top: auto; }



/* ─── Right Panel ────────────────────────────────────── */

#right {
  flex: 0 0 22%;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 20px 14px;
}

#right-label {
  display: none;
}

#clocks {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  z-index: 2;
}

.clock-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--clock-card);
  border: 1px solid var(--clock-border);
  border-radius: 7px;
  padding: 5px 12px;
  transition: border-color 0.2s, transform 0.15s;
}

.clock-card:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.clock-city {
  font-family: var(--clock-font);
  font-size: 1.05rem;
  color: var(--text-dim);
}

.clock-time {
  font-family: 'Space Mono', monospace;
  font-size: 1.2rem;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

[data-theme="amber"] .clock-time { color: var(--accent); }

/* ─── Center Panel Buttons ───────────────────────────── */

#themeShuffleBtn,
#dimBtn {
  position: absolute;
  bottom: 14px;
  background: var(--btn-bg);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--btn-text);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.4s ease;
  z-index: 10;
  opacity: 0.6;
}

#themeShuffleBtn { left: 14px; }
#dimBtn          { left: 54px; } /* sits right next to shuffle btn */

#themeShuffleBtn:hover {
  background: var(--btn-hover);
  opacity: 1;
  transform: rotate(180deg);
}

#dimBtn:hover {
  background: var(--btn-hover);
  opacity: 1;
}

#dimBtn.active {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
}

/* Dim overlay — sits over everything but below buttons */
#dim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 50;
  pointer-events: none; /* lets clicks through to buttons */
  opacity: 0;
  transition: opacity 0.5s ease;
}

#dim-overlay.active {
  opacity: 1;
}
