/* PhaseShift Circadian Theme & Visualizer Styling */

@layer base {
  * {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-sizing: border-box;
  }
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }
  body {
    min-width: 0;
    width: 100%;
  }
  header, nav, main, footer, section, .tab-panel {
    min-width: 0;
    max-width: 100%;
  }
  input, textarea, select {
    user-select: auto;
  }
}

.nav-tab {
  min-width: 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 13, 20, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(251, 191, 36, 0.4);
}

/* Nav Tab Active States */
.nav-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(245, 158, 11, 0.15));
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.mobile-nav-btn.active {
  color: #fbbf24;
}

/* Luminous 1px card edge — lifts flat navy slabs */
.luminous-edge {
  border: 1px solid rgba(251, 191, 36, 0.2);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.07),
    0 16px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Primary amber/gold CTA — 16px radius, pressed + dimmed */
.cta-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #090b10;
  border-radius: 16px;
  border: 1px solid rgba(253, 230, 138, 0.45);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.28);
  transition: transform 0.12s ease-out, filter 0.15s ease-out, box-shadow 0.15s ease-out, opacity 0.15s ease-out;
}
.cta-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.38);
}
.cta-primary:active {
  transform: scale(0.97);
  filter: brightness(0.86);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.18);
}
.cta-primary:disabled,
.cta-primary[disabled] {
  opacity: 0.42;
  filter: grayscale(0.25) brightness(0.8);
  pointer-events: none;
  box-shadow: none;
}

/* 24-Hour Timeline — soft-glow ribbon segments */
.timeline-block {
  position: absolute;
  top: 22%;
  bottom: 22%;
  border-radius: 999px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease;
  cursor: pointer;
}

.timeline-block:hover {
  filter: brightness(1.18);
  transform: scaleY(1.08);
  z-index: 15;
}

.timeline-block-sleep {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.55) 0%, rgba(79, 70, 229, 0.88) 50%, rgba(49, 46, 129, 0.7) 100%);
  border: 1px solid rgba(165, 180, 252, 0.45);
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.timeline-block-light-seek {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.55) 0%, rgba(245, 158, 11, 0.92) 50%, rgba(217, 119, 6, 0.75) 100%);
  border: 1px solid rgba(253, 230, 138, 0.55);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.timeline-block-light-avoid {
  background: linear-gradient(90deg, rgba(136, 19, 55, 0.55) 0%, rgba(190, 24, 93, 0.82) 50%, rgba(76, 5, 25, 0.7) 100%);
  border: 1px solid rgba(251, 113, 133, 0.4);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.timeline-block-caffeine {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.55) 0%, rgba(217, 119, 6, 0.85) 50%, rgba(120, 53, 15, 0.7) 100%);
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.timeline-block-melatonin {
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.5) 0%, rgba(6, 182, 212, 0.85) 50%, rgba(22, 78, 99, 0.7) 100%);
  border: 1px solid rgba(103, 232, 249, 0.45);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.timeline-block-energy-dip {
  background: repeating-linear-gradient(
    45deg,
    rgba(244, 63, 94, 0.18),
    rgba(244, 63, 94, 0.18) 6px,
    rgba(244, 63, 94, 0.38) 6px,
    rgba(244, 63, 94, 0.38) 12px
  );
  border: 1px dashed rgba(244, 63, 94, 0.55);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.28);
}

/* Day Selector Strip Buttons */
.day-pill {
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.day-pill.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #090b10;
  font-weight: 800;
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* Glassmorphism Card Depth */
.glass-card {
  background: rgba(17, 21, 34, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Pulse animation for active navigation telemetry */
@keyframes bioPulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
  }
}

.bio-pulse-active {
  animation: bioPulse 3s infinite ease-in-out;
}

/* Keep long mono times and pills from blowing out 390px layouts */
#route-type-label,
#route-rate-label,
#telemetry-next-event,
#action-title,
#inspect-title {
  overflow-wrap: anywhere;
}

/* Keep live cursor + inspect labels readable on the taller uncropped track */
#timeline-live-cursor {
  overflow: visible;
}
#timeline-cursor-time {
  white-space: nowrap;
}