/* ==========================================================================
   ISLAMIC NET GLOBAL EDUCATION - RESPONSIVE STYLESHEET
   Comprehensive Breakpoint Support (320px to 1920px)
   ========================================================================== */

/* Global Reset Guards for Mobile Overflow */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
  margin: 0;
  padding: 0;
}

/* Text Wrapping & Overflow Guards */
p, h1, h2, h3, h4, h5, h6, span, a, li, label, td, th {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.card, .form-card, .footer-col, .hero-content, .hero-image-col {
  min-width: 0;
}

/* Large Screens (1440px+) */
@media (min-width: 1440px) {
  .container {
    max-width: 1380px;
  }
  .nav-links {
    gap: 1.4rem;
  }
  .nav-link {
    font-size: 0.95rem;
  }
  .hero-headline {
    font-size: 3.5rem;
  }
}

/* Laptop / Standard Desktop (1200px to 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
  .container {
    max-width: 1180px;
  }
  .nav-links {
    gap: 1rem;
  }
  .nav-link {
    font-size: 0.88rem;
  }
  .btn-primary {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }
  .hero-headline {
    font-size: 2.85rem;
  }
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 2rem;
  }
}

/* Medium Desktop / Compact Laptop (1081px to 1199px) */
@media (min-width: 1081px) and (max-width: 1199px) {
  .container {
    max-width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .logo-title {
    font-size: 1rem;
  }
  .logo-subtitle {
    font-size: 0.68rem;
  }
  .nav-links {
    gap: 0.75rem;
  }
  .nav-link {
    font-size: 0.82rem;
  }
  .btn-primary {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

/* Global Viewport Containment */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Ensure all media assets resize fluidly */
img, video, iframe, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Mobile & Tablet Navigation Switch (Max 1080px) */
@media (max-width: 1080px) {
  /* Footer CTA Banner Responsive */
  .footer-cta-card {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  .footer-cta-text {
    max-width: 100%;
  }

  /* Footer Grid Tablet Layout (2 Columns) */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.25rem;
  }

  /* Hide Top Bar on mobile/tablet to keep header height compact */
  .top-bar {
    display: none;
  }

  .navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .navbar-content {
    height: 64px;
  }

  .logo-img {
    width: 44px;
    height: 44px;
  }

  .logo-title {
    font-size: 0.95rem;
  }

  .logo-subtitle {
    font-size: 0.65rem;
  }

  /* Hide the desktop Book Free Trial button in navbar action area on mobile */
  .nav-actions .btn {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background-color: rgba(11, 27, 61, 0.05);
    border: 1px solid var(--color-border-light);
    color: var(--color-navy-main);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-toggle:hover {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--color-royal-main);
  }

  /* Slide-down / Slide-in Mobile Drawer Menu */
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: calc(100vh - 64px);
    background-color: #FFFFFF;
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    overflow-y: auto;
    z-index: 9999;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    font-size: 1.05rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-navy-main);
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.active {
    color: var(--color-royal-main);
    font-weight: 700;
  }

  .mobile-menu-cta {
    margin-top: 1.25rem;
    display: block;
    width: 100%;
  }

  .mobile-menu-cta .btn {
    display: flex !important;
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 0.85rem;
    font-size: 1rem;
  }

  /* Section Spacing */
  .section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.85rem;
  }

  /* Hero Section Mobile Polish */
  .hero {
    padding: 2.5rem 0 3.5rem 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-tag {
    font-size: 0.825rem;
    padding: 0.35rem 0.85rem;
  }

  .hero-headline {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.2;
  }

  .hero-description {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.85rem;
  }

  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-trust-bar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .hero-badge-float {
    position: relative;
    bottom: auto;
    left: auto;
    margin: 1rem auto 0 auto;
    width: 100%;
    max-width: 320px;
  }
}

/* Tablet Screens (Max 768px) */
@media (max-width: 768px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Mobile Screens (Max 600px) */
@media (max-width: 600px) {
  html {
    font-size: 14px !important; /* Scale base font size down cleanly for mobile per user request */
  }

  body {
    overflow-x: clip !important;
  }

  .container {
    padding: 0 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Compact Mobile Typography */
  .section-title {
    font-size: clamp(1.3rem, 5.5vw, 1.65rem) !important;
    line-height: 1.25 !important;
  }

  .section-subtitle {
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
  }

  .hero-headline {
    font-size: clamp(1.5rem, 6vw, 2.1rem) !important;
    line-height: 1.2 !important;
  }

  .hero-description {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1.25rem !important;
  }

  .hero-tag {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.75rem !important;
  }

  .btn {
    white-space: normal !important;
    text-align: center !important;
    padding: 0.65rem 1rem !important;
    word-break: break-word !important;
    max-width: 100% !important;
    font-size: 0.875rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .card, .form-card, .contact-channel-card {
    padding: 1rem 1.15rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .contact-channel-card {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.85rem !important;
  }

  .contact-channel-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
  }

  .contact-channel-icon svg {
    width: 22px !important;
    height: 22px !important;
  }

  .contact-channel-value {
    font-size: 0.95rem !important;
    word-break: break-all !important;
  }

  .contact-email-link {
    font-size: 0.82rem !important;
    word-break: break-all !important;
  }

  .contact-social-links {
    gap: 0.6rem !important;
    font-size: 0.85rem !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .form-control, .form-select {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 0.875rem !important;
    padding: 0.6rem 0.85rem !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    gap: 0.5rem !important;
    text-align: center !important;
    font-size: 0.8rem !important;
  }

  .whatsapp-float {
    width: 48px !important;
    height: 48px !important;
    bottom: 1rem !important;
    right: 1rem !important;
  }

  .whatsapp-float svg {
    width: 24px !important;
    height: 24px !important;
  }

  /* Admin Tables Responsiveness */
  .admin-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }
}

/* Extra Small Screens (320px to 380px) */
@media (max-width: 380px) {
  html {
    font-size: 13.5px !important;
  }

  .container {
    padding: 0 0.75rem !important;
  }

  .logo-title {
    font-size: 0.82rem !important;
  }

  .logo-subtitle {
    font-size: 0.58rem !important;
  }

  .hero-headline {
    font-size: 1.45rem !important;
  }

  .section-title {
    font-size: 1.35rem !important;
  }

  .btn {
    padding: 0.6rem 0.75rem !important;
    font-size: 0.82rem !important;
  }

  .contact-channel-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
}

