:root {
  /* -- Light Mode -- */
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-soft: #f1f5f9;
  --card-border: rgba(148, 163, 184, 0.25);
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.08);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --radius-lg: 1rem;
  --radius-pill: 999px;
  --header-glass: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] {
  /* -- Dark Mode -- */
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --bg-soft: #334155;
  --card-border: rgba(255, 255, 255, 0.08);
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.15);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --header-glass: rgba(15, 23, 42, 0.85);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: var(--bg); color: var(--text-main); line-height: 1.6; padding-bottom: 80px; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); transition: border-bottom-style 0.2s; }
a:hover { border-bottom-style: solid; }

/* HEADER */
.site-header { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: linear-gradient(to bottom, var(--header-glass), transparent); max-width: 900px; margin: 0 auto; padding: 0.8rem 1rem; }
.header-main { display: flex; align-items: center; justify-content: space-between; }
.brand h1 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }

#theme-toggle, #menu-toggle { appearance: none; border-radius: var(--radius-pill); border: 1px solid var(--card-border); width: 2.75rem; height: 2.75rem; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-elevated); cursor: pointer; color: var(--text-muted); box-shadow: var(--shadow-sm); transition: all 0.2s ease; padding: 0; margin: 0; position: relative; }
#theme-toggle:hover, #menu-toggle:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); transform: translateY(-1px); }

