/* =========================
   GLOBAL & RESET
========================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Header height variable */
:root {
  --header-height: 80px; /* Adjust based on actual header height on mobile */
}

/* =========================
   BODY & CONTAINER
========================= */
body {
  font-family: 'Montserrat', sans-serif;
  background: #314581;
  color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================
   NAVBAR
========================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  padding: 20px 80px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: all 0.3s;
}

header.scrolled {
  background: #f6f7fb;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo img {
  max-height: 45px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  color: #253d7f;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #09061f;
}

/* Dropdown (Services) */
.nav-links .dropdown {
  position: relative;
}

.nav-links .dropdown-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.nav-links .caret {
  font-size: 0.7em;
  line-height: 1;
  transition: transform 0.18s ease;
}

.nav-links .dropdown-menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(8, 30, 80, 0.08);
  padding: 8px 0;
  display: none;
  z-index: 1200;
}

.nav-links .dropdown-menu li {
  list-style: none;
}

.nav-links .dropdown-menu li a {
  display: block;
  padding: 0.6rem 1rem;
  color: #2c2e5f;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links .dropdown-menu li a:hover {
  background: rgba(11, 100, 198, 0.06);
  color: #0b64c6;
}

/* Desktop: Hover to open dropdown */
@media (hover: hover) and (min-width: 769px) {
  .nav-links .dropdown:hover > .dropdown-menu {
    display: block;
  }
  .nav-links .dropdown:hover > .dropdown-link .caret {
    transform: rotate(180deg);
  }
}

/* Buttons */
.btn {
  background: #290fab;
  color: #fff;
  padding: 10px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
  display: inline-block;
}

.btn:hover {
  background: #3c4870;
}

.desktop-only {
  display: inline-block;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #253d7f;
}

/* =========================
   HERO / PAGE TITLE SECTION
========================= */
.giveback-section {
  padding: 140px 20px 60px;
  background: #4644d8;
  text-align: center;
}

.giveback-section h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: #ffffff;
}

.giveback-section .intro {
  max-width: 700px;
  margin: auto;
  font-size: 1rem;
  color: #fcfcfc;
  line-height: 1.6;
}

/* =========================
   CONTENT & GALLERY
========================= */
.content-section {
  padding: 80px 20px;
  background: #fff;
  color: #333;
  text-align: center;
}

.content-section h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: #290fab;
}

.content-section p {
  max-width: 800px;
  margin: 0 auto 40px;
  font-size: 1.1rem;
  line-height: 1.7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

/* =========================
   FOOTER
========================= */
.dark-footer {
  background: #0d0d0d;
  color: #ccc;
  padding: 80px 40px 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
}

.footer-logo {
  color: #f3c522;
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.footer-col h3 {
  color: #f3c522;
  margin-bottom: 20px;
}

.social-links a {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  background: #1a1a1a;
  color: #fff;
  text-align: center;
  border-radius: 50%;
  margin-right: 10px;
  transition: 0.3s;
}

.social-links a:hover {
  background: #f3c522;
  color: #000;
}

.subscribe-form input {
  padding: 12px 20px;
  border: none;
  border-radius: 30px;
  width: 100%;
  margin-bottom: 10px;
}

.subscribe-form button {
  background: #f3c522;
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  margin-top: 50px;
  border-top: 1px solid #333;
  color: #aaa;
  font-size: 0.9rem;
}

/* =========================
   PRELOADER
========================= */
#preloader {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 60px;
  height: 60px;
  border: 6px solid #f0f0f0;
  border-top: 6px solid #290fab;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   RESPONSIVE (Mobile Menu + Dropdown Fix)
========================= */
@media (max-width: 768px) {
  header {
    padding: 15px 20px;
  }

  .desktop-only {
    display: none !important;
  }

  .menu-toggle {
    display: block;
  }

  /* Mobile side panel */
  .nav-links {
    position: fixed;
    top: var(--header-height);
    right: 0;
    background: #ffffff;
    width: 280px;
    height: calc(100vh - var(--header-height));
    flex-direction: column;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    z-index: 999;
    overflow-y: auto;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-links > li {
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
  }

  .nav-links a {
    padding: 1rem 0;
    font-size: 1.15rem;
    display: block;
    width: 100%;
    color: #253d7f;
  }

  /* Mobile dropdown - indented to the side */
  .nav-links .dropdown {
    position: static;
  }

  .nav-links .dropdown > .dropdown-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    font-size: 1.15rem;
    font-weight: 600;
  }

  .nav-links .dropdown-menu {
    position: static;
    display: none;
    width: 100%;
    background: transparent;
    box-shadow: none;
    padding: 0.5rem 0 1rem 1.5rem; /* Indented to the side */
    border-radius: 0;
  }

  .nav-links .dropdown.open .dropdown-menu {
    display: block;
  }

  .nav-links .dropdown-menu li a {
    padding: 0.8rem 1rem;
    background: #f0f4ff;
    color: #253d7f;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .nav-links .dropdown-menu li a:hover {
    background: #dbe5ff;
  }

  .nav-links .dropdown.open .caret {
    transform: rotate(180deg);
  }

  /* Giveback page mobile adjustments */
  .giveback-section h1 {
    font-size: 2.2rem;
  }

  .content-section h2 {
    font-size: 2rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* Footer responsive */
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-links a {
    margin: 5px;
  }

  .subscribe-form {
    flex-direction: column;
  }

  .subscribe-form input,
  .subscribe-form button {
    width: 100%;
  }
}