/* ─── CSS Variables & Global Styles ────────────────────────────────── */
:root {
  /* Color Palette */
  --primary-blue: #0b5f88;
  --primary-green: #3aa57a;
  --accent-yellow: #ffc400;
  --accent-yellow-light: #fff2c7;

  /* Neutrals */
  --text-dark: #171a20;
  --text-medium: #5c5f62;
  --text-light: #ffffff;
  --background-light: #f8f9fa;
  --background-white: #ffffff;
  --border-color: #dee2e6;
  --footer-bg: #2f3e4c;

  /* UI */
  --header-bg: rgba(255, 255, 255, 0.85);
  --header-height: 70px;

  /* Font Families */
  --font-family-body: 'Lato', sans-serif;
  --font-family-heading: 'Poppins', sans-serif;

  /* Safe Area Insets */
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  color: var(--text-dark);
  line-height: 1.6;
  font-family: var(--font-family-body);
  background-color: var(--background-white);
  font-size: 16px;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 700;
}

/* ─── Header & Navigation ────────────────────────────────────────────── */
header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; padding: 1rem; padding-top: calc(1rem + var(--safe-area-inset-top)); transition: padding 0.3s ease; }
nav { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; height: var(--header-height); padding: 0 2rem; background-color: transparent; border-radius: 12px; box-shadow: none; transition: all 0.3s ease;
border: 1px solid white;
backdrop-filter: blur(30px); }

nav.scrolled { background-color: var(--header-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 4px 15px rgba(0,0,0,0.07);border-color: black; }

.logo img { display: block; height: 35px; width: auto; }
.nav-container { display: flex; align-items: center; gap: 2rem; }
.nav-links { list-style: none; display: flex; gap: 1.75rem; }

.nav-links a {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--text-medium);
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-family-heading);
  padding: 0.25rem 0;
  transition: color 0.2s ease-in-out;
}

/* Nav Link Colors */
nav:not(.scrolled) .nav-links a,
nav:not(.scrolled) .icon-btn,
nav:not(.scrolled) .burger-menu { color: var(--text-light); }

.nav-links a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 100%; height: 2px; background-color: var(--primary-green); transform: scaleX(0); transform-origin: center; transition: transform 0.3s ease; }

.nav-links a:hover, .nav-links a:focus, .nav-links a.current-page { color: var(--text-dark); }
.nav-links a:hover::after, .nav-links a:focus::after, .nav-links a.current-page::after { transform: scaleX(1); }
.nav-links a.current-page { font-weight: 600; }

/* Light Theme / Scrolled Overrides */
nav:not(.scrolled) .nav-links a:hover,
nav:not(.scrolled) .nav-links a:focus,
nav:not(.scrolled) .nav-links a.current-page { color: var(--text-light); }

/* ─── Nav Action Buttons ────────────────────────────────────────────── */
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  font-family: var(--font-family-heading);
  border: 1px solid var(--border-color); /* Unified subtle border */
  background-color: transparent;
  color: var(--text-dark);
  box-shadow: none;
}

.nav-btn i { margin-right: 0.5rem; }

/* 1. Join Session (Green Theme) */
.nav-btn-join i { color: var(--primary-green); }

.nav-btn-join:hover {
  border-color: var(--primary-green);
  color: var(--primary-green);
  background-color: rgba(58, 165, 122, 0.05); /* Faint Green Tint */
  transform: translateY(-1px);
}

/* 2. Host Session (Blue Theme) */
.nav-btn-host { background-color: #ffffff; } /* Explicit white bg for host button */
.nav-btn-host i { color: var(--primary-blue); }

.nav-btn-host:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background-color: rgba(11, 95, 136, 0.05); /* Faint Blue Tint */
  transform: translateY(-1px);
}

/* 3. Sign In (Neutral/Ghost Theme) - NEW */
.nav-btn-auth {
  background-color: transparent;
  border: 1px solid currentColor; /* Matches text color automatically */
  opacity: 0.9;
}

.nav-btn-auth:hover {
  opacity: 1;
  background-color: rgba(128, 128, 128, 0.1);
  transform: translateY(-1px);
}

