/* ==========================================================================
   Senior Trip Itinerary - styles.css
   Caribbean / Adventure / Celebration Aesthetic
   Mobile-first, light/dark theme, print-ready
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN SYSTEM - CSS Custom Properties
   -------------------------------------------------------------------------- */

:root {
  /* Color Palette - Light Theme */
  --color-primary:    #FF6B35;
  --color-secondary:  #1A936F;
  --color-accent:     #F7C59F;
  --color-bg:         #FFFBF5;
  --color-surface:    #FFFFFF;
  --color-text:       #1A1A2E;
  --color-muted:      #666680;
  --color-border:     #E8E0D5;

  /* Badge Colors */
  --badge-travel:       #3B82F6;
  --badge-food:         #FF6B35;
  --badge-adventure:    #1A936F;
  --badge-culture:      #7C3AED;
  --badge-entertainment:#DB2777;
  --badge-free-time:    #0D9488;
  --badge-formal:       #B45309;
  --badge-nature:       #166534;
  --badge-departure:    #6B7280;

  /* Spacing - 8px base */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg:  0 10px 30px rgba(0, 0, 0, 0.14), 0 4px 10px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 12px 36px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.10);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Header height (used for sticky offset calculations) */
  --header-height: 64px;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --color-bg:      #0D1117;
  --color-surface: #161B22;
  --color-text:    #E6EDF3;
  --color-muted:   #8B949E;
  --color-border:  #30363D;

  /* Slightly brighter primary/secondary for dark bg readability */
  --color-primary:   #FF7A4A;
  --color-secondary: #22B584;

  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.30), 0 1px 2px rgba(0, 0, 0, 0.20);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.40), 0 2px 6px rgba(0, 0, 0, 0.20);
  --shadow-lg:  0 10px 30px rgba(0, 0, 0, 0.50), 0 4px 10px rgba(0, 0, 0, 0.30);
  --shadow-card-hover: 0 12px 36px rgba(0, 0, 0, 0.60), 0 4px 12px rgba(0, 0, 0, 0.40);
}

/* --------------------------------------------------------------------------
   2. RESETS & BASE STYLES
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  opacity: 0.85;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  line-height: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  line-height: 1.25;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */

.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-2);
}

@media (min-width: 600px) {
  .container {
    padding-inline: var(--space-3);
  }
}

@media (min-width: 900px) {
  .container {
    padding-inline: var(--space-4);
  }
}

/* --------------------------------------------------------------------------
   4. HEADER
   -------------------------------------------------------------------------- */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: rgba(255, 251, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
}

[data-theme="dark"] header {
  background-color: rgba(13, 17, 23, 0.85);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-2);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-primary);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. THEME TOGGLE & ICON BUTTONS
   -------------------------------------------------------------------------- */

#theme-toggle,
#share-btn,
#settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.1rem;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

#theme-toggle:hover,
#share-btn:hover,
#settings-btn:hover {
  background-color: var(--color-accent);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: scale(1.08);
}

#share-btn,
#settings-btn {
  width: auto;
  padding-inline: var(--space-2);
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}

#share-btn {
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}

#settings-btn {
  color: var(--color-text);
  border-color: var(--color-border);
}

#share-btn:hover {
  background-color: var(--color-secondary);
  color: #fff;
}

#settings-btn:hover {
  background-color: var(--color-accent);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   6. HERO
   -------------------------------------------------------------------------- */

#hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary) 0%, #FF9A5C 35%, #2AA87D 70%, var(--color-secondary) 100%);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-5) var(--space-3);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 3rem);
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: var(--space-1);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: var(--space-3);
  font-weight: 400;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
}

/* Hero Countdown - Glassmorphism */
#hero-countdown {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-2) var(--space-3);
  color: #ffffff;
  font-weight: 600;
  font-size: clamp(0.85rem, 2vw, 1rem);
  margin-top: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.countdown-value {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1;
  font-family: 'Poppins', sans-serif;
}

.countdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.countdown-sep {
  font-size: 1.5rem;
  font-weight: 700;
  opacity: 0.7;
  align-self: flex-start;
  margin-top: 4px;
}

/* Hero Floating Shapes */
.hero-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.hero-shape-1 {
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.08);
  top: -80px;
  right: -60px;
}

.hero-shape-2 {
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.06);
  bottom: -60px;
  left: 5%;
}

.hero-shape-3 {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.10);
  top: 20px;
  left: 15%;
}

/* --------------------------------------------------------------------------
   7. DAY CHIPS NAV
   -------------------------------------------------------------------------- */

#day-chips-wrapper {
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  background-color: rgba(255, 251, 245, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
}

[data-theme="dark"] #day-chips-wrapper {
  background-color: rgba(13, 17, 23, 0.9);
}

#day-chips {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#day-chips::-webkit-scrollbar {
  display: none;
}

.day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  user-select: none;
}

.day-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.day-chip.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.35);
}

.day-chip.active:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.45);
}

/* --------------------------------------------------------------------------
   8. MAIN GRID
   -------------------------------------------------------------------------- */

#main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

@media (min-width: 900px) {
  #main-grid {
    grid-template-columns: 3fr 2fr;
    align-items: start;
  }
}

/* --------------------------------------------------------------------------
   9. SECTION HEADINGS
   -------------------------------------------------------------------------- */

.section-heading {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* --------------------------------------------------------------------------
   10. DAY SECTIONS & CARDS
   -------------------------------------------------------------------------- */

.day-section {
  margin-bottom: var(--space-5);
  scroll-margin-top: calc(var(--header-height) + 52px);
}

.day-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
  /* Stagger-in via JS-set --delay */
  opacity: 1;
}

/* Per-day left border accents via nth-child */
.day-section:nth-child(1)  .day-card { border-left: 4px solid #FF6B35; }
.day-section:nth-child(2)  .day-card { border-left: 4px solid #1A936F; }
.day-section:nth-child(3)  .day-card { border-left: 4px solid #3B82F6; }
.day-section:nth-child(4)  .day-card { border-left: 4px solid #7C3AED; }
.day-section:nth-child(5)  .day-card { border-left: 4px solid #DB2777; }
.day-section:nth-child(6)  .day-card { border-left: 4px solid #0D9488; }
.day-section:nth-child(7)  .day-card { border-left: 4px solid #B45309; }
.day-section:nth-child(8)  .day-card { border-left: 4px solid #166534; }
.day-section:nth-child(9)  .day-card { border-left: 4px solid #6B7280; }
.day-section:nth-child(10) .day-card { border-left: 4px solid #FF6B35; }

/* data-day-accent attribute override */
.day-card[data-day-accent] {
  border-left-color: attr(data-day-accent color, var(--color-primary));
}

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(to right, rgba(255, 107, 53, 0.05), transparent);
  border-bottom: 1px solid var(--color-border);
}

.day-label {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.day-label span {
  color: var(--color-primary);
}

.day-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   11. BADGES
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.5;
  color: #fff;
}

.badge-travel       { background-color: var(--badge-travel); }
.badge-food         { background-color: var(--badge-food); }
.badge-adventure    { background-color: var(--badge-adventure); }
.badge-culture      { background-color: var(--badge-culture); }
.badge-entertainment { background-color: var(--badge-entertainment); }
.badge-free-time    { background-color: var(--badge-free-time); }
.badge-formal       { background-color: var(--badge-formal); }
.badge-nature       { background-color: var(--badge-nature); }
.badge-departure    { background-color: var(--badge-departure); }

/* --------------------------------------------------------------------------
   12. ACTIVITY LIST
   -------------------------------------------------------------------------- */

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: 12px var(--space-3);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background-color: rgba(255, 107, 53, 0.04);
}

.activity-item.tbd {
  opacity: 0.6;
  font-style: italic;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(0,0,0,0.015) 10px,
    rgba(0,0,0,0.015) 20px
  );
}

.activity-icon {
  min-width: 24px;
  font-size: 1.1rem;
  line-height: 1.5;
  flex-shrink: 0;
  text-align: center;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.activity-note {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.5;
}

.cost-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background-color: var(--color-secondary);
  color: #ffffff;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   13. OPTIONS LIST (Free Day sub-list)
   -------------------------------------------------------------------------- */

.options-list {
  list-style: none;
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background-color: rgba(247, 197, 159, 0.12);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 107, 53, 0.15);
}

[data-theme="dark"] .options-list {
  background-color: rgba(247, 197, 159, 0.06);
  border-color: rgba(255, 107, 53, 0.20);
}

.options-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-block: 6px;
  font-size: 0.875rem;
  color: var(--color-text);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .options-list li {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.options-list li:last-child {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   14. LINK BUTTON (Booking CTA)
   -------------------------------------------------------------------------- */

.link-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #ffffff !important;
  border-radius: var(--radius-md);
  padding: 8px 20px;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    filter var(--transition-base);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.30);
  margin-top: var(--space-1);
}

.link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.45);
  filter: brightness(1.06);
  opacity: 1;
}

.link-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.25);
}

/* --------------------------------------------------------------------------
   15. BUDGET SECTION
   -------------------------------------------------------------------------- */

#budget {
  scroll-margin-top: calc(var(--header-height) + 52px);
}

.budget-card,
.checklist-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
}

#budget-known-list,
#budget-range-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2) 0;
}

