/* =========================
   Global Styles (Common)
   ========================= */

:root {
  --bg: #f6f7f4;
  --ink: #101412;
  --muted: #5d6360;
  --primary: #0b6a3c;
  --accent: #a4c639;
  --card: #ffffff;
  --soft: #e6eee6;
  --topbar: #0b3f26;
  --shadow: 0 20px 60px rgba(12, 38, 24, 0.15);
  --glass: rgba(255, 255, 255, 0.74);
}

* {
  box-sizing: border-box;
}

#topbarCurrencyLabel {
  background: none;
  border: none;
  color: inherit;
  text-decoration: none;
  background: var(--topbar);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: #f6f7f4;
}

.clickable {
  cursor: pointer;
}

/* Page Layout */
.page {
  /* max-width: 1440px; */
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 22px 64px;
}

/* Header & Nav */
.site-header {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 22px;
  border: 1px solid rgba(11, 106, 60, 0.14);
  background:
    radial-gradient(900px 240px at 8% -30%, rgba(164, 198, 57, 0.22), transparent 55%),
    radial-gradient(900px 240px at 110% 0%, rgba(11, 106, 60, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.98));
  box-shadow: 0 14px 40px rgba(12, 38, 24, 0.10);
  position: relative;
  z-index: 100;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 12px;
  /* background: #0b3f26; */
  background: var(--topbar);
  color: #e7efe8;
  border-radius: 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.topbar span {
  margin-right: 16px;
}

.logo {
  max-width: 100px;
  height: auto;
}

.site-nav {
  justify-self: end;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(11, 106, 60, 0.12);
  box-shadow: 0 10px 26px rgba(12, 38, 24, 0.08);
  backdrop-filter: blur(10px);
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  border-radius: 999px;
  border-bottom: 0;
  transition: background 180ms ease, transform 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.site-nav a:hover {
  background: rgba(11, 106, 60, 0.10);
  color: #0b3f26;
  transform: translateY(-1px);
}

/* .nav-home .site-nav a[href="index.html"],
.nav-about .site-nav a[href="about.html"],
.nav-services .site-nav a[href="services.html"],
.nav-blog .site-nav a[href="blog.html"],
.nav-contact .site-nav a[href="contact.html"] {
  background: rgba(11, 106, 60, 0.14);
  color: #0b3f26;
  box-shadow: inset 0 0 0 1px rgba(11, 106, 60, 0.16);
} */

.nav-active {
  background: rgba(11, 106, 60, 0.14);
  color: #0b3f26;
  box-shadow: inset 0 0 0 1px rgba(11, 106, 60, 0.16);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 4px;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  background: white;
  padding: 24px;
  border-radius: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.mobile-menu.active {
  display: block;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu a {
  text-decoration: none;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
}

/* Buttons */
.btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn.primary:hover {
  box-shadow: 0 18px 44px rgba(12, 38, 24, 0.18);
}

.btn.ghost {
  border-color: rgba(11, 106, 60, 0.24);
  color: #0b3f26;
  background: rgba(255, 255, 255, 0.86);
}

.full {
  width: 100%;
  margin-top: 16px;
}

/* Form Elements */
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d7e3d4;
  font-size: 14px;
}

/* Hide Edge/IE native password reveal button */
.field input[type="password"]::-ms-reveal,
.field input[type="password"]::-ms-clear {
  display: none;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(164, 198, 57, 0.30);
  border-color: rgba(11, 106, 60, 0.32);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Shared Components */
.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  font-family: var(--font-heading);
  margin: 0 0 8px;
}



/* Footer (User Provided) */
.site-footer {
  background: #0b3f26;
  color: #e7efe8;
  padding: 36px 24px 24px;
  border-radius: 24px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.footer-grid h4 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
  /* Keeping this? User CSS said: color: #e7efe8 (implied by container) but let's check user css */
  /* User CSS said: */
  /* .footer-grid h4 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.16em; } */
  /* It didn't specify color, so it inherits #e7efe8 from .site-footer */
  /* My previous styles had color: var(--primary). I should remove that to match user intent of dark footer. */
  color: inherit;
}

.footer-grid a,
.footer-grid p {
  color: #e7efe8;
  text-decoration: none;
  font-size: 14px;
  margin: 6px 0;
  display: block;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
  color: #e7efe8;
  /* Explicitly set color to match footer text */
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #fff;
  padding: 32px;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2);
  position: relative;
}

.close-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.auth-tab.active {
  border-color: var(--primary);
  color: var(--primary);
}


.auth-msg {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 1rem;
  font-size: 0.85rem;
}

.auth-msg>button {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  color: inherit;
}

.auth-msg>button:hover {
  transform: scale(1.25);
  /* font-size: 1.25rem; */
  transition: all 0.3s ease;
}

.authfail {
  color: #d93025;
  border: 2px solid #d93025;
}

.authsuccess {
  color: var(--primary);
  border: 2px solid var(--primary);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
  font-size: 13px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--muted);
}

.checkbox-label input {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  margin: 0;
}

.forgot-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 180ms ease;
}

.forgot-link:hover {
  text-decoration: underline;
  color: #0b3f26;
}

.auth-form h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
}

