:root {
  /* Core Colors */
  --primary: #ff8a65;
  --primary-rgb: 255, 138, 101;

  /* Backgrounds */
  --background-light: #f8f5f5;
  --background-dark: #230f0f;

  /* Text */
  --text-main: #181116;
  --text-secondary: #88637f;
  --text-white: #ffffff;

  /* Status/Functional */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Gradients (used in profiles list) */
  --gradient-start: #fecdd3;
  --gradient-end: #a21caf;

  /* Decorative Blobs (Welcome Screen) */
  --blob-1: #ff8a65;
  --blob-2: #ff00ff;
  --blob-3: #8a2be2;

  /* Login Screen Gradients - Warm coral sunset palette */
  --login-gradient-start: #ffab91;
  --login-gradient-middle: #ff8a65;
  --login-gradient-end: #bf5f4a;

  /* Auth Button Gradient */
  --auth-btn-gradient-start: #ff8a65;
  --auth-btn-gradient-end: #e64a19;

  /* Header Mesh Gradient */
  --header-bg-base: #FFAB91;
  --mesh-orb-1: #FF8A65;
  --mesh-orb-2: #FF5252;
  --mesh-orb-3: #9C27B0;

  /* UI Elements */
  --input-bg: #f8f8f8;
  --accent: #e91cb6;

  /* Dark Mode Specifics */
  --surface-dark: #2a1a27;
  --input-bg-dark: #332330;
  --border-light: #e5dce3;
  --border-dark: #4a3a47;
  --text-gray: #333333;

  /* Calendar */
  --calendar-gradient-start: #ff8a65;
  --calendar-gradient-end: #492442;
  --period-day: #ff8a65;

  /* Settings */
  --settings-gradient-start: #ff8a65;
  --settings-gradient-middle: #e91cb5;
  --settings-gradient-end: #4a0d4a;
  --settings-gradient-start-dark: #4a0d4a;
  --settings-gradient-middle-dark: #9b1277;
  --settings-gradient-end-dark: #21111d;

  /* Forgot Password */
  --forgot-gradient-start: #ff8a65;
  --forgot-gradient-middle: #c71585;
  --forgot-gradient-end: #483d8b;

  /* Create Profile */
  --create-profile-gradient-start: #ff8a65;
  --create-profile-gradient-middle: #e91cb5;
  --create-profile-gradient-end: #4b0082;

  /* Change Password Gradient - Soft blush cloud */
  --change-pass-gradient-start: #fef7f5;
  --change-pass-gradient-middle: #fde8e4;
  --change-pass-gradient-end: #f8d7d0;

  /* Delete Dialog */
  --destructive: #d93f3f;
  --coral: #ff8a65;

  /* Onboarding Colors */
  --teal: #79d2de;
  --yellow: #fbc96e;
  --lavender: #c8b6ff;
  --charcoal: #333d4b;
  --charcoal-dark: #eaebf0;
  --card-light: #ffffff;
  --card-dark: #2d3748;
  --text-light: #2d3748;
  --text-dark: #e2e8f0;
  --text-secondary-light: #718096;
  --text-secondary-dark: #a0aec0;
}

/* Dark mode overrides if needed, though Tailwind handles class-based dark mode */
.dark {
  --text-main: #ffffff;
  --text-secondary: #9ca3af;
}

/* Navigation Colors */
.text-active-magenta {
  color: var(--accent);
}

.text-inactive-gray {
  color: #9ca3af;
}

/* ================================ */
/* LIQUID GLASS NAVIGATION          */
/* ================================ */

