/* ==========================================================================
   EDUSPEARE - site.css
   Modern, responsive additive UI layer for EDUSPEARE
   - Mobile Hamburger Menu (☰ -> ✕)
   - Slide-down Mobile Drawer with full navigation & quick institute search
   - 2-Column Mobile Footer layout (halves footer height on phones)
   - 44px minimum tap targets for touch accessibility
   - Mobile input zoom prevention (16px base font on touch devices)
   - Floating "Coming Soon" toast notifications
   - Safe-area insets & responsive polish
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base & Accessibility
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

/* Accessibility skip link */
.site-skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--pri, #1E3A8A);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--r, 8px);
  font-weight: 600;
  z-index: 10001;
  text-decoration: none;
  transition: top 0.2s ease;
}
.site-skip-link:focus {
  top: 12px;
}

/* --------------------------------------------------------------------------
   2. Sleek Hamburger Menu Button (☰)
   -------------------------------------------------------------------------- */
.site-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.12);
  cursor: pointer;
  padding: 8px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  z-index: 1001;
  margin-left: auto;
  transition: background 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.site-menu-btn:hover,
.site-menu-btn:focus-visible {
  background: var(--soft, #E6EDFB);
  border-color: var(--pri, #1E3A8A);
  outline: none;
}

.site-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--ink, #0F172A);
  border-radius: 2px;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}

/* Animate 3 bars to 'X' */
.site-menu-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.site-menu-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.site-menu-btn.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   3. Sleek, Compact Mobile Dropdown Menu (No huge drawer, thin & elegant)
   -------------------------------------------------------------------------- */
.site-drawer-backdrop {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.site-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.site-drawer {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--line, #e2e8f0);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
  padding: 12px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 999;
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}

.site-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Dropdown list items - sleek & compact */
.site-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-drawer-link {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  border-radius: 6px;
  text-decoration: none;
  min-height: 38px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-drawer-link:hover,
.site-drawer-link:active {
  background: #F1F5F9;
  color: var(--pri, #1E3A8A);
}

.site-drawer-link.active {
  background: var(--soft, #E6EDFB);
  color: var(--pri, #1E3A8A);
  font-weight: 600;
}

/* Subtle separator line */
.site-drawer-sep {
  height: 1px;
  background: var(--line, #e2e8f0);
  margin: 4px 0;
}

/* Drawer action links */
.site-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-drawer-action-link {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #1E293B;
  border-radius: 6px;
  text-decoration: none;
  min-height: 38px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-drawer-action-link:hover {
  background: #F1F5F9;
  color: var(--pri, #1E3A8A);
}

.site-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pri, #1E3A8A);
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  margin-top: 4px;
  min-height: 40px;
  transition: opacity 0.15s ease;
}
.site-drawer-cta:hover {
  opacity: 0.95;
}

/* --------------------------------------------------------------------------
   3B. Hero Institute Link Search Box (Prominently Above CTA Buttons)
   -------------------------------------------------------------------------- */
.hero-find-box {
  background: #ffffff;
  border: 1.5px solid #CBD5E1;
  box-shadow: 0 6px 22px rgba(30, 58, 138, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 22px 0 26px;
  max-width: 500px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-find-box:hover {
  border-color: #94A3B8;
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.11);
}

.hero-find-box .hfb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--pri, #1E3A8A);
  margin-bottom: 11px;
}

.hero-find-box .hfb-header svg {
  color: var(--pri, #1E3A8A);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hero-find-box .hfb-input-wrap {
  display: flex !important;
  gap: 8px;
  align-items: center;
  width: 100% !important;
  box-sizing: border-box !important;
}

.hero-find-box .hfb-input {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: 0 !important;
  min-height: 48px;
  border: 1.5px solid var(--line, #e2e8f0);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink, #0F172A);
  background: #F8FAFC;
  outline: none;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hero-find-box .hfb-input:focus {
  border-color: var(--pri, #1E3A8A);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.hero-find-box .hfb-btn {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--acc, #F59E0B);
  color: #1C1300;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box !important;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.hero-find-box .hfb-btn:hover {
  filter: brightness(0.95);
}
.hero-find-box .hfb-btn:active {
  transform: scale(0.98);
}

.hero-find-box .hfb-err {
  font-size: 13px;
  color: var(--bad, #B91C1C);
  margin-top: 8px;
  display: none;
}
.hero-find-box .hfb-err.show {
  display: block;
}

/* --------------------------------------------------------------------------
   4. Floating "Coming Soon" Toast Notification
   -------------------------------------------------------------------------- */
.site-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90vw;
  text-align: center;
}

.site-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.site-toast i {
  color: var(--acc, #F59E0B);
  font-style: normal;
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   5. Mobile Responsive Overrides (< 860px)
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  /* Show hamburger button */
  .site-menu-btn {
    display: inline-flex;
  }

  /* Keep header neat & spaced */
  .hdr .w {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 16px;
  }

  /* Desktop links in navbar hidden on mobile */
  .nl > a:not(.site-keep) {
    display: none !important;
  }

  /* Keep language switcher in header if present, positioned nicely */
  .hdr .lang {
    margin-left: auto;
    margin-right: 10px;
  }

  /* Top banner fix */
  .top-banner {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* --------------------------------------------------------------------------
   6. 2-Column Mobile Footer Layout (< 768px)
   Halves vertical footer height, neatly grouping Product & Legal
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .ftr {
    padding: 36px 0 24px;
  }

  .ftg {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 16px !important;
    padding-bottom: 24px !important;
  }

  /* Brand section takes full width at the top */
  .ftg > div:first-child {
    grid-column: 1 / -1;
    margin-bottom: 4px;
  }

  .ftg > div:first-child p {
    max-width: 100% !important;
    font-size: 13px !important;
    line-height: 1.5;
    margin-top: 8px !important;
  }

  /* Product & Legal columns sit side-by-side */
  .ftg > div:nth-child(2),
  .ftg > div:nth-child(3) {
    display: flex;
    flex-direction: column;
  }

  /* Contact section takes full width at the bottom */
  .ftg > div:last-child {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ftg b {
    font-size: 14px !important;
    margin-bottom: 10px !important;
  }

  .ftg a {
    padding: 6px 0 !important;
    font-size: 13px !important;
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  .copy-bar {
    flex-direction: column !important;
    gap: 6px !important;
    align-items: flex-start !important;
    padding-top: 16px !important;
    font-size: 12px !important;
  }

  /* Simpler footer on inner pages (.ftr .w) */
  .ftr .w:not(:has(.ftg)) {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
    padding: 20px 16px;
  }
  .ftr .w:not(:has(.ftg)) .logo {
    width: 100%;
    margin-bottom: 4px;
  }
  .ftr .w:not(:has(.ftg)) a {
    font-size: 13px;
    padding: 4px 0;
  }
}

/* --------------------------------------------------------------------------
   7. Touch-Friendly Inputs, Buttons & Hero Quick Box (< 600px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  /* Prevent iOS Safari 16px auto-zoom */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Touch targets minimum 44px */
  .btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .lang button {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13px;
  }

  /* Hero action buttons wrap cleanly */
  .acts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .acts .btn {
    width: 100%;
    justify-content: center;
  }

  /* Hero Find Box mobile polish */
  .hero-find-box {
    margin: 16px 0 20px;
    padding: 12px 14px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-find-box .hfb-header {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .hero-find-box .hfb-input-wrap {
    display: flex !important;
    gap: 8px;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .hero-find-box .hfb-input {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: 0 !important;
    min-height: 44px;
    padding: 0 10px;
    font-size: 13px !important;
    box-sizing: border-box !important;
  }

  .hero-find-box .hfb-btn {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    min-height: 44px;
    padding: 0 16px;
    font-size: 13px;
    box-sizing: border-box !important;
  }

  /* "Got an institute link?" Box polish */
  .link {
    padding: 20px 18px !important;
    border-radius: var(--r, 12px) !important;
  }

  .link input.f {
    min-height: 44px !important;
    font-size: 14px !important;
  }

  .link .btn {
    min-height: 44px !important;
    padding: 0 20px !important;
  }
}

/* --------------------------------------------------------------------------
   8. Mobile Dashboard Navigation Tabs (< 860px)
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .dash {
    grid-template-columns: 1fr !important;
  }

  .side {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 8px !important;
    padding: 12px 16px !important;
    background: #ffffff !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line, #e2e8f0) !important;
    scrollbar-width: none;
  }

  .side::-webkit-scrollbar {
    display: none;
  }

  .side .logo,
  .side small {
    display: none !important;
  }

  .side a {
    white-space: nowrap !important;
    padding: 8px 16px !important;
    border-radius: 9999px !important;
    border: 1px solid var(--line, #e2e8f0) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--mute, #5B6678) !important;
    margin-top: 0 !important;
    display: inline-flex !important;
    align-items: center;
    min-height: 38px;
    background: #F8FAFC;
    transition: all 0.15s ease;
  }

  .side a.on {
    background: var(--pri, #1E3A8A) !important;
    color: #ffffff !important;
    border-color: var(--pri, #1E3A8A) !important;
    font-weight: 600 !important;
  }

  .side a[style*="var(--bad)"] {
    margin-left: auto;
    border-color: rgba(185, 28, 28, 0.2) !important;
    background: #FEF2F2 !important;
  }
}

