/* ============================================================
   ElectraCode — Global Responsive Utility Layer
   Loaded LAST on every page so these overrides win cleanly.
   Never modifies colors, gradients, or design identity.
   ============================================================ */

/* ── Prevent horizontal scroll on ALL pages ── */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ── Fluid base container ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
  box-sizing: border-box;
}

/* ── Fluid Typography ── */
h1 {
  font-size: clamp(1.75rem, 5vw, 3.6rem);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.4rem, 3.5vw, 2.6rem);
}

h3 {
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
}

/* ── Section spacing scale ── */
section,
.hero,
.features,
.leaderboard-preview,
.benefits-section,
.partner-section,
.about-hero,
.mission-section,
.story-section,
.team-section,
.explore-hero,
.explore-cards,
.contact-hero,
.industry-hero,
.college-hero {
  padding-left: clamp(16px, 4vw, 48px);
  padding-right: clamp(16px, 4vw, 48px);
}

/* ────────────────────────────────────────────
   ≤ 1024px  (Tablet landscape)
──────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Home hero grid → single column */
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 40px;
  }

  .hero-visual {
    display: none; /* float cards removed on tablet/mobile; hero content stands alone */
  }

  /* Leaderboard table - slightly smaller */
  .table-row {
    grid-template-columns: 60px 1fr 100px 100px;
    padding: 18px 16px;
  }
}

/* ────────────────────────────────────────────
   ≤ 768px  (Tablet portrait / large phone)
──────────────────────────────────────────── */
@media (max-width: 768px) {
  /* ── Hero typography ── */
  .hero h1,
  .explore-hero h1,
  .college-hero-content h1,
  .industry-hero-content h1,
  .about-hero-content h1,
  .contact-hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.4rem) !important;
  }

  .hero p,
  .explore-hero p,
  .industry-hero-content p,
  .college-hero-content p,
  .about-hero-content p {
    font-size: clamp(0.9rem, 3vw, 1.05rem) !important;
  }

  /* ── Section titles ── */
  .section-title,
  .benefits-section h2,
  .partner-section h2,
  .story-header h2 {
    font-size: clamp(1.3rem, 5vw, 1.9rem) !important;
    margin-bottom: 32px !important;
  }

  /* ── Feature grid on home page → 1 col ── */
  .feature-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Leaderboard table ── */
  .table-row,
  .table-header {
    grid-template-columns: 50px 1fr 70px 70px !important;
    font-size: 0.82rem !important;
    padding: 14px 12px !important;
  }

  /* ── Dashboard cards ── */
  .cards {
    grid-template-columns: 1fr !important;
  }

  .bottom-grid {
    grid-template-columns: 1fr !important;
  }

  .suggestions-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Sidebar and Main Content mobile adjustments ── */
  .main-content {
    padding-top: 75px !important; /* Push main content down to clear the floating sidebar toggle button */
  }

  .sidebar-restore-btn {
    top: 92px !important;
    left: 16px !important;
  }

  /* ── Benefit cards (colleges / industries) ── */
  .benefit-card {
    width: 100% !important;
  }

  /* ── Story section ── */
  .story-section {
    padding: 60px clamp(16px, 4vw, 24px) !important;
  }

  /* ── Mission section ── */
  .mission-section {
    padding: 60px clamp(16px, 4vw, 24px) !important;
  }

  /* ── Team section ── */
  .team-section {
    padding: 60px clamp(16px, 4vw, 24px) !important;
  }

  /* ── Hero sections padding ── */
  .hero,
  .explore-hero,
  .college-hero,
  .industry-hero,
  .about-hero,
  .contact-hero {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }

  /* ── Explore cards ── */
  .explore-card {
    width: 100% !important;
    max-width: 100% !important;
  }
  .explore-grid {
    flex-direction: column;
    align-items: stretch;
  }

  /* ── Auth card ── */
  .auth-card {
    width: 100% !important;
    max-width: 480px !important;
    padding: 28px 20px !important;
    margin: 20px 16px !important;
  }

  /* ── Talent passport ── */
  .tp-top-row,
  .tp-middle-row {
    grid-template-columns: 1fr !important;
  }
  .tp-card:nth-child(3) {
    grid-column: span 1 !important;
  }
  .tp-bottom-bar {
    flex-direction: column !important;
    gap: 12px !important;
    text-align: center !important;
    padding: 16px !important;
  }

  /* ── Form grid ── */
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Footer ── */
  .footer-content {
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
  }

  /* ── Leaderboard ── */
  .badge {
    display: inline-block !important;
    margin-left: 6px !important;
  }
}