#budget-known-list li,
#budget-range-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  gap: var(--space-2);
}

#budget-known-list li:last-child,
#budget-range-list li:last-child {
  border-bottom: none;
}

.budget-item-label {
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.budget-item-amount {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.budget-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  border-top: 2px solid var(--color-border);
  font-weight: 700;
  font-size: 1rem;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.budget-total-amount {
  font-size: 1.25rem;
  color: var(--color-primary);
}

/* Budget Bar */
#budget-bar {
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  background-color: var(--color-border);
  margin-block: var(--space-2);
}

.budget-bar-segment {
  height: 100%;
  transition: width var(--transition-slow);
  min-width: 2px;
}

.budget-bar-segment[data-category="transport"] { background-color: var(--badge-travel); }
.budget-bar-segment[data-category="food"]      { background-color: var(--badge-food); }
.budget-bar-segment[data-category="activities"]{ background-color: var(--badge-adventure); }
.budget-bar-segment[data-category="formal"]    { background-color: var(--badge-formal); }
.budget-bar-segment[data-category="other"]     { background-color: var(--badge-departure); }

/* Budget Bar Legend */
.budget-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.budget-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.budget-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   16. CHECKLIST
   -------------------------------------------------------------------------- */

#checklist {
  scroll-margin-top: calc(var(--header-height) + 52px);
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding-block: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
  border-radius: var(--radius-sm);
  padding-inline: 4px;
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item:hover {
  background-color: rgba(255, 107, 53, 0.04);
}

/* Visually hidden native checkbox */
.checklist-item input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom checkbox */
.checklist-item .custom-checkbox {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  background: var(--color-surface);
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.checklist-item.checked .custom-checkbox {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.checklist-item.checked .custom-checkbox::after {
  content: '✓';
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.checklist-item label {
  flex: 1;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text);
  transition: color var(--transition-fast), text-decoration var(--transition-fast);
}

.checklist-item.checked label {
  text-decoration: line-through;
  color: var(--color-muted);
}

#reset-checklist {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-2);
  padding: 8px 16px;
  border: 1.5px solid #EF4444;
  border-radius: var(--radius-md);
  background: transparent;
  color: #EF4444;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

#reset-checklist:hover {
  background-color: #EF4444;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* --------------------------------------------------------------------------
   17. SETTINGS MODAL
   -------------------------------------------------------------------------- */

#settings-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  padding: var(--space-2);
}

#settings-modal.hidden {
  display: none;
}

.modal-panel {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
}

.modal-close-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--color-muted);
  cursor: pointer;
  line-height: 1;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.modal-close-btn:hover {
  background-color: var(--color-border);
  color: var(--color-text);
}