/* Navigation container - layered glass */
.nav-glass {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 -4px 24px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dark .nav-glass {
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 -4px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Navigation item base */
.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  flex: 1;
  padding: 0.5rem 0;
  color: #9ca3af;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

/* Hover glow effect */
.nav-item::before {
  content: '';
  position: absolute;
  inset: 0.25rem 0.5rem 0.25rem 0.5rem;
  border-radius: 1rem;
  background: radial-gradient(
    ellipse at center bottom,
    rgba(255, 255, 255, 0.5) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.25s ease-out;
  pointer-events: none;
}

.dark .nav-item::before {
  background: radial-gradient(
    ellipse at center bottom,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 70%
  );
}

.nav-item:hover {
  transform: translateY(-2px);
  color: #6b7280;
}

.dark .nav-item:hover {
  color: #d1d5db;
}

.nav-item:hover::before {
  opacity: 1;
}

.nav-item:active {
  transform: scale(0.92) translateY(0);
}

/* Active state styling */
.nav-item-active {
  color: #374151;
}

.dark .nav-item-active {
  color: #ffffff;
}

.nav-item-active:hover {
  color: #374151;
  transform: none;
}

.dark .nav-item-active:hover {
  color: #ffffff;
}

.nav-item-active::before {
  display: none;
}

/* Active glow layer */
.nav-active-glow {
  position: absolute;
  inset: -0.25rem 0.25rem 0.25rem 0.25rem;
  border-radius: 1.25rem;
  background: rgba(244, 63, 94, 0.12);
  filter: blur(12px);
  opacity: 0.9;
  pointer-events: none;
}

.dark .nav-active-glow {
  background: rgba(244, 63, 94, 0.1);
  opacity: 0.9;
}

/* Active pill surface */
.nav-active-pill {
  position: absolute;
  inset: 0 0.375rem 0.25rem 0.375rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(244, 63, 94, 0.15);
  box-shadow:
    0 4px 12px rgba(244, 63, 94, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.dark .nav-active-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  box-shadow:
    0 4px 16px rgba(244, 63, 94, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Ripple animation */
.nav-ripple {
  position: absolute;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: nav-ripple-expand 0.5s ease-out forwards;
  pointer-events: none;
}

.dark .nav-ripple {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
}

@keyframes nav-ripple-expand {
  to {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* Safe area spacer */
.nav-safe-area {
  height: 1.25rem;
}

/* Nav item icon hover scale */
.nav-item .nav-icon {
  transition: transform 0.2s ease-out;
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
}

.nav-item-active .nav-icon {
  transform: none;
}

/* Ambient glow above navigation */
.nav-ambient-glow {
  position: absolute;
  inset: -1rem 0 auto 0;
  height: 2rem;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 100%
  );
  filter: blur(16px);
  pointer-events: none;
}

.dark .nav-ambient-glow {
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 100%
  );
}

/* Collapsible sections */
.cycle-inputs {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
}

.cycle-inputs.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

/* Toggle Switch Component */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.3s;
  border-radius: 9999px;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(18px);
}

.dark .toggle-switch .slider {
  background-color: #4b5563;
}

.dark .toggle-switch input:checked + .slider {
  background-color: var(--primary);
}

/* Date input collapsible (add_annotation_dialog) */
.date-input-container {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 0;
}

.date-input-container.expanded {
  max-height: 300px;
  opacity: 1;
  padding-bottom: 1rem;
  overflow: visible;
}

/* Reminder input collapsible */
.reminder-container {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
  margin-top: 0;
}

.reminder-container.expanded {
  max-height: 80px;
  opacity: 1;
  margin-top: 0.75rem;
}

/* ================================ */
/* ANIMATED ACCORDION (details)     */
/* ================================ */

/* Content wrapper using CSS grid for smooth height transitions */
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease-out;
}

details[open] .accordion-content {
  grid-template-rows: 1fr;
  opacity: 1;
}

/* Override for closing animation - keeps content visible while collapsing */
details[open].closing .accordion-content {
  grid-template-rows: 0fr;
  opacity: 0;
}

/* Inner wrapper must have overflow hidden and min-height 0 for grid trick to work */
.accordion-content-inner {
  overflow: hidden;
  min-height: 0;
}
