/* =========================
   GLOBAL / RESET
   ========================= */
* {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f7fb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Form elements */
input,
select,
textarea {
  font-size: 16px;
}

/* Prevent background scroll when mobile menu is open */
body.menu-open {
  overflow: hidden;
  height: 100vh;
}

/* =========================
   HEADER / NAV
   ========================= */
.topbar {
  background: #0d6efd;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-links {
  display: flex;
  gap: 0; /* remove gap */
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links > a,
.nav-links > .dropdown {
  padding: 0;
  margin: 0;
}

.nav-links > a,
.nav-links .dropdown-toggle {
  padding: 0 14px;
}

.nav-links .dropdown {
  margin: 0 !important;
}

/* Make desktop account dropdown open to the left */
#accountDropdown {
  position: relative;
}

#accountDropdown .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  min-width: 220px;
  z-index: 2000;
}

#accountDropdown .dropdown-item {
  color: black !important;
}

#accountDropdown .dropdown-item:hover {
  background-color: #f0f0f0;
  color: black !important;
}

#accountDropdown button#desktopSignOutBtn {
  width: 100%;
}

/* =========================
   MOBILE MENU (existing)
   ========================= */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background: #0d6efd;
  transition: 0.3s;
  z-index: 1100;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px;
}

.mobile-menu a {
  display: flex;               /* flex container */
  flex-direction: row;          /* ensure row layout */
  align-items: center;          /* vertical center */
  gap: 10px;                    /* space between icon and text */
  padding: 14px 18px;
  color: white;
  text-decoration: none;
  font-size: 16px;
  line-height: 1;               /* prevents extra height from text */
  white-space: nowrap;          /* prevents wrapping onto next line */
}

.mobile-menu a i {
  display: inline-flex;         /* ensure icon behaves as flex item */
  align-items: center;
  justify-content: center;
  width: 20px;                  /* fixed width to align all icons */
  min-width: 20px;              /* prevents stacking */
  font-size: 16px;              /* match text size */
  line-height: 1;
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Remove bullets from mobile menu lists */
.mobile-menu ul,
.mobile-menu li {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Mobile login/sign-out button */
.mobile-login-btn.btn-dark,
.mobile-login-btn.btn-dark:hover,
.mobile-login-btn.btn-dark:focus,
.mobile-login-btn.btn-dark:active {
  background-color: #000 !important;
  border-color: #000 !important;
  color: #fff !important;
}

.mobile-login-btn.btn-dark:hover {
  background-color: #111 !important;
}

/* Mobile Account dropdown */
#mobileAccountDropdown {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Toggle button */
.mobile-account-btn {
  background: none;
  border: none;
  color: white;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.mobile-account-btn .arrow {
  transition: transform 0.2s ease;
}

.mobile-account-btn.expanded .arrow {
  transform: rotate(90deg);
}

/* =========================
   MOBILE ACCOUNT SUBMENU LINKS
   ========================= */
/* Mobile Account submenu */
#mobileAccountMenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

#mobileAccountMenu.expanded {
  display: block;
}

/* Submenu links */
#mobileAccountMenu li a {
  display: flex;
  align-items: center;
  gap: 10px;

  color: white;
  text-decoration: none;

  padding: 14px 18px;       /* same vertical padding */
  padding-left: 36px;       /* 👈 indent ENTIRE row (icon + text) */

  transition: background 0.2s;
}

#mobileAccountMenu li a:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
  color: white;
}

/* Icon spacing stays normal */
#mobileAccountMenu li a i {
  margin-right: 6px;
}

/* =========================
   MOBILE MENU CLOSE ICON
   ========================= */
.mobile-menu-header i#closeMenu {
  color: white;
  font-size: 22px;
  cursor: pointer;
}


/* =========================
   MOBILE NAV BUTTONS (Sign Out / Log In)

   /* Mobile auth buttons (Log In / Sign Out) */
#loginMobileBtn,
#signOutMobileBtn {
  display: block;
  width: auto;                 /* NOT full width */
  margin: 12px 18px 0;         /* spacing from menu edges */
  padding: 10px 18px;          /* horizontal + vertical padding */
  text-align: center;          /* center the text */
  border-radius: 6px;
}

#loginMobileBtn:hover {
  background-color: #111 !important;
}

#mobileAccountDropdown > #signOutMobileBtn,
#mobileAccountDropdown > #loginMobileBtn {
  display: block;           /* make buttons block elements */
  width: calc(100% - 36px); /* full width minus left/right padding */
  margin: 10px 18px 0 18px; /* top margin 10px, left/right 18px */
  padding: 12px;            /* top/bottom 12px, left/right automatically from margin */
  text-align: left;         /* align text to left */
  border-radius: 6px;
  box-sizing: border-box;   /* include padding in width */
  font-size: 16px;
  text-align: center;
}

#mobileAccountDropdown > #signOutMobileBtn:hover,
#mobileAccountDropdown > #loginMobileBtn:hover {
  background-color: #111 !important;
}