.auth-form p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Responsive Media Queries */
@media (max-width: 980px) {
  .site-header {
    /* Logo on left, space in middle, Actions on far right */
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 10px 20px;
  }

  .desktop-nav {
    display: none;
  }

  .header-actions {
    justify-self: end;
  }

  .menu-toggle {
    display: block;
    width: 44px;
    height: 44px;
    display: flex;
    /* Center icon */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(11, 106, 60, 0.05);
    /* Subtle touch target bg */
  }

  /* Mobile Profile Section (Shared for all mobile/tablet views) */
  .mobile-profile-section {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 16px;
    margin-top: 8px;
  }

  .mobile-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(11, 106, 60, 0.05);
    margin-bottom: 12px;
  }

  .mobile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(164, 198, 57, 0.4);
    object-fit: cover;
  }

  .mobile-user-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
  }

  .mobile-user-email {
    display: block;
    font-size: 12px;
    color: var(--muted);
    word-break: break-all; /* Prevent long emails from breaking layout */
  }

  .mobile-profile-section .btn {
    display: block;
    text-align: center;
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 8px;
  }

  .mobile-logout-btn {
    background: #d32f2f !important;
    border-color: #d32f2f !important;
    color: #fff !important;
  }

  /* Footer Responsiveness - Tablet */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 600px) {

  /* Global Page Polish */
  .page {
    /* More breathing room on edges */
    padding: 12px 20px 80px;
    /* Max width constraint for readability on larger phones */
    max-width: 100%;
  }

  /* Hide Top Bar - Too cluttered for mobile */
  .topbar {
    display: none;
  }

  /* Header Polish - Simplified */
  .site-header {
    /* Logo | Auto | Menu */
    grid-template-columns: auto 1fr auto;
    gap: 0;
    padding: 12px 16px;
    border-radius: 16px;
    /* Softer corners */
    margin-bottom: 24px;
    /* More space below header */
  }

  .logo {
    max-width: 120px;
    /* Decent size */
    height: auto;
  }

  /* Hide Header Actions on Mobile (Move to Menu) */
  .header-actions .btn {
    display: none;
    /* Hide 'Login' & 'Plan Trip' buttons in header */
  }

  .header-actions .profile-dropdown {
    display: none;
    /* Hide avatar dropdown on mobile — profile is in mobile menu */
  }

  .header-actions .menu-toggle {
    display: flex;
    /* Keep only menu toggle */
    margin-left: auto;
  }

  /* Mobile Profile Section moved to 980px range */

  /* Mobile Menu Polish */
  .mobile-menu {
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  .mobile-menu a {
    padding: 16px;
    /* Larger tap targets */
    font-size: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  }

  .mobile-menu a:last-child {
    border-bottom: none;
  }

  /* Footer Polish */
  .site-footer {
    padding: 40px 24px 32px;
    margin-top: 80px;
    /* Separation from content */
    border-radius: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    /* Distinct separation between blocks */
    text-align: center;
  }

  .footer-grid h4 {
    font-size: 13px;
    /* Refined hierarchy */
    letter-spacing: 0.2em;
    margin-bottom: 16px;
    opacity: 0.7;
    color: inherit;
  }

  .footer-grid a,
  .footer-grid p {
    font-size: 16px;
    /* Readable text */
    margin: 10px 0;
    opacity: 0.9;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding-top: 32px;
    opacity: 0.6;
    font-size: 12px;
  }

  /* Buttons Polish */
  .btn.primary {
    padding: 14px 24px;
    /* Maintain touch target size */
    font-size: 16px;
  }
}

/* =========================
   Profile Dropdown (Premium)
   ========================= */
.profile-dropdown {
  position: relative;
  display: inline-block;
  margin-right: 8px;
}

.avatar-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(164, 198, 57, 0.4);
  padding: 3px;
  cursor: pointer;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-btn:hover {
  border-color: var(--primary);
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 10px 25px rgba(164, 198, 57, 0.25);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 18px);
  right: -10px;
  width: 260px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(164, 198, 57, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-15px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 1000;
  overflow: hidden;
  padding: 12px;
}

.profile-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Dropdown Header */
.dropdown-header {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}

.dropdown-header .user-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.dropdown-header .user-email {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border-radius: 16px;
  transition: all 0.25s ease;
}

.dropdown-menu a svg {
  color: var(--primary);
  opacity: 0.9;
  transition: all 0.3s ease;
}

.dropdown-menu a:hover {
  background: rgba(164, 198, 57, 0.08);
  color: var(--primary);
  transform: translateX(8px);
}

.dropdown-menu a:hover svg {
  transform: scale(1.2) rotate(10deg);
}

.dropdown-menu .divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.05);
  margin: 12px 16px;
}

.dropdown-menu .logout-btn {
  color: #d32f2f !important;
}

.dropdown-menu .logout-btn svg {
  color: #d32f2f !important;
}

.dropdown-menu .logout-btn:hover {
  background: #fff5f5;
  color: #b71c1c !important;
}

/* Ensure display:none is respected even on mobile if set inline */
#loginBtn[style*="display: none"],
#mobileLoginBtn[style*="display: none"] {
  display: none !important;
}

/* =====================================================================
   Global Validation Toast UI
   ===================================================================== */
.val-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 360px;
  width: calc(100vw - 48px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.val-toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(211, 47, 47, 0.2);
  border-left: 4px solid #d32f2f;
  color: var(--ink);
  padding: 16px 20px;
  border-radius: 12px;
  font-family: inherit;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.val-toast.show {
  transform: translateX(0);
}

.val-toast.success {
  border-color: rgba(11, 106, 60, 0.3);
  border-left-color: var(--primary);
}

.val-toast-icon {
  flex-shrink: 0;
  color: #d32f2f;
  display: flex;
  align-items: center;
  padding-top: 2px;
}

.val-toast-content {
  flex: 1;
}

.val-toast-title {
  font-weight: 800;
  font-size: 14px;
  color: #d32f2f;
}

.val-toast.success .val-toast-icon {
  color: var(--primary);
}

.val-toast.success .val-toast-title {
  color: var(--primary);
}

.val-toast-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.val-toast-item {
  font-size: 13.5px;
  color: #555;
  line-height: 1.4;
  position: relative;
  padding-left: 12px;
}

.val-toast-item::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #888;
}

.val-toast-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.val-toast-close:hover {
  color: #111;
}