/* EQAIC Responsive Styles - Mobile First */

/* Extra Small Devices (320px - 479px) */
@media (max-width: 479px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.125rem;
  }
  
  .section {
    padding: var(--spacing-xl) 0;
  }
  
  .btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
  }
  
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  /* Hero/Banner Mobile Fixes */
  .banner {
    min-height: 500px;
    padding: 2rem 0 6rem;
  }
  
  .banner h1 {
    font-size: 1.5rem !important;
    line-height: 1.4;
    margin-bottom: 1rem;
  }
  
  .banner p {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
  
  .banner-content {
    padding: 1rem;
  }
  
  .banner-actions {
    margin-bottom: 3rem;
    gap: 0.75rem;
  }
  
  .banner-actions .btn {
    font-size: 0.9375rem;
    padding: 0.875rem 1.5rem;
  }
  
  .banner-features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
  }
  
  .banner-feature-box {
    padding: 1.25rem;
  }
  
  .banner-feature-box h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .banner-feature-box p {
    font-size: 0.875rem;
  }
  
  .intro-grid {
    grid-template-columns: 1fr;
  }
  
  .intro-features {
    grid-template-columns: 1fr;
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .process-steps::before {
    left: 16px;
  }
  
  .process-step {
    padding-left: 3.5rem;
  }
  
  .process-step::before {
    width: 45px;
    height: 45px;
    font-size: 1.125rem;
  }
}

/* Small Devices (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
  
  /* Hero/Banner for larger mobile */
  .banner {
    min-height: 550px;
    padding: 2.5rem 0 6rem;
  }
  
  .banner h1 {
    font-size: 2rem !important;
    line-height: 1.3;
  }
  
  .banner p {
    font-size: 1rem;
  }
  
  .banner-actions {
    margin-bottom: 3.5rem;
  }
  
  .banner-features-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .banner-feature-box {
    padding: 1.5rem;
  }
  
  .banner {
    padding: 5rem 0 9rem;
  }
  
  .banner-features-grid {
    grid-template-columns: 1fr;
  }
  
  .intro-grid {
    grid-template-columns: 1fr;
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium Devices - Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .col-md-6 {
    width: 50%;
  }
  
  .col-md-8 {
    width: 66.666%;
  }
  
  .col-md-4 {
    width: 33.333%;
  }
  
  .grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .banner-features-grid {
    grid-template-columns: 1fr;
  }
  
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large Devices - Laptops (1024px+) */
@media (min-width: 1024px) {
  .col-lg-3 {
    width: 25%;
  }
  
  .col-lg-4 {
    width: 33.333%;
  }
  
  .col-lg-6 {
    width: 50%;
  }
  
  .col-lg-8 {
    width: 66.666%;
  }
  
  .grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Extra Large Devices (1440px+) */
@media (min-width: 1440px) {
  .container {
    max-width: 1280px;
  }
  
  .section {
    padding: 5rem 0;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn,
  a,
  button,
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  .card:hover {
    transform: none;
  }
}

/* Landscape orientation handling */
@media (max-width: 767px) and (orientation: landscape) {
  .section {
    padding: var(--spacing-lg) 0;
  }
}

/* Mobile Specific Fixes */
@media (max-width: 767px) {
  /* Ensure ALL grids stack vertically on mobile */
  .grid,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .benefits-grid,
  .stats-grid,
  .intro-grid,
  .banner-features-grid,
  .accreditation-cards,
  .scholarship-cards,
  .testimonial-grid,
  .leaders-grid,
  .mission-vision-cards,
  .value-cards,
  .types-grid,
  .principles-grid,
  .standards-grid,
  .commitment-grid {
    grid-template-columns: 1fr !important;
    gap: var(--spacing-md);
  }
  
  .banner-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .banner-actions .btn {
    width: 100%;
  }
  
  .cta-section .banner-actions {
    flex-direction: column;
  }
  
  .cta-section .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .intro-image {
    order: -1;
  }
  
  .card {
    margin-bottom: var(--spacing-md);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .testimonial-author {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .leader-card {
    text-align: center;
  }
  
  .institution-card {
    margin-bottom: var(--spacing-md);
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .filter-actions .btn {
    width: 100%;
  }
  
  /* Banner feature boxes stack vertically */
  .banner-feature-box {
    width: 100%;
    margin-bottom: var(--spacing-md);
  }
  
  /* Intro features stack */
  .intro-features {
    grid-template-columns: 1fr !important;
  }
  
  .intro-feature-item {
    text-align: center;
  }
  
  /* Make sure cards don't exceed screen width */
  .card,
  .benefit-item,
  .stat-card,
  .scholarship-card,
  .testimonial-card,
  .accreditation-card {
    max-width: 100%;
  }
  
  /* Ensure images are responsive */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Stack flex containers */
  .flex-row {
    flex-direction: column;
  }
}

/* Tablet Landscape Fixes */
@media (min-width: 768px) and (max-width: 1023px) {
  .banner-features-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
  }
}

/* Mobile Mega Menu Navigation */
@media (max-width: 1023px) {
  .nav-menu {
    flex-direction: column;
  }
  
  .nav-menu .nav-row {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }
  
  .nav-menu .mega-menu {
    position: static !important;
    display: none;
    grid-template-columns: 1fr !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    margin: 0.5rem 0 !important;
    padding: 1rem !important;
    border-radius: 12px !important;
    opacity: 1 !important;
    transform: none !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    gap: 1.5rem !important;
    left: 0 !important;
  }
  
  .nav-menu .mega-menu-column {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  
  .nav-menu .has-dropdown.active .mega-menu {
    display: grid;
  }
  
  .nav-menu .mega-menu-column h4 {
    color: #1e264b;
    font-size: 0.75rem;
    border-bottom-color: #e2e8f0;
    margin-bottom: 0.5rem;
  }
  
  .nav-menu .mega-menu a {
    color: #1e264b;
    font-size: 0.9375rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 0.625rem 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  
  .nav-menu .mega-menu a::before {
    display: none;
  }
  
  .nav-menu .mega-menu a:hover {
    background: rgba(30, 38, 75, 0.1);
    color: #1e264b;
    color: white;
    padding-left: 1.5rem;
  }
  
  .nav-menu .has-dropdown > a::after {
    content: '▼';
    font-size: 0.625rem;
    margin-left: auto;
    opacity: 0.7;
    transition: transform 0.3s ease;
  }
  
  .nav-menu .has-dropdown.active > a::after {
    transform: rotate(180deg);
  }
  
  .nav-menu .mega-menu .apply-link {
    background: rgba(14, 165, 233, 0.25);
    color: #1e264b;
    border-radius: 8px;
    margin: 0.5rem 0;
    font-weight: 600;
  }
  
  .nav-menu .mega-menu .apply-link:hover {
    background: rgba(14, 165, 233, 0.35);
    color: white;
    transform: none;
    padding-left: 1.5rem;
  }
}

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  .btn,
  .nav-menu {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .section {
    padding: 1rem 0;
  }
}