/* Mobile account toggle styled like links but denoting dropdown */
#mobileAccountToggle {
  display: flex;
  flex-direction: row;       /* horizontal layout */
  align-items: center;       /* vertically center icon + text */
  justify-content: space-between; /* push arrow to right */
  gap: 10px;                 /* space between icon and text */
  padding: 14px 18px;        /* same as <a> links */
  font-size: 16px;           /* same as <a> links */
  line-height: 1;            /* remove extra height */
  background: none;
  border: none;
  color: white;
  width: 100%;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;    /* include padding in height */
}
#mobileAccountToggle:hover {
  background: rgba(255, 255, 255, 0.15); /* match hover of links */
}

#mobileAccountToggle .arrow {
  margin-left: auto;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

/* Optional: when expanded, same background as link hover */
#mobileAccountToggle.expanded {
  background: rgba(255, 255, 255, 0.15);
}

#mobileAccountToggle.expanded .arrow {
  transform: rotate(90deg);   /* rotates on expand */
}

/* =========================
   DESKTOP LOGIN BUTTON
   ========================= */
.nav-login-btn {
  margin-left: 16px;
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: center; /* vertically center text */
  justify-content: center; /* optional: centers text horizontally inside the button */
  height: 36px; /* match btn-sm height */
  line-height: 1; /* reset line-height */
}

/* =========================
   MOBILE RESPONSIVE FIXES
   ========================= */
@media(max-width: 767px) {
  /* Hide desktop nav links */
  .nav-links {
    display: none;
  }

  .hamburger {
    display: block;
  }

/* Remove extra padding from icon inside submenu */
#mobileAccountMenu li a i {
  margin: 0;                /* no extra right margin */
  padding: 0;               /* remove inline padding */
  width: 18px;              /* optional: fixed icon width to align all icons */
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/* Optional: fix span text alignment */
#mobileAccountMenu li a span {
  display: inline-block;
  flex: 1;                  /* fill remaining space if needed */
}

  /* Ensure Sign Out button padding stays correct */
  #signOutMobileBtn {
    padding-left: 16px;
    padding-right: 16px;
    width: calc(100% - 32px);
  }
}

/* =========================
   BRAND / HAMBURGER
   ========================= */
.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 32px;
  width: auto;
}

.hamburger {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  position: relative;
  width: 32px;
  height: 32px;
}

.hamburger i {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.25s;
}

.hamburger .fa-xmark {
  opacity: 0;
  transform: rotate(-90deg);
}

.hamburger.open .fa-bars {
  opacity: 0;
  transform: rotate(90deg);
}

.hamburger.open .fa-xmark {
  opacity: 1;
}

/* Profile icon */
.profile-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ccc;
}

/* =========================
   OVERLAY
   ========================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 1050;
}

/* =========================
   HERO SECTION
   ========================= */
.hero {
  height: 400px;
  display: none;
  position: relative;
  background: url('https://images.pexels.com/photos/2364397/pexels-photo-2364397.jpeg?fit=crop&w=1350&q=80')
    center / cover no-repeat;
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.hero .input-group {
  max-width: 400px;
}

/* =========================
   MAIN CONTENT
   ========================= */
.container-center {
  min-height: calc(100vh - 450px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 20px;
}

/* =========================
   ACCOUNT DASHBOARD
   ========================= */
.dashboard-container {
  min-height: calc(100vh - 140px);
  padding: 30px 15px;
}

.dashboard-heading {
  text-align: center;
  margin-bottom: 30px;
}

.dashboard-group {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 25px;
}

.dashboard-group h4 {
  margin-bottom: 15px;
}

.dashboard-group .btn {
  margin-right: 10px;
  margin-top: 5px;
}

.dashboard-group .form-control {
  width: 100%;
  margin-bottom: 10px;
}

/* =========================
   CARDS
   ========================= */
.card {
  display: flex;
  align-items: center; /* 👈 THIS centers everything vertically */
  gap: 14px;
}

.card:hover {
  transform: translateY(-2px);
}

/* Left icon */
.card-icon {
  color: #0d6efd;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;          /* fixed width keeps layout stable */
  flex-shrink: 0;
  margin: 0;            /* REMOVE margin-top */
}

.card-title {
  font-weight: 600;
}

.card-dates {
  font-size: 13px;
  color: #666;
  margin-top: 2px;
}

.card-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Right chevron */
.card-chevron {
  margin-left: auto;
  color: #0d6efd;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e9ecef;
}

.tag.owned {
  background: #e7f1ff;
  color: #0d6efd;
}

.tag.shared {
  background: #fff3cd;
  color: #856404;
}

/* =========================
   ADD BUTTON
   ========================= */
.add-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #0d6efd;
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 900;
}

/* =========================
   MODALS
   ========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 1200;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =========================
   FOOTER
   ========================= */
footer {
  background: #f5f7fb;
  border-top: 1px solid #ddd;
  text-align: center;
  padding: 12px;
  font-size: 12px;
}

footer a {
  color: #777;
  text-decoration: none;
  margin: 0 8px;
}

footer a:hover {
  color: black;
}

/* =========================
   RESPONSIVE
   ========================= */
@media(min-width:768px) {
  .hamburger {
    display: none;
  }

  .nav-links {
    display: flex;
  }
}

/* =========================
   BOOTSTRAP BUTTON OVERRIDES
   ========================= */
.btn-dark {
  background-color: #000;
  border-color: #000;
}

.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active,
.btn-dark.active {
  background-color: #111;
  border-color: #111;
}

/* =========================
   LOGIN PAGE
   ========================= */
.signin-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  min-height: calc(100vh - 100px);
  flex: 1;
}

