/* ======================================================
   Quantiva Tech Academy — Mobile-First Production CSS
   Architecture: Tokens → Base → Layout → Components →
                 Sections → Responsive Enhancements
====================================================== */

/* ================= 1. DESIGN TOKENS ================= */
:root {
  --primary: #1B3A6B;
  --accent: #F2A900;
  --secondary: #00838F;
  --text: #1A1A1A;
  --white: #FFFFFF;

  --shadow-sm: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 12px 35px rgba(0,0,0,0.10);
  --shadow-lg: 0 25px 70px rgba(0,0,0,0.18);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.4s var(--ease);
}

/* ================= 2. RESET & BASE ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: #F4F6FA;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
  transition: filter 0.4s ease, transform 0.4s ease;
}

img:not([src]) {
  filter: blur(10px);
}

a, button {
  touch-action: manipulation;
  pointer-events: auto; /* FIX: defensive guarantee — never inherit a blocked click state */
}

h1 {
  color: var(--accent);
  text-align: center;
}

h2, h3 {
  color: var(--primary);
  text-align: center;
}

/* ================= 3. ACCESSIBILITY ================= */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(242, 169, 0, 0.6);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ================= 4. LAYOUT SYSTEM ================= */
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  padding: 60px 0;
}

/* Grid: mobile-first — 1 col base, 2 at tablet, 3 at desktop */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

/* ================= 5. COMPONENTS ================= */

/* ---- Buttons (mobile base = smallest touch target) ---- */
.btn,
button,
input[type="submit"] {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 48px; /* touch-friendly floor, never reduced */
  padding: 10px 14px;

  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: 10px;

  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  pointer-events: auto; /* FIX: guarantee buttons stay clickable regardless of inherited context */
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, background 0.3s ease, color 0.3s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-3px);
}

form button,
form input[type="submit"] {
  width: 100%;
}

/* ---- Cards ---- */
.card,
.program-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(27, 58, 107, 0.12);
  border-radius: 14px;
  box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.06),
      0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.25s ease;
  text-align: center;
  padding: 20px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  will-change: transform;
  backface-visibility: hidden;
}

.card:hover,
.program-card:hover {
  transform: translateY(-5px);
  border-color: rgba(27, 58, 107, 0.25);
  box-shadow:
      0 10px 20px rgba(0, 0, 0, 0.10),
      0 20px 50px rgba(0, 0, 0, 0.12);
}

.card img,
.program-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover img,
.program-card:hover img {
  transform: scale(1.03);
}

.card h3,
.program-card h3 {
  color: var(--primary);
  font-weight: 700;
}

.card p,
.program-card p {
  color: rgba(0, 0, 0, 0.75);
}

.card-content,
.program-card-content {
  padding: 16px;
}

.card-content h3 {
  margin: 0;
  font-size: 1rem;
}

/* Premium program-card accents */
.program-card * {
  position: relative;
  z-index: 2;
}

.program-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(242,169,0,0.10), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.program-card:hover::before {
  opacity: 1;
}

.program-card h3 {
  position: relative;
  display: inline-block;
}

.program-card h3::after {
  content: "";
  display: block;
  width: 55%;
  height: 3px;
  margin: 8px auto 0;
  background: linear-gradient(90deg, var(--accent), rgba(242,169,0,0.3));
  border-radius: 50px;
}

.program-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease,
              transform 0.4s ease;
  margin-top: 0;
  will-change: max-height, opacity, transform;
}

.program-card.active .program-details {
  max-height: 600px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 12px;
}