/* ────────────────────────────────────────────
   ≤ 480px  (Mobile)
──────────────────────────────────────────── */
@media (max-width: 480px) {
  /* ── Fluid headings ── */
  .hero h1,
  .explore-hero h1 {
    font-size: clamp(1.5rem, 7vw, 1.9rem) !important;
  }

  /* ── CTA buttons stack ── */
  .cta-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .cta-buttons .btn {
    width: 100% !important;
    text-align: center !important;
  }

  /* ── Pipeline steps wrap ── */
  .pipeline {
    gap: 6px !important;
  }

  .pipeline-step {
    font-size: 0.78rem !important;
    padding: 6px 12px !important;
  }

  /* ── Leaderboard table ── */
  .table-row,
  .table-header {
    grid-template-columns: 40px 1fr 55px !important;
    font-size: 0.78rem !important;
  }

  /* Hide accuracy column on very small screens */
  .table-row > div:last-child,
  .table-header > div:last-child {
    display: none;
  }

  /* ── Dashboard ── */
  .welcome h1 {
    font-size: clamp(1.4rem, 6vw, 1.8rem) !important;
  }

  .main-content {
    padding: 16px 12px !important;
    padding-top: 65px !important; /* Clear room for floating restore button */
  }

  /* ── Sidebar restore button position fix ── */
  .sidebar-restore-btn {
    top: 78px !important;
    left: 12px !important;
  }

  .sidebar {
    top: 70px !important;
    height: calc(100vh - 70px) !important;
  }

  .sidebar-backdrop {
    top: 70px !important;
  }

  /* ── About impact ── */
  .impact-section {
    grid-template-columns: 1fr 1fr !important;
  }

  .impact-card h3 {
    font-size: 2rem !important;
  }

  /* ── Story quote ── */
  .story-quote {
    padding: 32px 16px !important;
  }

  .story-quote h3 {
    font-size: 1.35rem !important;
  }

  /* ── Contact info ── */
  .contact-info-grid {
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* ── Talent passport score ── */
  .tp-score-circle {
    width: 130px !important;
    height: 130px !important;
  }

  .tp-score-circle h2 {
    font-size: 40px !important;
  }

  .tp-profile-main {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    text-align: center !important;
  }

  .tp-avatar {
    width: 80px !important;
    height: 80px !important;
    font-size: 36px !important;
  }

  /* ── Form inputs ── */
  .input-group {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  .input-label-icon {
    width: 100% !important;
  }

  /* ── Auth card ── */
  .auth-card {
    padding: 24px 16px !important;
    margin: 16px !important;
    border-radius: 16px !important;
  }

  .auth-card h1 {
    font-size: 1.6rem !important;
  }

  /* ── Footer full width ── */
  .footer-content {
    grid-template-columns: 1fr !important;
  }

  /* ── Partner section ── */
  .partner-btn {
    width: 100% !important;
    text-align: center !important;
    padding: 16px 24px !important;
  }

  /* ── Card form padding ── */
  .form-card {
    padding: 20px 16px !important;
  }
}

/* ────────────────────────────────────────────
   ≤ 320px  (Minimum supported width)
──────────────────────────────────────────── */
@media (max-width: 320px) {
  .navbar {
    padding: 0 10px !important;
  }

  .logo img {
    height: 48px !important;
  }

  .impact-section {
    grid-template-columns: 1fr !important;
  }

  .tp-score-circle {
    width: 110px !important;
    height: 110px !important;
  }
}