/* Menu Icon */
#menu-toggle { gap: 5px; } 
.menu-bar { width: 1.25rem; height: 2px; background: currentColor; border-radius: 4px; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; transform-origin: center; margin: 0; }
body.menu-open .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .menu-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.menu-open .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Theme Icons */
.theme-icon { position: absolute; font-size: 1.2rem; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.theme-icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); color: #f59e0b; }
.theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="dark"] .theme-icon-sun { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

/* Nav */
.nav-dropdown { display: none; position: absolute; top: 100%; right: 1rem; width: 200px; background: var(--bg-elevated); border: 1px solid var(--card-border); border-radius: var(--radius-lg); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); flex-direction: column; padding: 0.5rem; overflow: hidden; margin-top: 8px; }
body.menu-open .nav-dropdown { display: flex; animation: fadeIn 0.1s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.nav-item { background: none; border: none; text-align: left; padding: 0.8rem; color: var(--text-main); cursor: pointer; border-radius: 0.5rem; font-size: 0.95rem; font-weight: 500; transition: background 0.1s; width: 100%; }
.nav-item:hover { background: var(--bg-soft); color: var(--accent); }

/* LAYOUT */
.content { padding: 1rem; max-width: 900px; margin: 0 auto; }
.section-card { background: var(--bg-elevated); border-radius: var(--radius-lg); border: 1px solid var(--card-border); padding: 1.2rem; margin-bottom: 1rem; }
.section-card h2 { margin: 0 0 0.5rem; color: var(--accent); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.section-card h3 { margin: 1rem 0 0.3rem; font-size: 1rem; color: var(--text-main); }
.section-card ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.section-card li { margin-bottom: 0.4rem; font-size: 0.95rem; }
.summary-range { margin-top: 1rem; margin-bottom: 0.4rem; font-size: 0.95rem; font-weight: 700; color: var(--accent); border-bottom: 1px solid var(--card-border); padding-bottom: 0.3rem; }

/* CARDS */
.section-tagline { font-size: 0.9rem; color: var(--text-muted); font-style: italic; margin-bottom: 1rem; }
.card-group { margin-top: 1rem; border-top: 1px solid var(--card-border); }
.card-group:first-of-type { border-top: none; }
.group-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 0.8rem 0; user-select: none; }

/* CHEVRON ANIMATION (Used everywhere) */
.chevron { width: 0.6rem; height: 0.6rem; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: 0.2s; margin-top: 6px; }
details[open] .chevron { transform: rotate(225deg); }

.card-item { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1rem; padding: 0; background: transparent; }
.card-image { width: 100%; height: 180px; border-radius: 0.8rem; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--card-border); flex-shrink: 0; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-info { padding: 0 0.2rem; flex-grow: 1; }
.card-title { margin: 0; font-size: 1.1rem; }
.card-desc { font-size: 0.95rem; margin: 0.5rem 0; color: var(--text-main); }
.card-price { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.8rem; padding: 0.2rem 0.6rem; border-radius: 4px; margin-top: 0.4rem; }
.tiny-tag { background: var(--accent); color: white; padding: 1px 6px; border-radius: 4px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; margin-left: auto; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 0.3rem; }
.card-footer { display: flex; gap: 15px; font-size: 0.85rem; margin-top: 8px; align-items: center; }
.map-link { font-weight: 600; border: none; font-size: 0.8rem; }
@media (min-width: 600px) { .card-item { flex-direction: row; background: var(--bg-soft); padding: 1rem; border-radius: 0.8rem; } .card-image { width: 130px; height: 130px; } }

/* ITINERARY */
.day-card { background: var(--bg-elevated); border-radius: var(--radius-lg); border: 1px solid var(--card-border); margin-bottom: 0.8rem; overflow: hidden; transition: box-shadow 0.2s ease; }
.day-card.open { border-color: var(--accent); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.day-toggle { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; padding: 1rem; border: none; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.day-toggle-main { display: flex; flex-direction: column; gap: 0.3rem; }
.day-meta { display: flex; gap: 0.5rem; align-items: center; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; flex-wrap: wrap; }
.day-badge { background: var(--text-main); color: var(--bg); padding: 2px 6px; border-radius: 4px; }
.day-date { color: var(--text-muted); }
.day-location { color: var(--accent); }
.day-tag { padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; }
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-purple { background: #f3e8ff; color: #6b21a8; }
.tag-green { background: #dcfce7; color: #166534; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-gray { background: #f1f5f9; color: #475569; }

.day-title { font-size: 1.1rem; font-weight: 700; margin: 0; line-height: 1.3; }
.day-body { max-height: 0; overflow: hidden; padding: 0 1rem; transition: max-height 0.3s ease, padding 0.3s ease; }
.day-card.open .day-body { max-height: 9000px; padding-bottom: 1.2rem; border-top: 1px solid var(--card-border); }
.day-photo-wrapper { margin-top: 0.8rem; border-radius: 0.75rem; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--card-border); }
.day-photo-wrapper img { width: 100%; height: auto; display: block; }
.day-goal { background: var(--accent-soft); padding: 0.8rem; border-radius: 0.5rem; border-left: 3px solid var(--accent); margin: 1rem 0; font-size: 0.95rem; }
.time-heading { color: var(--accent); text-transform: uppercase; font-size: 0.85rem; margin-top: 1.2rem; font-weight: 700; }
.day-notes { margin-top: 1.5rem; padding: 1rem; background-color: var(--bg-soft); border: 1px solid var(--card-border); border-radius: 0.5rem; font-size: 0.9rem; }
.day-notes strong { display: block; margin-bottom: 0.5rem; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; color: var(--accent); }

/* FOOTER */
.page-footer { padding: 2rem 1rem; max-width: 900px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-toggle { background: none; border: none; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 0.9rem; }
#back-to-top { border-radius: var(--radius-pill); border: 1px solid var(--card-border); background: var(--bg-elevated); padding: 0.6rem 1.2rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; color: var(--text-main); box-shadow: var(--shadow-sm); transition: all 0.2s ease; }
#back-to-top:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.is-past { display: none !important; }
body.show-past .is-past { display: list-item !important; opacity: 0.6; }
body.show-past article.is-past { display: block !important; opacity: 0.6; }

/* ========================================= */
/* BOOKINGS WALLET STYLES (Cleaned & Collapsible) */
/* ========================================= */

.section-card-transparent {
  padding: 0 0.5rem;
  margin-bottom: 3rem;
  background: transparent;
  border: none;
}

.section-header-clean {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  padding-left: 0.5rem;
  color: var(--text-main);
}

/* Collapsible Details Container */
.booking-group-details {
  margin-bottom: 1.5rem;
  background: transparent;
}

.booking-group-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0.5rem;
  cursor: pointer;
  list-style: none; /* Hide default arrow */
}
.booking-group-summary::-webkit-details-marker { display: none; }

.booking-group-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

/* Stack Layout */
.wallet-stack {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .wallet-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

/* Individual Wallet Card */
.wallet-card {
  background: var(--bg-elevated);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  border: 1px solid var(--card-border);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wallet-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

/* Status Strip (Left Edge) */
.wallet-status-strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  z-index: 1;
}
.status-confirmed { background: #10b981; }
.status-pending   { background: #f59e0b; }
.status-cancelled { background: #ef4444; }

/* Card Content Area */
.wallet-content {
  padding: 1.2rem 1.2rem 1rem 1.4rem; /* Left pad accommodates strip */
  flex-grow: 1;
}

/* Header: Type and Status Text */
.wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.wallet-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.wallet-status-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}
.status-text-confirmed { color: #059669; }
.status-text-pending   { color: #d97706; }

/* Main Title Area (Fixed bunching) */
.wallet-body {
  margin-bottom: 0.5rem;
}

.wallet-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4; /* Better spacing */
  margin: 0;
}

/* Footer / Action Button */
.wallet-footer-btn {
  background: var(--bg-soft);
  border: none;
  border-top: 1px solid var(--card-border);
  padding: 0.8rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.2s;
  min-height: 3.5rem; /* Touch friendly target */
}

.wallet-footer-btn:hover {
  background: var(--card-border);
}

.ref-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ref-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.ref-code {
  font-family: 'SF Mono', 'Roboto Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.copy-icon-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.text-copied { display: none; }
.wallet-footer-btn.copied .text-copied { display: inline; }
.wallet-footer-btn.copied .icon-copy { display: none; }
.wallet-footer-btn.copied { background: #dcfce7; } /* Flash Green */
html[data-theme="dark"] .wallet-footer-btn.copied { background: #064e3b; }

/* =========================================
   MODERN BOOKINGS (Clean Card Style)
   ========================================= */

.bookings-section {
  padding: 0 0.5rem; /* Slight gutter on mobile */
  margin-bottom: 4rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  padding-left: 0.5rem;
}

/* Collapsible Group Header */
.booking-group {
  margin-bottom: 2rem;
}

.booking-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem 0.5rem;
  user-select: none;
  list-style: none;
  transition: opacity 0.2s;
}
.booking-group-header::-webkit-details-marker { display: none; }
.booking-group-header:hover { opacity: 0.7; }

.booking-group-header h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted); /* Muted gray for section headers */
  font-weight: 700;
  margin: 0;
}

/* Card Grid */
.booking-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .booking-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
  }
}

/* The Card Itself */
.booking-card {
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: 1rem; /* Modern rounded corners */
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.booking-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1);
  border-color: var(--card-border); /* Keep subtle */
}

/* Top half of card */
.booking-main {
  padding: 1.5rem;
  flex-grow: 1;
}

.booking-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.booking-type-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

/* Status Badges - Pill Shape */
.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  letter-spacing: 0.03em;
}

.status-confirmed { background: #d1fae5; color: #065f46; } /* Soft Green */
.status-pending   { background: #fef3c7; color: #92400e; } /* Soft Orange */
.status-cancelled { background: #fee2e2; color: #991b1b; } /* Soft Red */

/* Dark Mode Badge Adjustments */
html[data-theme="dark"] .status-confirmed { background: #064e3b; color: #6ee7b7; }
html[data-theme="dark"] .status-pending   { background: #78350f; color: #fcd34d; }

/* The Main Title (Hotel Name, etc) */
.booking-title {
  font-size: 1.35rem; /* Large and readable */
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  margin: 0;
}

/* The Action Button (Bottom) */
.booking-action-btn {
  width: 100%;
  border: none;
  background: var(--bg-soft); /* Distinct from card white */
  border-top: 1px solid var(--card-border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
  min-height: 60px; /* Accessible touch target */
}

.booking-action-btn:hover {
  background: var(--card-border);
}

.booking-action-btn:active {
  background: #e2e8f0; 
}

.btn-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.btn-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-code {
  font-family: 'SF Mono', 'Menlo', monospace; /* Monospace for clarity */
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.btn-icon {
  font-size: 1.2rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Copied State Animation */
.icon-success { display: none; }
.booking-action-btn.copied { background: #ecfdf5; } /* Flash Green */
html[data-theme="dark"] .booking-action-btn.copied { background: #064e3b; }

.booking-action-btn.copied .icon-default { display: none; }
.booking-action-btn.copied .icon-success { display: block; color: #059669; }
.booking-action-btn.copied .btn-code { color: #065f46; }

/* --- New Booking Styles --- */

/* Date Row Container */
.booking-dates {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-soft);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

.date-group {
  display: flex;
  flex-direction: column;
}

.date-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 700;
  margin-bottom: 2px;
}

.date-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.time-value {
  font-size: 0.8rem;
  color: var(--text-light);
}

.date-arrow {
  color: var(--border);
  font-weight: 300;
  font-size: 1.2rem;
  padding-bottom: 4px; /* Align visually */
}

/* Description Text */
.booking-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0;
}

/* =========================
   RAIN MODE LOGIC
   ========================= */

/* 1. THE TOGGLE BUTTON */
#rain-toggle {
  /* Same base style as theme toggle */
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-border);
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  transition: all 0.2s ease;
}

/* Icon Switching */
#rain-toggle .icon-rain { display: none; }
body.rain-mode #rain-toggle .icon-sun { display: none; }
body.rain-mode #rain-toggle .icon-rain { display: inline-block; }

/* Active State */
body.rain-mode #rain-toggle {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #3b82f6;
}
html[data-theme="dark"] body.rain-mode #rain-toggle {
  background: #1e3a8a;
  color: #60a5fa;
}

/* 2. THE CONTENT SWAP */

/* By default, hide the Rain Plan */
.rain-plan-item {
  display: none;
  margin-top: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: #eff6ff;
  border-radius: 0.5rem;
  color: #1d4ed8;
  font-size: 0.9rem;
  border-left: 3px solid #3b82f6;
  list-style: none;
}
html[data-theme="dark"] .rain-plan-item {
  background: #1e3a8a;
  color: #dbeafe;
}

/* WHEN RAIN MODE IS ON: */

/* A. Reveal the Rain Plan */
body.rain-mode .rain-plan-item {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* B. Cross out the Normal Activity (BUT ONLY if it has a rain plan!) */
body.rain-mode .has-rain-plan .act-main {
  text-decoration: line-through;
  opacity: 0.5;
}
