/* ═══════════════════════════════════════════
   controls.css — Nút chuyển theme (4 chế độ) & độ sáng
   ═══════════════════════════════════════════ */

/* ─── THEME CONTROLS WRAPPER ─── */
.theme-controls {
  position: fixed;
  top: 1.1rem;
  right: 1.2rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* ─── 4-MODE THEME TOGGLE ─── */
.theme-toggle {
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,192,203,0.45);
  border-radius: 50px;
  cursor: pointer;
  padding: 4px 5px;
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s, border-color 0.3s;
  box-shadow: 0 2px 12px rgba(201,132,142,0.15);
}
.theme-toggle:hover { background: rgba(255,192,203,0.25); }
html.dark .theme-toggle {
  background: rgba(20,10,15,0.45);
  border-color: rgba(242,167,187,0.3);
}

.toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
}

/* Each pip */
.theme-pip {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(155,107,120,0.6);
  transition: color 0.3s;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.theme-pip.active { color: white; }

/* Sliding indicator behind pips */
.toggle-indicator {
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--petal), var(--blush));
  box-shadow: 0 2px 8px rgba(201,132,142,0.5);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), background 0.4s ease;
  top: 0; left: 0;
  z-index: 0;
}

/* Indicator positions per theme (0=dawn, 1=light, 2=dusk, 3=dark) */
html.dawn  .toggle-indicator { transform: translateX(0px); }
html:not(.dark):not(.dawn):not(.dusk) .toggle-indicator { transform: translateX(27px); }
html.dusk  .toggle-indicator { transform: translateX(54px); }
html.dark  .toggle-indicator { transform: translateX(81px); background: linear-gradient(135deg, #4a1530, #2d0e1e); }

/* Dawn: warm golden sunrise */
html.dawn .toggle-indicator { background: linear-gradient(135deg, #F4B97A, #E8946A); }
/* Dusk: deep sunset */
html.dusk .toggle-indicator { background: linear-gradient(135deg, #E8956A, #C4708A); }

/* Active pip colors */
html:not(.dark):not(.dawn):not(.dusk) .pip-light { color: white; }
html.dawn  .pip-dawn  { color: white; }
html.dusk  .pip-dusk  { color: white; }
html.dark  .pip-dark  { color: rgba(242,167,187,0.95); }

/* ─── BRIGHTNESS TOGGLE BUTTON ─── */
.brightness-toggle-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,192,203,0.4);
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--rose-gold);
  transition: background 0.25s, transform 0.2s, border-color 0.25s;
  box-shadow: 0 2px 12px rgba(201,132,142,0.15);
  flex-shrink: 0;
}
.brightness-toggle-btn:hover { background: rgba(255,192,203,0.3); transform: scale(1.08); }
html.dark .brightness-toggle-btn {
  background: rgba(20,10,15,0.45);
  border-color: rgba(242,167,187,0.25);
}

/* ─── BRIGHTNESS PANEL ─── */
.brightness-panel {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,192,203,0.4);
  border-radius: 50px;
  padding: 5px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 14px rgba(201,132,142,0.14);
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-width 0.4s cubic-bezier(0.4,0,0.2,1),
              opacity 0.3s ease,
              padding 0.35s ease;
  padding-left: 0; padding-right: 0;
}
.brightness-panel.open {
  max-width: 220px;
  opacity: 1;
  pointer-events: auto;
  padding: 5px 14px;
}
html.dark .brightness-panel {
  background: rgba(20,10,15,0.5);
  border-color: rgba(242,167,187,0.22);
}

.brightness-label {
  color: var(--rose-gold);
  display: flex; align-items: center;
  flex-shrink: 0;
}

.brightness-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px; height: 3px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(90deg,
    var(--blush) var(--bprog, 100%),
    rgba(255,192,203,0.25) var(--bprog, 100%)
  );
  flex-shrink: 0;
}
.brightness-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--petal), var(--blush));
  box-shadow: 0 1px 6px rgba(201,132,142,0.55);
  cursor: pointer;
  transition: transform 0.15s;
}
.brightness-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }
.brightness-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border: none; border-radius: 50%;
  background: var(--blush);
}

.brightness-value {
  font-size: 0.67rem;
  font-family: monospace;
  color: var(--rose-gold);
  width: 2.8rem;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

/* Brightness filter target */
#brightnessTarget {
  transition: filter 0.3s ease;
}