.modal-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  padding-right: var(--space-4);
}

/* Form within modal */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-2);
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

input[type="date"],
input[type="text"],
input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 10px var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-slow);
  appearance: none;
  -webkit-appearance: none;
}

input[type="date"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.18);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px var(--space-3);
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn-primary:hover {
  background-color: #e85d2a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.40);
}

/* --------------------------------------------------------------------------
   18. REMINDERS SECTION
   -------------------------------------------------------------------------- */

#reminders {
  scroll-margin-top: calc(var(--header-height) + 52px);
}

.reminder-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
}

.reminders-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reminders-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  padding-block: 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
}

.reminders-list li:last-child {
  border-bottom: none;
}

/* Boundaries Callout - Amber */
.boundaries-callout {
  background-color: rgba(255, 149, 0, 0.08);
  border-left: 4px solid #FF9500;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
}

[data-theme="dark"] .boundaries-callout {
  background-color: rgba(255, 149, 0, 0.12);
}

.boundaries-callout-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #CC7700;
  margin-bottom: 4px;
  font-size: 0.9375rem;
}

[data-theme="dark"] .boundaries-callout-title {
  color: #FFAD33;
}

/* --------------------------------------------------------------------------
   19. SIDEBAR / STICKY PANEL
   -------------------------------------------------------------------------- */

#sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 900px) {
  #sidebar {
    position: sticky;
    top: calc(var(--header-height) + 56px);
    max-height: calc(100vh - var(--header-height) - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
  }
}

/* --------------------------------------------------------------------------
   20. FOOTER
   -------------------------------------------------------------------------- */

footer {
  text-align: center;
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.875rem;
  margin-top: var(--space-5);
  transition: border-color var(--transition-slow), color var(--transition-slow);
}

.footer-muted {
  font-size: 0.75rem;
  opacity: 0.7;
  display: block;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   21. ANIMATIONS
   All within @media (prefers-reduced-motion: no-preference)
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  /* Float - hero shapes */
  @keyframes float {
    0%,
    100% { transform: translateY(0px); }
    50%  { transform: translateY(-15px); }
  }

  .hero-shape-1 {
    animation: float 6s ease-in-out infinite;
  }

  .hero-shape-2 {
    animation: float 8s ease-in-out infinite;
    animation-delay: 3s;
  }

  .hero-shape-3 {
    animation: float 7s ease-in-out infinite;
    animation-delay: 1.5s;
  }

  /* Slide Up - modal */
  @keyframes slideUp {
    from {
      transform: translateY(30px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .modal-panel {
    animation: slideUp 0.3s ease both;
  }

  /* Fade In */
  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* Stagger In - day cards */
  @keyframes staggerIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .day-card[style*="--delay"] {
    animation: staggerIn 0.5s ease both;
    animation-delay: var(--delay, 0s);
  }

  /* Card Hover Lift */
  .day-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
  }

  /* Countdown tick */
  @keyframes tickFade {
    0%   { opacity: 0.5; transform: translateY(-4px); }
    100% { opacity: 1;   transform: translateY(0); }
  }

  .countdown-value {
    animation: tickFade 0.3s ease;
  }
}

/* When reduced motion IS preferred, disable transitions too */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   22. RESPONSIVE - MOBILE (<600px)
   -------------------------------------------------------------------------- */

@media (max-width: 599px) {
  :root {
    --header-height: 56px;
  }

  .header-brand {
    font-size: 0.9rem;
  }

  #hero {
    min-height: 220px;
    padding: var(--space-4) var(--space-2);
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.875rem;
  }

  #hero-countdown {
    padding: var(--space-1) var(--space-2);
    gap: var(--space-1);
    font-size: 0.8rem;
  }

  .countdown-value {
    font-size: 1.25rem;
  }

  #day-chips {
    gap: 6px;
    padding: 6px var(--space-2);
  }

  .day-chip {
    padding: 4px 12px;
    font-size: 0.75rem;
  }

  .day-card-header {
    padding: var(--space-2);
    flex-direction: column;
    align-items: flex-start;
  }

  .activity-item {
    padding: 10px var(--space-2);
  }

  .budget-card,
  .checklist-card,
  .reminder-card {
    padding: var(--space-2);
  }
}