/* Auth Button Color Logic (Adapts to header state) */
/* When header is transparent (Hero): White Text/Border */
nav:not(.scrolled) .nav-btn-auth {
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.6);
}
nav:not(.scrolled) .nav-btn-auth:hover {
  border-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* When header is scrolled (White): Dark Text/Border */
nav.scrolled .nav-btn-auth {
  color: var(--text-medium);
  border-color: var(--border-color);
}
nav.scrolled .nav-btn-auth:hover {
  color: var(--text-dark);
  border-color: var(--text-dark);
}

/* Generic Icon Button */
.icon-btn { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; color: var(--text-medium); text-decoration: none; padding: 0.5rem; border-radius: 8px; transition: color 0.2s ease, background-color 0.2s ease; }
.icon-btn:hover, .icon-btn:focus { color: var(--primary-blue); background-color: #f0f3f5; }

nav:not(.scrolled) .icon-btn:hover,
nav:not(.scrolled) .icon-btn:focus {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.15);
}

.mobile-header { display: none; align-items: center; gap: 0.5rem; }
.burger-menu { background: none; border: none; font-size: 1.75rem; cursor: pointer; color: var(--text-dark); padding: 0.5rem; z-index: 1010; }
.nav-links .mobile-only-li { display: none; }

/* ─── Mobile Responsive Styles ─────────────────────────────────────── */
@media (max-width: 768px) {
  .logo img { height: 30px; }
  header { padding: 0; }
  
  nav {
    border-radius: 0;
    padding-top: var(--safe-area-inset-top);
    height: calc(65px + var(--safe-area-inset-top));
    border: none;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border-color: black;
  }

  /* Force dark text on mobile nav */
  nav:not(.scrolled) .nav-links a,
  nav:not(.scrolled) .icon-btn,
  nav:not(.scrolled) .burger-menu {
    color: var(--text-dark) !important;
  }

  nav.scrolled { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

  .nav-container {
    position: fixed;
    top: calc(65px + var(--safe-area-inset-top));
    left: 0;
    width: 100%;
    height: calc(100vh - (65px + var(--safe-area-inset-top)));
    background-color: var(--background-white);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.35s ease-in-out;
    overflow-y: auto;
  }
  .nav-container.show { transform: translateX(0); }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
  }

  .nav-actions .nav-btn { width: 100%; justify-content: center; }
  .nav-btn span { display: inline-block; }
  .nav-links li { display: list-item; width: 100%; }

  nav .nav-container .nav-links a {
    color: var(--text-dark);
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
  }
  .nav-links a::after { display: none; }
  nav .nav-container .nav-links a.current-page { color: var(--primary-green); font-weight: 600; }

  .nav-links .mobile-only-li { display: list-item; padding-top: 1rem; border-top: 1px solid var(--border-color); }
  nav .nav-container .icon-btn { width: 100%; font-size: 1.1rem; padding: 1rem 0; color: var(--text-dark); }
  .mobile-header { display: flex; }
  
  /* Mobile Overrides for Auth Button */
  nav:not(.scrolled) .nav-btn-auth {
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
  }
}

/* Light Page Overrides */
.light-page nav:not(.scrolled) .nav-links a,
.light-page nav:not(.scrolled) .icon-btn,
.light-page nav:not(.scrolled) .burger-menu {
  color: var(--text-dark);
}

.light-page nav:not(.scrolled) .nav-btn-auth {
    color: var(--text-dark);
    border-color: var(--border-color);
}

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer { background-color: var(--footer-bg); color: rgba(255, 255, 255, 0.7); padding: 5rem 1.5rem 2rem; font-size: 0.95rem; }
.footer-container { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.footer-about .footer-logo img { height: 40px; margin-bottom: 1rem; }
.footer-about p { max-width: 350px; line-height: 1.6; font-size: 0.9rem; }
.footer-links h4, .footer-social h4 { font-family: var(--font-family-heading); color: var(--text-light); font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.footer-links ul { list-style: none; }
.footer-links li:not(:last-child) { margin-bottom: 0.75rem; }
.footer-links a { text-decoration: none; color: rgba(255, 255, 255, 0.7); transition: color 0.2s ease; }
.footer-links a:hover { color: var(--text-light); }
.social-icons { display: flex; gap: 1.25rem; }
.social-icons a { color: rgba(255, 255, 255, 0.7); font-size: 1.2rem; transition: color 0.2s ease, transform 0.2s ease; }
.social-icons a:hover { color: var(--accent-yellow); transform: translateY(-2px); }
.footer-bottom { text-align: center; padding-top: 2rem; font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); }

@media (max-width: 768px) {
  .footer-container { grid-template-columns: 1fr; text-align: center; }
  .footer-about p { margin: 0 auto 2rem; }
  .social-icons { justify-content: center; }
  .footer-about .footer-logo img { margin: 0 auto 1rem; }
}

/* ─── Hero Component ────────────────────────────────────────────────── */
.about-hero, .solutions-header, .contact-hero, .hero-section {
  position: relative; width: 100%; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-light); overflow: hidden; z-index: 1;
}
.about-hero > .hero-background, .solutions-header > .hero-background, .contact-hero > .hero-background, .hero-section .hero-video-container {
  position: absolute; left: 0; width: 100%; z-index: -1; top: calc(-1 * var(--safe-area-inset-top)); height: calc(100% + var(--safe-area-inset-top));
}
.hero-background > img, .hero-background > video, .hero-video-container > video { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: rgba(11, 95, 136, 0.7); z-index: 0; }
.about-hero .hero-content, .solutions-header .header-content, .contact-hero .hero-content, .hero-section .hero-content {
    position: relative; z-index: 1; width: 100%; max-width: 800px; padding-left: 1.5rem; padding-right: 1.5rem;
    padding-top: calc(var(--header-height) + var(--safe-area-inset-top) + 2rem);
    padding-bottom: 2rem;
}
.about-hero .section-title, .solutions-header .section-title, .contact-hero .section-title, .hero-section .hero-title {
    font-size: clamp(2.8rem, 6vw, 3.5rem); color: var(--text-light); margin-bottom: 1rem;
}
.about-hero .section-subtitle, .solutions-header .section-subtitle, .contact-hero .section-subtitle, .hero-section .hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.2rem); color: rgba(255, 255, 255, 0.9); max-width: 700px; margin: 0 auto;
}