.program-card .btn {
  margin-top: 16px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

/* ---- Forms (already mobile-first: full width by default) ---- */
form {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

label {
  display: block;
  font-weight: 500;
  margin-top: 12px;
  margin-bottom: 5px;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  margin: 10px 0;
  font-size: 16px; /* prevents iOS zoom-on-focus */
  font-family: 'Poppins', sans-serif;
  border: 1px solid #ddd;
  border-radius: 10px;
  outline: none;
  background: #fff;
  transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.15);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table th,
table td {
  padding: 18px 16px;
  text-align: left;
  vertical-align: top;
  border: 1px solid rgba(27,58,107,0.10);
}

table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
}

table td {
  background: #fff;
  color: var(--text);
}

/* ---- Floating communication buttons ---- */
.whatsapp-float,
.call-float {
  position: fixed;
  bottom: 20px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  z-index: 99999;
  pointer-events: auto; /* FIX: explicit guarantee these floating buttons stay tappable */
  transition: 0.3s ease;
}

.whatsapp-float {
  right: 20px;
  background: #25D366;
}

.call-float {
  right: 90px;
  background: #1B3A6B;
}

.whatsapp-float img,
.call-float img {
  width: 28px;
  height: 28px;
}

.whatsapp-float:hover,
.call-float:hover {
  transform: scale(1.1);
}

/* ================= 6. SECTIONS ================= */

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  z-index: 5000;
  background: rgba(27, 58, 107, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(27, 58, 107, 0.98);
}

.logo a {
  display: inline-block;
  text-decoration: none;
  color: #FFFFFF !important;
  font-size: 1rem; /* mobile base, scales up in responsive section */
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.3s ease;
}

.logo a:hover {
  color: #FFFFFF !important;
  transform: scale(1.03);
}

.logo a:visited,
.logo a:active,
.logo a:focus {
  color: #FFFFFF !important;
}

.logo a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---- Menu / Sidebar ---- */
.menu-toggle {
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  pointer-events: auto; /* FIX: guarantee the toggle button itself is always tappable */
  transition: transform 0.3s var(--ease);
}

.menu-toggle:hover {
  transform: scale(1.1);
  color: var(--accent);
}

.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background: var(--primary);
  padding: 2rem;
  z-index: 6000;
  transition: left 0.5s var(--ease);
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  color: var(--white);
  text-align: left;
  font-size: 1.15rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto; /* FIX: guarantee the close button is always tappable */
  transition: transform 0.3s var(--ease), color 0.3s ease;
}

.close-btn:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

.sidebar-footer {
  margin-top: 2rem;
}

.sidebar-footer .btn {
  width: 100%;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* FIX: keep overlay out of the tap hit-test path while inactive */
  transition: var(--transition);
  z-index: 5500;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* FIX: re-enable tap-to-close only while overlay is actually shown */
}

.sidebar nav a {
  display: block;
  color: var(--white);
  padding: 1rem;
  text-decoration: none;
  border-radius: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  pointer-events: auto; /* FIX: guarantee sidebar links always remain tappable */
  transition: var(--transition);
}

.sidebar nav a:hover {
  background: var(--accent);
  color: var(--primary);
  transform: translateX(6px);
}

/* ---- Hero & Slider (mobile base = compact) ---- */
.hero {
  margin-top: 30px;
  padding: 50px 20px;
  text-align: center;
  background: #0B0F19;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;
  pointer-events: none; /* FIX: decorative blobs must never intercept taps */
}

.hero::before {
  width: 420px;
  height: 420px;
  top: -180px;
  right: -120px;
  background: rgba(255,255,255,0.08);
}

.hero::after {
  width: 320px;
  height: 320px;
  bottom: -120px;
  left: -100px;
  background: rgba(242,169,0,0.12);
}

.hero h1 {
  font-size: 1.6rem;
}

.hero p {
  font-size: 0.95rem;
}

.hero-slider {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 300px;
  margin: 30px auto;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  will-change: transform;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none; /* FIX: inactive slides must not sit on top of clickable content */
  transition: opacity 1.2s var(--ease), transform 1.4s var(--ease);
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
  pointer-events: auto; /* FIX: only the visible slide should be interactive */
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slider::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.45));
  z-index: 3;
  pointer-events: none;
}

.hero-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.25));
  z-index: 4;
  pointer-events: none;
}

.slide-content {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  text-align: left;
  color: var(--white);
}

.slide-content h3 {
  color: var(--white);
  text-align: left;
  margin-bottom: 6px;
}

.slide-content p {
  color: var(--white);
}