.signin-form {
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.signin-form .form-control {
  margin-bottom: 15px;
}

.signin-form #errorMsg {
  color: red;
  margin-bottom: 15px;
  text-align: center;
}

.login-header {
  background-color: #f8f9fa;
  padding: 10px 0;
  text-align: center;
}

.login-header img {
  max-height: 60px;
}

.terms-notice,
.signup-text {
  color: #6c757d;
  text-align: center;
  font-size: 0.75rem;
  margin-top: 20px;
}

.terms-notice a,
.signup-text a {
  color: #6c757d;
  text-decoration: underline !important;
}

.terms-notice a:hover,
.signup-text a:hover {
  color: #5a6268;
}

/* =========================
   PROFILE ROWS
   ========================= */
.profile-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.profile-row .label {
  font-size: 13px;
  color: #6c757d;
}

.profile-row .value {
  font-weight: 500;
  color: #212529;
  word-break: break-word;
}

/* =========================
   ITINERARIES PAGE
   ========================= */

/* Main content wrapper */
.itineraries-main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  /* padding: 16px; */
  width: 100%;
}

.itineraries-main h2 {
  margin-top: 8px;
  margin-bottom: 16px;
  font-size: 1.8rem;
}

/* Filters row */
.itinerary-controls {
  display: flex;
  gap: 8px;
  padding: 0 8px;
  align-items: center;
}

/* Filter buttons */
.itinerary-controls .filter {
  background: #e9ecef;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.itinerary-controls .filter.active {
  background: #0d6efd;
  color: white;
}

/* Sort dropdown */
.sort-wrapper {
  margin-left: auto;
  position: relative;
}

.sort-btn {
  background: #212529 !important;
  color: #fff !important;
  border: 1px solid #212529 !important;
  padding: 8px 18px !important;
  border-radius: 6px !important;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.sort-btn:hover {
  background: #2c3034 !important;
}

.sort-menu {
  position: absolute;
  right: 0;
  top: 44px;
  background: #212529;
  color: white;
  display: none;
  border-radius: 8px;
  min-width: 260px;
  z-index: 500;
  flex-direction: column;
}

.sort-menu button {
  width: 100%;
  background: none;
  color: white;
  padding: 12px 16px;
  border: none;
  text-align: left;
  cursor: pointer;
}

.sort-menu button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* =========================
   ITINERARY CARDS
   ========================= */
.itinerary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.itinerary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.itinerary-card .card-icon {
  font-size: 22px;
  color: #0d6efd;
  flex-shrink: 0;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.itinerary-card .card-title {
  font-weight: 600;
  font-size: 16px;
}

.itinerary-card .card-dates {
  font-size: 13px;
  color: #666;
  margin-top: 2px;
}

.itinerary-card .card-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.itinerary-card .card-chevron {
  margin-left: auto;
  color: #0d6efd;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.itinerary-card .tag {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e9ecef;
}

.itinerary-card .tag.owned {
  background: #e7f1ff;
  color: #0d6efd;
}

.itinerary-card .tag.shared {
  background: #fff3cd;
  color: #856404;
}

/* =========================
   ADD BUTTON
   ========================= */
.add-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #0d6efd;
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 900;
}

/* =========================
   ADD ITINERARY MODAL RESPONSIVE
   ========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 1200;
}

/* Base modal style */
.itinerary-modal {
  position: fixed;
  background: white;
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
  max-width: 400px;
  width: 90%;
}

/* Close button */
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* Input inside modal */
.itinerary-modal input {
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Modal actions wrapper (just the Add button now) */
.modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* =========================
   MOBILE (BOTTOM SHEET) 
   ========================= */
@media(max-width: 767px) {
  .itinerary-modal {
    bottom: -300px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 14px 14px 0 0;
    width: 100%;
  }

  .itinerary-modal.show {
    bottom: 0;
  }
}

/* =========================
   DESKTOP (CENTERED MODAL)
   ========================= */
@media(min-width: 768px) {
  .itinerary-modal {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 14px;
    width: 400px;
  }

  .itinerary-modal.show {
    bottom: auto; /* not used on desktop */
  }
}