/* --------------------------------------------------------------------------
   23. RESPONSIVE - TABLET (600–899px)
   -------------------------------------------------------------------------- */

@media (min-width: 600px) and (max-width: 899px) {
  .day-card-header {
    flex-wrap: nowrap;
  }

  #day-chips {
    padding: var(--space-1) var(--space-3);
  }
}

/* --------------------------------------------------------------------------
   24. RESPONSIVE - DESKTOP (≥900px) - already handled in section 8
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   25. PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {
  /* Reset theme to light for print */
  :root,
  [data-theme="dark"] {
    --color-bg:      #ffffff;
    --color-surface: #ffffff;
    --color-text:    #000000;
    --color-muted:   #555555;
    --color-border:  #cccccc;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  /* Hide non-print elements */
  #day-chips-wrapper,
  header,
  #theme-toggle,
  #share-btn,
  #settings-btn,
  footer,
  #settings-modal,
  .hero-shape,
  #hero-countdown,
  .link-btn,
  #reset-checklist {
    display: none !important;
  }

  /* Hero - minimal */
  #hero {
    min-height: auto !important;
    background: #ffffff !important;
    padding: 12pt 0 !important;
    border-bottom: 2pt solid #000000;
  }

  .hero-title {
    color: #000000 !important;
    text-shadow: none !important;
    font-size: 20pt;
  }

  .hero-subtitle {
    color: #333333 !important;
    text-shadow: none !important;
  }

  /* Full one-column layout for print */
  #main-grid {
    display: block !important;
    padding-block: 0 !important;
  }

  #sidebar {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Day cards - page breaks */
  .day-card {
    break-after: page;
    box-shadow: none !important;
    border: 1pt solid #cccccc !important;
    border-left: 3pt solid #000000 !important;
    border-radius: 0 !important;
  }

  .day-section:last-child .day-card {
    break-after: avoid;
  }

  /* Show full URLs after link buttons */
  .link-btn::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555555;
    font-weight: 400;
  }

  /* Restore link-btn visibility for URL display in print */
  .link-btn {
    display: inline !important;
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Remove card hover transforms */
  .day-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* Remove shadows everywhere */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Budget & checklist - no page break inside */
  .budget-card,
  .checklist-card,
  .reminder-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1pt solid #cccccc !important;
  }

  #budget-bar {
    display: none;
  }

  /* Chips wrapper already hidden, but ensure day sections all visible */
  .day-section {
    display: block !important;
  }

  a[href]::after {
    content: none;
  }

  /* Override generic link rule for link-btn specifically */
  .link-btn[href]::after {
    content: " (" attr(href) ")";
  }
}

/* --------------------------------------------------------------------------
   25b. MISSING CSS FOR JS-RENDERED ELEMENTS
   -------------------------------------------------------------------------- */

/* TBD badge in activity items */
.tbd-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background-color: var(--color-muted);
  color: #ffffff;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-style: normal;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

/* Activity title span (JS-rendered) */
.activity-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9375rem;
  flex: 1;
  min-width: 0;
}

/* Options label */
.options-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-top: var(--space-1);
  margin-bottom: 4px;
}

/* Budget bar label */
.budget-bar-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
}