.cta-buttons {
  position: static;
  margin-top: 16px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  pointer-events: auto; /* FIX: guarantee CTA buttons inside the slider stay clickable above overlays */
}

/* ---- Footer (mobile base = compact) ---- */
.site-footer {
    background: #020408;
    color: #FFFFFF;
    padding: 50px 30px 25px;
    text-align: center;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.footer-logo {
    margin-bottom: 8px;
}

.footer-logo a {
    display: inline-block;
    line-height: 0;
    transition: transform 0.3s ease;
}

.footer-logo a:hover {
    transform: scale(1.05);
}

.footer-logo img {
    display: block;
    width: auto;
    height: 120px;
    max-width: 120px;
    object-fit: contain;
}

.site-footer p {
    margin: 0;
    line-height: 1.7;
    font-size: 0.9rem;
    color: #FFFFFF;
}

.site-footer strong {
    font-size: 1.05rem;
    color: #FFFFFF;
}

.site-footer a {
    color: var(--accent, #F2A900);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

.site-footer a:focus {
    outline: 2px solid var(--accent, #F2A900);
    outline-offset: 3px;
}

/* ======================================================
   7. RESPONSIVE ENHANCEMENTS (mobile-first, min-width only)
   Breakpoints: 480 / 768 / 1024 / 1280
====================================================== */

/* ---- 480px: larger phones ---- */
@media (min-width: 480px) {
  .btn,
  button,
  input[type="submit"] {
    padding: 12px 18px;
    font-size: 14px;
  }

  .logo a {
    font-size: 1.15rem;
  }
}

/* ---- 768px: tablets ---- */
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn,
  button,
  input[type="submit"] {
    min-width: 140px;
    max-width: none;
    padding: 13px 22px;
    font-size: 15px;
  }

  .logo a {
    font-size: 1.3rem;
    letter-spacing: 0.5px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .hero-slider {
    height: 460px;
  }

  .slide-content {
    left: 30px;
    right: 30px;
    bottom: 30px;
  }

  .cta-buttons {
    position: absolute;
    right: 30px;
    bottom: 30px;
    margin-top: 0;
    justify-content: flex-start;
  }

  .site-footer {
    padding: 60px 20px 30px;
  }

  .footer-logo img {
    height: 200px;
    max-width: 200px;
  }

  .site-footer strong {
    font-size: 1.15rem;
  }

  .site-footer p {
    font-size: 0.95rem;
  }
}

/* ---- 1024px: desktop ---- */
@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .btn,
  button,
  input[type="submit"] {
    min-width: 170px;
    padding: 14px 28px;
  }

  .logo a {
    font-size: clamp(1rem, 2vw, 1.6rem);
  }
}
/* ======================================================
   FINAL UPGRADE PATCH — Production Hardening Layer
====================================================== */

/* ================= 1. SAFE AREA SUPPORT (Mobile Notches) ================= */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.navbar {
  padding-top: calc(0px + env(safe-area-inset-top));
}

/* ================= 2. FIX ANCHOR SCROLL (Sticky Navbar Offset) ================= */
html {
  scroll-padding-top: 90px;
}

section, header, footer {
  scroll-margin-top: 90px;
}

/* ================= 3. ACCESSIBILITY: REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================= 4. HOVER ONLY ON DEVICES THAT SUPPORT IT ================= */
@media (hover: hover) {
  .card:hover,
  .program-card:hover,
  .btn:hover,
  .sidebar nav a:hover {
    will-change: transform;
  }
}

/* ================= 5. PRINT OPTIMIZATION ================= */
@media print {
  .navbar,
  .menu-toggle,
  .sidebar,
  .sidebar-overlay,
  .whatsapp-float,
  .call-float,
  .hero-slider {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .card,
  .program-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ================= 6. SIMPLE SKELETON LOADING STATES ================= */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e6e6e6 37%,
    #f0f0f0 63%
  );
  background-size: 400% 100%;
  animation: skeleton-loading 1.2s ease-in-out infinite;
  border-radius: 10px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ================= 7. SMOOTHER TAP EXPERIENCE (Mobile UX) ================= */
a, button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ================= END OF FINAL UPGRADE ================= */