/* === Global custom layer to complement Tailwind === */

html {
  scroll-behavior: smooth;
}

/* Futuristic animated backdrop */
.bg-grid {
  background-image:
    radial-gradient(rgba(180, 80, 255, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(180, 80, 255, 0.08) 1px, transparent 1px);
  background-position: 0 0, 25px 25px;
  background-size: 50px 50px;
}

.bg-orbit {
  position: fixed;
  inset: -10% -10% auto auto;
  width: 60vmax;
  height: 60vmax;
  pointer-events: none;
  background: radial-gradient(45% 45% at 50% 50%, rgba(140, 0, 255, 0.18), transparent 70%);
  filter: blur(40px);
  animation: float 18s ease-in-out infinite;
  z-index: 0;
}

.bg-orbit-2 {
  inset: auto auto -10% -10%;
  background: radial-gradient(45% 45% at 50% 50%, rgba(255, 0, 179, 0.15), transparent 70%);
  animation-duration: 22s;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-4%, 2%, 0) scale(1.06); }
}

/* ==================================== */
/* GLASS + HYPnus AESTHETIC EFFECTS     */
/* ==================================== */

.glass {
  background: linear-gradient(to bottom right, rgba(28, 16, 40, 0.65), rgba(28, 16, 40, 0.45));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(180, 80, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 30px rgba(140, 0, 255, 0.06);
  position: relative;
  padding-bottom: 1.5rem; /* tightened default to remove excessive bottom gap */
}

/* Only command cards get extra bottom padding for sliders */
.command-grid .glass {
  padding-bottom: 3.5rem;
}

/* Glow hover */
.hover-glow {
  transition: box-shadow .25s ease, transform .25s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 0 2px rgba(180, 80, 255, .4),
              0 12px 30px rgba(180, 80, 255, .2);
  transform: translateY(-2px);
}

/* ==================================== */
/* Command Toggle + Positioning Fixes   */
/* ==================================== */

/* Ensure the card is a positioning parent */
.command-grid .glass {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Reserve enough height for content + toggle */
.command-grid .glass {
  min-height: 160px;
  padding-bottom: 3.5rem; /* extra bottom space for toggle */
}

/* Properly anchor the toggle to bottom-right inside card */
.command-grid .cmd-toggle-container {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  margin: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  width: auto;
  height: auto;
  z-index: 2;
}

/* Toggle core styles */
.cmd-toggle {
  position: relative;
  width: 70px;
  height: 35px;
  --dark: #15111c;
  --light: #d8dbe0;
  --vio: #7c3aed;
  --vio-glow: rgba(124, 58, 237, 0.85);
}

.cmd-toggle .switch-label {
  position: absolute;
  width: 100%;
  height: 35px;
  background-color: var(--dark);
  border-radius: 20px;
  cursor: pointer;
  border: 2px solid var(--dark);
  transition: 0.3s;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.04);
}

.cmd-toggle .checkbox {
  position: absolute;
  display: none;
}

.cmd-toggle .slider {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
  background: var(--dark);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}

/* Neon ON state */
.cmd-toggle .checkbox:checked + .switch-label .slider {
  background: linear-gradient(90deg, var(--vio), #9b5cf6);
  box-shadow: 0 0 20px var(--vio-glow), 0 0 40px var(--vio-glow);
  border: none;
  animation: pulseGlow 0.5s ease-out;
}

/* Knob */
.cmd-toggle .slider::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--light);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
  transition:
    transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.cmd-toggle .checkbox:checked + .switch-label .slider::before {
  transform: translateX(34px);
  background-color: #fff;
  box-shadow: 0 0 15px var(--vio-glow);
}

/* Updating state (while saving) */
.cmd-toggle.updating .switch-label,
.cmd-toggle.updating .slider {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(1);
}

/* Hover highlights */
.cmd-toggle:hover .slider::before {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}
.cmd-toggle .checkbox:checked:hover + .switch-label .slider {
  box-shadow: 0 0 25px var(--vio-glow), 0 0 50px var(--vio-glow);
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px var(--vio-glow), 0 0 20px var(--vio-glow); }
  50% { box-shadow: 0 0 25px var(--vio-glow), 0 0 50px var(--vio-glow); }
  100% { box-shadow: 0 0 20px var(--vio-glow), 0 0 40px var(--vio-glow); }
}

/* ==================================== */
/* Dashboard Stats Consistency Fix      */
/* ==================================== */

.stats-container {
  text-align: center;
}

.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  font-size: 0.9rem;
  line-height: 1.4;
  border-radius: 12px;
  transition: all 0.2s ease-in-out;
  background: linear-gradient(to bottom right, rgba(28, 16, 40, 0.65), rgba(28, 16, 40, 0.45));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(180, 80, 255, 0.18);
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(180, 80, 255, 0.3), 0 12px 30px rgba(180, 80, 255, 0.15);
}

.stat .label {
  font-size: 0.8rem;
  opacity: 0.75;
  letter-spacing: 0.4px;
}

.stat .value {
  font-size: 1rem;
  font-weight: 600;
}


/* ==================================== */
/* Hypnus Interactive Core Orbit Effect  */
/* ==================================== */

.interactive-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.core-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.core-center {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, #a855f7 0%, #6d28d9 40%, rgba(124, 58, 237, 0.2) 70%, transparent 100%);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.6), 0 0 100px rgba(168, 85, 247, 0.4);
  transition: box-shadow 0.3s ease;
}

.core-glow {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15), transparent 70%);
  filter: blur(30px);
  z-index: 0;
  transition: opacity 0.3s ease;
}

.orb {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle, #e879f9 0%, #7c3aed 60%, transparent 100%);
  box-shadow: 0 0 10px rgba(180, 80, 255, 0.6);
  animation: orbit var(--speed) linear infinite;
  opacity: 0.9;
}

@keyframes orbit {
  0% { transform: rotate(0deg) translateX(var(--radius)) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(var(--radius)) rotate(-360deg); }
}

/* Glow pulse when orbs are near */
.core-center.glow-boost {
  box-shadow: 0 0 60px rgba(200, 120, 255, 0.9), 0 0 140px rgba(200, 120, 255, 0.8);
}