/* -------------------------------------------------------
   TRIPS by Travel Tamers — Global Styles
   Dark Sanctuary design system matching marketing site
   ------------------------------------------------------- */

/* ── Base ─────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #2D3436;
  background-color: #FAFCFD;
  background-image:
    radial-gradient(ellipse at 50% 50%, transparent 25%, rgba(250, 252, 253, 0.55) 100%),
    linear-gradient(rgba(201, 168, 76, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.14) 1px, transparent 1px),
    linear-gradient(rgba(15, 36, 64, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 36, 64, 0.18) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px, 28px 28px, 28px 28px;
  background-position: 0 0, 2px 2px, 2px 2px, 0 0, 0 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.06);
}

@media (hover: hover) and (pointer: fine) {
  body { background-attachment: fixed; }
}

/* ── Typography ───────────────────────────────────────── */
h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  color: #0F2440;
}

h4, h5, h6 {
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: #0F2440;
}

h1 { font-size: 2.25rem; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 1.875rem; line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; line-height: 1.2; }
h4 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; }
h5 { font-size: 1.125rem; line-height: 1.4; font-weight: 600; }
h6 { font-size: 0.75rem; line-height: 1.5; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }

@media (min-width: 1024px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 1.875rem; }
}

a { color: #0F2440; transition: color 150ms; }
a:hover { color: #E8B83D; }

::selection { background: rgba(232, 184, 61, 0.25); color: #0F2440; }
:focus-visible { outline: 2px solid #E8B83D; outline-offset: 2px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #FBF7F0; }
::-webkit-scrollbar-thumb { background: #E8B83D; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2E86AB; }

/* ── Nav Link ─────────────────────────────────────────── */
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #636E72;
  transition: color 150ms;
  position: relative;
  text-decoration: none;
}
.nav-link:hover { color: #0F2440; }
.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #E8B83D;
  transition: width 250ms;
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { width: 100%; }
.nav-link[aria-current="page"] { color: #0F2440; font-weight: 600; }

/* ── Footer Link ──────────────────────────────────────── */
.footer-link {
  font-size: 0.875rem;
  color: #9CA3AF;
  transition: color 150ms;
  text-decoration: none;
}
.footer-link:hover { color: #F0EDE8; }

/* ── Button System ────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #E8B83D, #F0C960);
  color: #0F2440;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid #0F2440;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(232, 184, 61, 0.3);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(232, 184, 61, 0.4);
  color: #0F2440;
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  background-color: transparent;
  color: #0F2440;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid #0F2440;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: #E8B83D;
  color: #D4A030;
  background-color: rgba(232, 184, 61, 0.05);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: transparent;
  color: #636E72;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 150ms;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn-ghost:hover {
  color: #0F2440;
  background-color: rgba(15, 36, 64, 0.05);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* ── Theme Toggle Active State ────────────────────────── */
[data-theme-value].active {
  background-color: rgba(232, 184, 61, 0.15);
  color: #E8B83D;
}

/* ── Card Depth System ────────────────────────────────── */
.card-depth {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 400ms cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, box-shadow;
}
.card-depth:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10), 0 6px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(232, 184, 61, 0.12);
}
.card-depth:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-gold-accent { border-top: 3px solid #E8B83D; }

/* ── Shadow Depths ────────────────────────────────────── */
.shadow-depth-1 { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.12); }
.shadow-depth-2 { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10), 0 4px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05); }
.shadow-depth-3 { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08); }
.shadow-depth-4 { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16), 0 12px 24px rgba(0, 0, 0, 0.10); }

/* ── Dividers ─────────────────────────────────────────── */
.divider-gold {
  height: 2px;
  background: linear-gradient(90deg, transparent, #E8B83D, transparent);
}

/* ── Animated Underline Links ─────────────────────────── */
.link-animated { position: relative; text-decoration: none; }
.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #E8B83D, #F0C960);
  transition: width 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
.link-animated:hover::after { width: 100%; }

/* ── Gold Image Overlay ───────────────────────────────── */
.img-gold-overlay { position: relative; overflow: hidden; }
.img-gold-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232, 184, 61, 0.0) 0%, rgba(232, 184, 61, 0.12) 100%);
  opacity: 0;
  transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  z-index: 1;
}
.group:hover .img-gold-overlay::after,
.img-gold-overlay:hover::after { opacity: 1; }

/* ── Section Tint ─────────────────────────────────────── */
.section-tinted { background: rgba(240, 246, 249, 0.8); }

