/* ==========================================================================
   DEDICATED RESPONSIVE STYLESHEET FOR MOBILE & TABLET
   Project: IELTS with Arqum
   Rule: Zero impact on desktop viewports (>= 1024px).
   ========================================================================== */

/* Hide Mobile Hamburger Toggle on Desktop viewports by default */
.mobile-menu-toggle {
  display: none !important;
}

@media screen and (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   1. TABLET & MOBILE BREAKPOINTS (Max-Width: 1023px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1023px) {
  /* Box & Viewport Safety */
  *, *::before, *::after {
    box-sizing: border-box;
  }

  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
    -webkit-text-size-adjust: 100%;
  }

  img, video, canvas, svg {
    max-width: 100%;
    height: auto;
  }

  /* Content Containers Padding Overrides */
  .content-container {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  [style*="padding-left: 10%"],
  [style*="padding-left:10%"],
  [style*="padding-left: 5%"],
  [style*="padding-left:5%"] {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* ---------------- Header & Topbar ---------------- */
  /* Top Utility Bar */
  .w-full.bg-navy-deep {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .w-full.bg-navy-deep [style*="padding-top: 15px"] {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .w-full.bg-navy-deep .content-container,
  .w-full.bg-navy-deep > div {
    flex-direction: column !important;
    gap: 0.35rem !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Index Page Floating Capsule Header -> Clean Sticky Bar */
  header.h-0 {
    height: auto !important;
    position: sticky !important;
    top: 0 !important;
    pointer-events: auto !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    z-index: 990 !important;
  }

  header.h-0 > div {
    transform: none !important;
  }

  header.h-0 nav,
  header nav[style*="width: 80%"],
  header nav[style*="width:80%"] {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.65rem 1.25rem !important;
    margin: 0 !important;
    background: #ffffff !important;
  }

  /* Subpage Header Standard */
  header.sticky {
    position: sticky !important;
    top: 0 !important;
    z-index: 990 !important;
    background: #ffffff !important;
  }

  header .content-container {
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  /* Logo Sizing and Positioning */
  header img[src*="logo"],
  header img[alt*="IELTS"],
  header img[alt*="Logo"] {
    height: 38px !important;
    width: auto !important;
    max-width: 155px !important;
    object-fit: contain !important;
  }

  /* Hide Desktop Nav in Header on Tablet/Mobile */
  header nav.hidden.lg\:flex,
  header .hidden.lg\:flex,
  header nav > .hidden.lg\:flex {
    display: none !important;
  }

  /* Header Phone Widget - Hide verbose text & large svg on mobile header */
  header a[href^="tel:"] {
    display: none !important;
  }

  /* Header Avatar Icon sizing */
  header a[aria-label="Sign In"],
  header a[href="#apply"],
  header button[aria-label="User Profile"],
  header #userProfileBtn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  header a[aria-label="Sign In"] span,
  header a[href="#apply"] span,
  header button[aria-label="User Profile"] span,
  header #userProfileBtn span {
    font-size: 24px !important;
  }

  /* Mobile Hamburger Toggle Button */
  .mobile-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 8px;
    background-color: #f1f5f9;
    color: #07294d;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 0.4rem;
  }

  .mobile-menu-toggle:hover,
  .mobile-menu-toggle:focus {
    background-color: #e2e8f0;
    color: #0066cc;
  }

  .mobile-menu-toggle span {
    font-size: 26px;
    line-height: 1;
  }

  /* ---------------- HOME PAGE HERO SECTION CUSTOMIZATIONS ---------------- */
  /* Compact container with left and right margins */
  section.h-\[90vh\] {
    height: auto !important;
    min-height: auto !important;
    padding-top: 1.75rem !important;
    padding-bottom: 2rem !important;
    display: block !important;
  }

  section.h-\[90vh\] > div[style*="padding-left: 10%"],
  section.h-\[90vh\] .max-w-7xl {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 1rem !important;
  }

  /* Hide Instructor picture and target score badge on mobile */
  section.h-\[90vh\] .lg\:col-span-5,
  section.h-\[90vh\] img[src*="img_01.png"],
  section.h-\[90vh\] [style*="animation: floatSmooth"],
  section.h-\[90vh\] [style*="floatSmooth"] {
    display: none !important;
    visibility: hidden !important;
  }

  /* Make hero content full width & centered on tablet/mobile */
  section.h-\[90vh\] .lg\:col-span-7 {
    width: 100% !important;
    max-width: 100% !important;
    grid-column: 1 / -1 !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  /* Center Limited Seats badge with larger text */
  section.h-\[90vh\] .lg\:col-span-7 > div:first-child,
  section.h-\[90vh\] .inline-flex.items-center.gap-2\.5 {
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    padding: 0.45rem 1.25rem !important;
  }

  section.h-\[90vh\] .inline-flex.items-center.gap-2\.5 span {
    font-size: 0.95rem !important;
  }

  /* Hero Headline Centered & Significantly Larger Font */
  section.h-\[90vh\] h1,
  section.h-\[90vh\] .font-headline-xl {
    font-size: 3rem !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    text-align: center !important;
    margin-top: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
  }

  section.h-\[90vh\] h1 span {
    text-align: center !important;
  }

  /* Hero Subtitle Centered & Larger */
  section.h-\[90vh\] p {
    font-size: 1.12rem !important;
    line-height: 1.65 !important;
    text-align: center !important;
    margin-top: 0.5rem !important;
    margin-bottom: 1.25rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 650px !important;
    color: rgba(255, 255, 255, 0.92) !important;
  }

  /* Hero Action CTAs Centered */
  section.h-\[90vh\] .flex.flex-wrap.items-center.gap-4 {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.95rem !important;
    width: 100% !important;
    margin-top: 0.25rem !important;
    margin-bottom: 1.25rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  section.h-\[90vh\] .flex.flex-wrap.items-center.gap-4 a {
    font-size: 1.12rem !important;
    padding: 0.9rem 1.85rem !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Centered Stats Digits Grid */
  section.h-\[90vh\] .pt-6.border-t.grid,
  section.h-\[90vh\] .grid.grid-cols-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: 550px !important;
    padding-top: 1.35rem !important;
    margin-top: 0.5rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
  }

  section.h-\[90vh\] .pt-6.border-t.grid > div,
  section.h-\[90vh\] .grid.grid-cols-3 > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  section.h-\[90vh\] .pt-6.border-t.grid .text-headline-lg,
  section.h-\[90vh\] .grid.grid-cols-3 .text-headline-lg {
    font-size: 2.15rem !important;
    line-height: 1.1 !important;
    text-align: center !important;
    font-weight: 700 !important;
    margin-bottom: 0.2rem !important;
  }

  section.h-\[90vh\] .pt-6.border-t.grid .font-label-md,
  section.h-\[90vh\] .grid.grid-cols-3 .font-label-md {
    font-size: 0.92rem !important;
    text-align: center !important;
    color: #cbd5e1 !important;
  }

  /* ---------------- General Typography Scaling ---------------- */
  h1, .font-display-hero, .text-6xl, .text-5xl {
    font-size: 2.15rem !important;
    line-height: 1.2 !important;
  }

  h2, .font-headline-xl, .text-4xl, .text-3xl {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
  }

  h3, .font-headline-lg, .text-2xl {
    font-size: 1.3rem !important;
    line-height: 1.3 !important;
  }

  /* Subpage Hero Banners */
  section.relative.py-16,
  section.relative.py-20,
  section.pt-16.pb-20,
  section.py-24 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* ---------------- Grid & Flex Layout Stacking ---------------- */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-12,
  .lg\:grid-cols-2,
  .lg\:grid-cols-3,
  .lg\:grid-cols-4,
  .lg\:grid-cols-12,
  .md\:grid-cols-2,
  .md\:grid-cols-3,
  .md\:grid-cols-4 {
    grid-template-columns: 1fr !important;
  }

  .lg\:col-span-8,
  .lg\:col-span-7,
  .lg\:col-span-6,
  .lg\:col-span-5,
  .lg\:col-span-4,
  .md\:col-span-8,
  .md\:col-span-6,
  .md\:col-span-4 {
    grid-column: span 1 / span 1 !important;
  }

  .lg\:flex-row,
  .md\:flex-row {
    flex-direction: column !important;
  }

  /* Sticky Sidebars / Pricing Cards Stacking */
  .sticky.top-28,
  .sticky.top-24,
  .sticky.top-20,
  .sticky.top-6 {
    position: static !important;
    margin-top: 1.5rem !important;
    width: 100% !important;
  }

  /* Horizontal Filter Pills Bar */
  .overflow-x-auto {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .overflow-x-auto::-webkit-scrollbar {
    display: none !important;
  }

  /* Tables horizontal scroll wrapper */
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* --------------------------------------------------------------------------
   2. MOBILE DRAWER NAVIGATION OVERLAY & PANEL
   -------------------------------------------------------------------------- */
.mobile-nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 41, 77, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88%;
  max-width: 360px;
  background-color: #ffffff;
  z-index: 99999;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-drawer.active {
  transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  background-color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.drawer-header img {
  height: 36px;
  width: auto;
}

.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

/* Drawer Body */
.drawer-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.drawer-auth-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  background: linear-gradient(135deg, #07294d 0%, #1d72fe 100%);
  color: #ffffff !important;
  border-radius: 10px;
  text-decoration: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 4px 12px rgba(29, 114, 254, 0.25);
  transition: all 0.2s ease;
}

.drawer-auth-badge:hover,
.drawer-auth-badge.active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(29, 114, 254, 0.35);
  background: linear-gradient(135deg, #041b33 0%, #0052cc 100%);
}

.drawer-nav-item {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1e293b;
  padding: 0.75rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f8fafc;
}

.drawer-nav-item:hover,
.drawer-nav-item.active {
  color: #0066cc;
  background-color: #eff6ff;
  padding-left: 0.85rem;
}

/* Drawer Accordions */
.drawer-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1e293b;
  padding: 0.75rem 0.65rem;
  border-radius: 8px;
  background: none;
  border: none;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.drawer-accordion-btn:hover {
  color: #0066cc;
  background-color: #eff6ff;
}

.drawer-accordion-icon {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0066cc;
  transition: transform 0.25s ease;
}

.drawer-accordion-btn.expanded .drawer-accordion-icon {
  transform: rotate(45deg);
}

.drawer-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #f8fafc;
  border-radius: 8px;
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
}

.drawer-accordion-content.open {
  max-height: 450px;
}

.drawer-sub-link {
  display: block;
  padding: 0.65rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.925rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.drawer-sub-link:hover,
.drawer-sub-link.active {
  color: #0066cc;
  background-color: #e0f2fe;
  border-left-color: #0066cc;
  padding-left: 1.5rem;
}

/* Drawer Footer */
.drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.drawer-phone-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.drawer-phone-card:hover {
  border-color: #0066cc;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.12);
}

.drawer-phone-card img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.drawer-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem;
  background: #07294d;
  color: #ffffff;
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s;
}

.drawer-cta-btn:hover {
  background: #0066cc;
}

.drawer-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.drawer-social-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #07294d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.2s;
}

.drawer-social-icon:hover {
  background: #0066cc;
  color: #ffffff;
}

body.drawer-open {
  overflow: hidden !important;
}

/* --------------------------------------------------------------------------
   3. SMARTPHONE SPECIFIC (Max-Width: 640px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 640px) {
  .content-container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  [style*="padding-left: 10%"],
  [style*="padding-left:10%"] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Home Hero on small screens */
  section.h-\[90vh\] > div[style*="padding-left: 10%"],
  section.h-\[90vh\] .max-w-7xl {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  section.h-\[90vh\] h1,
  section.h-\[90vh\] .font-headline-xl {
    font-size: 2.75rem !important;
    line-height: 1.15 !important;
    text-align: center !important;
  }

  section.h-\[90vh\] p {
    font-size: 1.08rem !important;
    line-height: 1.6 !important;
    text-align: center !important;
  }

  /* General Typography */
  h1, .font-display-hero, .text-6xl, .text-5xl {
    font-size: 1.85rem !important;
    line-height: 1.22 !important;
  }

  h2, .font-headline-xl, .text-4xl, .text-3xl {
    font-size: 1.45rem !important;
    line-height: 1.25 !important;
  }

  /* Section Paddings */
  .py-16, .py-20, .py-24, .py-28 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .gap-8, .gap-10, .gap-12 {
    gap: 1.25rem !important;
  }

  /* Footer Stacking */
  footer .grid,
  footer .grid-cols-4,
  footer .grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }

  /* Form Elements */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Calculator Mobile Styles */
  .inputs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .input-group input {
    padding: 0.75rem !important;
    font-size: 1.5rem !important;
  }

  .result-box {
    padding: 1rem 2rem !important;
  }

  .result-box span {
    font-size: 2.75rem !important;
  }

  /* Action Buttons cluster */
  .flex.flex-wrap.items-center.gap-4 {
    gap: 0.75rem !important;
  }

  .flex.flex-wrap.items-center.gap-4 a {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* --------------------------------------------------------------------------
   4. SMALL SMARTPHONE (Max-Width: 480px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 480px) {
  section.h-\[90vh\] h1,
  section.h-\[90vh\] .font-headline-xl {
    font-size: 2.45rem !important;
    line-height: 1.16 !important;
    text-align: center !important;
  }

  section.h-\[90vh\] p {
    font-size: 1.02rem !important;
    line-height: 1.55 !important;
    text-align: center !important;
  }

  h1, .font-display-hero, .text-6xl {
    font-size: 1.65rem !important;
  }

  .inputs-grid {
    grid-template-columns: 1fr !important;
  }
}
