/* ============================================================
   Hope In The Hills Recovery Haven Ltd.
   Global Stylesheet — loaded on every page alongside Tailwind CDN
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Nunito:wght@400;500;600;700&display=swap');

/* ── Brand CSS Custom Properties ─────────────────────────── */
:root {
  --color-green:        #1e6b4f;   /* Primary forest green */
  --color-white-bg:     #f0faf5;   /* Heavenly white / pale mint */
  --color-deep-forest:  #1a2e25;   /* Near-black green */
  --color-gold:         #f0a500;   /* Warm amber accent */
  --color-soft-sky:     #e0f2fe;   /* Light sky blue tint */

  --transition-default: 0.2s ease;
  --shadow-card:        0 4px 24px rgba(30, 107, 79, 0.10);
  --shadow-card-hover:  0 8px 32px rgba(30, 107, 79, 0.18);
  --radius-card:        1rem;
}

/* ── Base ─────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--color-white-bg);
  color: var(--color-deep-forest);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
}

/* ── Custom Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #ffffff;
}
::-webkit-scrollbar-thumb {
  background: var(--color-green);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-deep-forest);
}

/* ── Fade-In-Up Scroll Animation ──────────────────────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Navbar ───────────────────────────────────────────────── */
#main-navbar {
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
.navbar-scrolled {
  background-color: var(--color-deep-forest) !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}
.navbar-scrolled .nav-link {
  color: #ffffff !important;
}
.navbar-scrolled .nav-link:hover {
  color: var(--color-gold) !important;
}

/* ── Hero Overlay ─────────────────────────────────────────── */
.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(26, 46, 37, 0.82) 0%,
    rgba(30, 107, 79, 0.60) 100%
  );
}

/* ── Float Card Animation (hero card) ────────────────────── */
@keyframes floatCard {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}
.float-card {
  animation: floatCard 3s ease-in-out infinite;
}

/* ── Count-Up Numbers ─────────────────────────────────────── */
.count-up {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  transition: color 0.3s ease;
}

/* ── Green Decorative Underline ───────────────────────────── */
.green-underline {
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--color-green);
  border-radius: 999px;
  margin: 0.5rem auto 0;
}
.green-underline.left {
  margin-left: 0;
}

/* ── Carousel Dots ────────────────────────────────────────── */
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #d1d5db;
  cursor: pointer;
  transition: background-color var(--transition-default),
              transform var(--transition-default);
}
.dot.active {
  background-color: var(--color-green);
  transform: scale(1.25);
}

/* ── Testimonial Cards ────────────────────────────────────── */
.testimonial-card {
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.testimonial-card.hidden-slide {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
  position: absolute;
}

/* ── Mobile Menu Slide-Down ───────────────────────────────── */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease;
  opacity: 0;
}
#mobile-menu.mobile-menu-open {
  max-height: 600px;
  opacity: 1;
}

/* ── Stat Card Hover Lift ─────────────────────────────────── */
.stat-card {
  transition: transform var(--transition-default),
              box-shadow var(--transition-default);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* ── General Card Hover ───────────────────────────────────── */
.hover-lift {
  transition: transform var(--transition-default),
              box-shadow var(--transition-default);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* ── Dashboard Sidebar ────────────────────────────────────── */
#sidebar {
  transition: width 0.3s ease, transform 0.3s ease;
}
#sidebar.collapsed {
  width: 64px;
}
#sidebar.collapsed .sidebar-label {
  display: none;
}
#sidebar.collapsed .sidebar-logo-text {
  display: none;
}

/* Sidebar mobile overlay */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 30;
}
#sidebar-overlay.active {
  display: block;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.50);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-backdrop.modal-open {
  opacity: 1;
}
.modal-box {
  background: #ffffff;
  border-radius: var(--radius-card);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  max-width: 90vw;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-backdrop.modal-open .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ── Toast Notifications ──────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
}
.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  max-width: 360px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s ease;
}
.toast.toast-visible {
  transform: translateX(0);
  opacity: 1;
}
.toast.toast-hiding {
  transform: translateX(120%);
  opacity: 0;
}
/* Toast color variants */
.toast-success {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  color: #14532d;
}
.toast-error {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
  color: #7f1d1d;
}
.toast-warning {
  background: #fffbeb;
  border-left: 4px solid #d97706;
  color: #78350f;
}
.toast-info {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  color: #1e3a8a;
}
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: opacity var(--transition-default);
}
.toast-close:hover {
  opacity: 1;
}

/* ── Flash Message ────────────────────────────────────────── */
.flash-message {
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.flash-message.flash-hiding {
  opacity: 0;
  transform: translateY(-8px);
}

/* ── Active Nav Link ──────────────────────────────────────── */
.nav-link.active-link {
  color: var(--color-green) !important;
  font-weight: 600;
  border-bottom: 2px solid var(--color-green);
}
.navbar-scrolled .nav-link.active-link {
  color: var(--color-gold) !important;
  border-bottom-color: var(--color-gold);
}

/* ── Sidebar Active Link ──────────────────────────────────── */
.sidebar-link.active-sidebar-link {
  background-color: rgba(30, 107, 79, 0.12);
  color: var(--color-green);
  font-weight: 600;
  border-right: 3px solid var(--color-green);
}

/* ── Tab Switcher ─────────────────────────────────────────── */
.tab-btn {
  position: relative;
  transition: color var(--transition-default);
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-green);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.tab-btn.active-tab::after {
  width: 100%;
}
.tab-panel {
  display: none;
}
.tab-panel.active-panel {
  display: block;
}

/* ── Stagger Animation Delays ─────────────────────────────── */
.stagger-1  { transition-delay: 0.05s; }
.stagger-2  { transition-delay: 0.10s; }
.stagger-3  { transition-delay: 0.15s; }
.stagger-4  { transition-delay: 0.20s; }
.stagger-5  { transition-delay: 0.25s; }
.stagger-6  { transition-delay: 0.30s; }
.stagger-7  { transition-delay: 0.35s; }
.stagger-8  { transition-delay: 0.40s; }

/* ── 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;
  }
  .fade-in-up {
    opacity: 1;
    transform: none;
  }
  .float-card {
    animation: none;
  }
}

/* ── Utility: Visually Hidden (accessibility) ─────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  #main-navbar,
  #sidebar,
  #toast-container,
  .no-print {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
}