/* ── Input Inner Shadow ───────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
select {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ── Status Badges (Groups-specific) ──────────────────── */
.badge-forming { background-color: #E8B83D; color: #0F2440; }
.badge-viable { background-color: #2D5A4A; color: #fff; }
.badge-planning { background-color: #0F2440; color: #fff; }
.badge-departed { background-color: #fd7e14; color: #fff; }
.badge-completed { background-color: #6c757d; color: #fff; }
.badge-cancelled { background-color: #dc3545; color: #fff; }
.badge-proposed { background-color: #2E86AB; color: #fff; }
.badge-voting { background-color: #0F2440; color: #fff; }
.badge-approved { background-color: #2D5A4A; color: #fff; }
.badge-rejected { background-color: #dc3545; color: #fff; }

/* ── Vote Buttons ─────────────────────────────────────── */
.btn-vote-yes { color: #2D5A4A; border-color: #2D5A4A; background: transparent; }
.btn-vote-yes:hover, .btn-vote-yes.active { background-color: #2D5A4A; color: #fff; }
.btn-vote-no { color: #dc3545; border-color: #dc3545; background: transparent; }
.btn-vote-no:hover, .btn-vote-no.active { background-color: #dc3545; color: #fff; }
.btn-vote-abstain { color: #6c757d; border-color: #6c757d; background: transparent; }
.btn-vote-abstain:hover, .btn-vote-abstain.active { background-color: #6c757d; color: #fff; }

/* ── Cover Placeholder ────────────────────────────────── */
.cover-placeholder {
  background: linear-gradient(135deg, rgba(15,36,64,0.7) 0%, rgba(46,134,171,0.5) 100%);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ── Comments ─────────────────────────────────────────── */
.comment-reply { border-left: 3px solid #E5E1DB; margin-left: 1.5rem; padding-left: 1rem; }
.comment-highlight { animation: commentSlideIn 0.35s ease-out, commentFlash 2s ease 0.35s; }
@keyframes commentFlash { 0% { background-color: rgba(232, 184, 61, 0.15); } 100% { background-color: transparent; } }
@keyframes commentSlideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }

/* ── Notifications ────────────────────────────────────── */
.notification-item.unread { background-color: #F0F6F9; border-left: 3px solid #E8B83D; }
.notif-icon { font-size: 1.25rem; width: 2rem; text-align: center; flex-shrink: 0; }

/* ── Progress Bar / Viability Meter ───────────────────── */
.progress-bar-wrap { width: 100%; height: 8px; border-radius: 4px; overflow: hidden; background-color: #E5E1DB; }
.progress-bar-fill { height: 100%; transition: width 0.6s ease; }
.viability-bar.threshold-met .progress-bar-fill { box-shadow: 0 0 12px rgba(45,90,74,0.4); }

/* ── Modal Overlay ────────────────────────────────────── */
.modal-overlay { background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }

/* ── Itinerary Timeline ───────────────────────────────── */
.itinerary-timeline { position: relative; padding-left: 2rem; }
.itinerary-timeline::before { content: ''; position: absolute; left: 0.75rem; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, #E8B83D, #0F2440); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item::before { content: ''; position: absolute; left: -1.55rem; top: 0.35rem; width: 12px; height: 12px; border-radius: 50%; background-color: #E8B83D; border: 2px solid #fff; box-shadow: 0 0 0 2px #E8B83D; }

/* ── Flash Fade Out ───────────────────────────────────── */
.flash-fade-out { opacity: 0; transition: opacity 0.4s ease; }

/* ── Animations ───────────────────────────────────────── */
.tab-pane { opacity: 1; transition: opacity 200ms ease-out; }
.tab-pane.tab-fade-out { opacity: 0; }

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.card-animate { opacity: 0; }
.card-animate.card-visible { animation: cardEntrance 0.4s ease-out both; }

@keyframes votePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.vote-pulse { animation: votePulse 200ms ease-out; }

/* ── Reduced Motion ───────────────────────────────────── */
@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;
  }
  .card-animate { opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 767.98px) {
  .cover-placeholder { min-height: 140px; }
  .card-depth:hover { transform: none; }
}

/* -------------------------------------------------------
   DARK MODE
   ------------------------------------------------------- */
html.dark body {
  color: #E8E8EF;
  background-color: #0B1120;
  background-image:
    radial-gradient(ellipse at 50% 50%, transparent 25%, rgba(11, 17, 32, 0.92) 100%),
    linear-gradient(rgba(232, 184, 61, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 184, 61, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(46, 134, 171, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 134, 171, 0.18) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px, 28px 28px, 28px 28px;
  background-position: 0 0, 2px 2px, 2px 2px, 0 0, 0 0;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  html.dark body { background-attachment: fixed; }
}

html.dark h1, html.dark h2, html.dark h3,
html.dark h4, html.dark h5, html.dark h6 { color: #F0EDE8; }

html.dark a { color: #E8B83D; }
html.dark a:hover { color: #F0C960; }

html.dark ::selection { background: rgba(46, 134, 171, 0.3); color: #F0EDE8; }
html.dark ::-webkit-scrollbar-track { background: #0B1120; }
html.dark ::-webkit-scrollbar-thumb { background: #2E86AB; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #5BA4C9; }
html.dark :focus-visible { outline-color: #E8B83D; }

/* Nav */
html.dark #main-nav { background-color: rgba(11, 17, 32, 0.85) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
html.dark .nav-link { color: #8888a0; }
html.dark .nav-link:hover { color: #E8E8EF; }
html.dark .nav-link[aria-current="page"] { color: #E8E8EF; }
html.dark .nav-link::after { background: #E8B83D; }

/* Buttons */
html.dark .btn-primary {
  background: linear-gradient(135deg, #E8B83D, #F0C960);
  color: #0F2440;
  border-color: #F0EDE8;
}
html.dark .btn-secondary {
  color: #E8E8EF;
  border-color: #F0EDE8;
}
html.dark .btn-secondary:hover {
  border-color: #2E86AB;
  color: #5BA4C9;
  background-color: rgba(46, 134, 171, 0.08);
}
html.dark .btn-ghost { color: #8888a0; }
html.dark .btn-ghost:hover { color: #E8E8EF; background-color: rgba(255, 255, 255, 0.05); }

/* Cards */
html.dark .card-depth {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}
html.dark .card-depth:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(46, 134, 171, 0.2);
}
html.dark .card-gold-accent { border-top-color: #2E86AB; }

/* Dividers */
html.dark .divider-gold { background: linear-gradient(90deg, transparent, #2E86AB, transparent); }
html.dark .link-animated::after { background: linear-gradient(90deg, #2E86AB, #5BA4C9); }

/* Shadows */
html.dark .shadow-depth-1 { box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4); }
html.dark .shadow-depth-2 { box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 4px 8px rgba(0,0,0,0.3); }
html.dark .shadow-depth-3 { box-shadow: 0 16px 40px rgba(0,0,0,0.4), 0 8px 16px rgba(0,0,0,0.3); }
html.dark .shadow-depth-4 { box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 12px 24px rgba(0,0,0,0.35); }

/* Surfaces */
html.dark .bg-white { background-color: #131B2E !important; }
html.dark .section-tinted { background-color: #131B2E !important; }
html.dark .bg-tint-blue { background-color: rgba(19, 27, 46, 0.8) !important; }

/* Text */
html.dark .text-navy { color: #F0EDE8 !important; }
html.dark .text-charcoal { color: #E8E8EF !important; }
html.dark .text-warm-gray { color: #9CA3AF !important; }
html.dark .border-light-border { border-color: #2A3550 !important; }

/* Semantic dark */
html.dark .bg-success-bg { background-color: rgba(45, 90, 74, 0.15) !important; }
html.dark .bg-danger-light { background-color: rgba(168, 84, 84, 0.15) !important; }
html.dark .text-success { color: #3A7460 !important; }
html.dark .text-danger { color: #D47A7A !important; }

/* Comments */
html.dark .comment-reply { border-left-color: #2A3550; }

/* Notifications */
html.dark .notification-item.unread { background-color: #162035; border-left-color: #E8B83D; }

/* Progress bar */
html.dark .progress-bar-wrap { background-color: #2A3550; }

/* Timeline */
html.dark .timeline-item::before { border-color: #131B2E; }

/* Inputs */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html.dark textarea,
html.dark select {
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

/* Mobile menu dark */
html.dark #mobile-menu { background-color: rgba(11, 17, 32, 0.98) !important; }

/* Dropdown dark */
html.dark #userDropdown { background-color: #131B2E; border-color: #2A3550; }
html.dark #userDropdown a,
html.dark #userDropdown button { color: #E8E8EF; }
html.dark #userDropdown a:hover,
html.dark #userDropdown button:hover { background-color: #1A2540; }