/* ─── User Dropdown Menu ────────────────────────────────────────────── */
.user-dropdown-container {
  position: relative;
  display: inline-block;
}

/* The Round User Icon Button */
.user-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: transparent;
  color: var(--text-light);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  overflow: hidden;
}
.user-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}
.user-btn__initial {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.user-btn img[hidden], .user-btn [hidden] { display: none; }

.user-btn:hover, .user-btn:focus, .user-btn[aria-expanded="true"] {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(11, 95, 136, 0.2);
}

/* Theme/Scroll Overrides for User Button */
nav:not(.scrolled) .user-btn { color: var(--text-light); border-color: rgba(255,255,255,0.5); }
nav.scrolled .user-btn, .light-page nav:not(.scrolled) .user-btn { color: var(--text-dark); border-color: var(--border-color); }

/* The Dropdown Menu Box */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 200px;
  background-color: var(--background-white);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 1100;
  border: 1px solid var(--border-color);
}

/* Show State */
.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Little Arrow pointing up */
.dropdown-arrow {
  position: absolute;
  top: -6px;
  right: 14px;
  width: 12px;
  height: 12px;
  background-color: var(--background-white);
  transform: rotate(45deg);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}

/* Menu Items */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.95rem;
  font-family: var(--font-family-body);
  transition: background-color 0.2s ease;
}

.dropdown-item i {
  width: 20px;
  text-align: center;
  color: var(--text-medium);
  transition: color 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--background-light);
  color: var(--primary-blue);
}

.dropdown-item:hover i {
  color: var(--primary-blue);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.25rem 0;
}

/* Mobile Overrides for Dropdown */
@media (max-width: 768px) {
  .user-dropdown-container {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .user-btn {
    width: 100%;
    border-radius: 12px;
    min-height: 48px;
    height: auto;
    padding: 0.75rem;
    justify-content: flex-start;
    gap: 0.75rem;
    overflow: visible;
    text-align: left;
  }

  .user-btn img,
  .user-btn__initial {
    width: 36px;
    height: 36px;
    border-radius: 999px;
  }

  .user-btn__initial {
    background: rgba(11, 95, 136, 0.08);
  }

  /* Add text label next to icon on mobile for clarity */
  .user-btn::after {
    content: "My Account";
    font-size: 1rem;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  
  .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    margin-top: 0.5rem;
    display: none; /* JS toggles 'display: block' via 'show' class */
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  
  .dropdown-menu.show { display: block; }
  .dropdown-arrow { display: none; }
  .dropdown-item { padding: 1rem 1rem; border-radius: 8px; }
  
  /* Reset colors for mobile slide-out */
  nav .user-btn { color: var(--text-dark) !important; border-color: var(--border-color) !important; }
}