/* Countdown grid layout */
.countdown-grid {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

/* Countdown status messages */
.countdown-prompt,
.countdown-active,
.countdown-done,
.countdown-soon {
  font-size: clamp(0.875rem, 2vw, 1.05rem);
  font-weight: 600;
  color: #ffffff;
}

.countdown-active strong {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   26. AUTH GATE
   -------------------------------------------------------------------------- */

#auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FF6B35 0%, #FF9A5C 35%, #2AA87D 70%, #1A936F 100%);
  padding: var(--space-2);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#auth-gate.auth-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#auth-gate.auth-success .auth-gate-card {
  transform: scale(0.95);
  opacity: 0.5;
}

.auth-gate-card {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-4);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.auth-gate-icon {
  font-size: 3rem;
  margin-bottom: var(--space-2);
  line-height: 1;
}

#auth-gate-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  color: #ffffff;
  margin-bottom: var(--space-1);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.auth-gate-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin-bottom: var(--space-3);
}

.auth-input-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

#auth-password {
  width: 100%;
  padding: 12px var(--space-2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

#auth-password::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#auth-password:focus {
  outline: none;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
}

#auth-gate .btn-primary {
  width: 100%;
  padding: 12px var(--space-3);
  font-size: 1rem;
  background-color: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

#auth-gate .btn-primary:hover {
  background-color: rgba(255, 255, 255, 0.35);
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.auth-error {
  color: #ffe0e0;
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 1.4em;
  margin-top: var(--space-1);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Shake animation for wrong password */
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  15%      { transform: translateX(-8px); }
  30%      { transform: translateX(8px); }
  45%      { transform: translateX(-6px); }
  60%      { transform: translateX(6px); }
  75%      { transform: translateX(-3px); }
  90%      { transform: translateX(3px); }
}

#auth-gate.auth-shake .auth-gate-card {
  animation: authShake 0.5s ease;
}

/* App shell hidden until auth */
.app-hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   27. SKIP LINK (Accessibility)
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-2);
  background: var(--color-primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  z-index: 200;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-1);
}

/* --------------------------------------------------------------------------
   28. CHECKLIST PROGRESS
   -------------------------------------------------------------------------- */

.checklist-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.checklist-heading-row .section-heading {
  margin-bottom: 0;
}

.checklist-progress {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background-color: rgba(255, 107, 53, 0.1);
  color: var(--color-primary);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

[data-theme="dark"] .checklist-progress {
  background-color: rgba(255, 122, 74, 0.15);
}

/* --------------------------------------------------------------------------
   29. BUDGET BAR TOOLTIP
   -------------------------------------------------------------------------- */

.budget-bar-segment {
  position: relative;
  cursor: default;
}

.budget-bar-segment:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: var(--color-bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   30. ENHANCED CHECKBOX ANIMATION
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .checklist-item.checked .custom-checkbox {
    animation: checkBounce 0.3s ease;
  }

  @keyframes checkBounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
  }
}

/* --------------------------------------------------------------------------
   31. DAY CHIPS SCROLL HINT
   -------------------------------------------------------------------------- */

#day-chips-wrapper .container {
  position: relative;
}

#day-chips-wrapper .container::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, rgba(255, 251, 245, 0.9));
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] #day-chips-wrapper .container::after {
  background: linear-gradient(to right, transparent, rgba(13, 17, 23, 0.9));
}

/* --------------------------------------------------------------------------
   PRINT: Hide auth gate
   -------------------------------------------------------------------------- */

@media print {
  #auth-gate,
  .skip-link {
    display: none !important;
  }

  .app-hidden {
    display: block !important;
  }
}

/* --------------------------------------------------------------------------
   MOBILE: Auth gate adjustments
   -------------------------------------------------------------------------- */

@media (max-width: 599px) {
  .auth-gate-card {
    padding: var(--space-4) var(--space-3);
  }

  .auth-gate-icon {
    font-size: 2.5rem;
  }

  #auth-gate-title {
    font-size: 1.3rem;
  }

  .auth-gate-subtitle {
    font-size: 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   End of styles.css
   ========================================================================== */
