/* ============================================
   AMAX DIGITAL - RESPONSIVE STYLES
   Mobile-First Design Breakpoints
   ============================================ */

/* ============================================
   BREAKPOINTS
   ============================================ */
/*
   xs: 0-639px (mobile)
   sm: 640px-767px (large mobile)
   md: 768px-1023px (tablet)
   lg: 1024px-1279px (desktop)
   xl: 1280px+ (large desktop)
*/

/* ============================================
   TABLET STYLES (768px and up)
   ============================================ */
@media screen and (min-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }

  .section {
    padding: var(--space-4xl) 0;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-buttons {
    flex-wrap: nowrap;
  }

  /* Reset mobile menu styles for tablet and above */
  .navbar-toggle {
    display: none;
  }

  .navbar-menu {
    position: static;
    left: auto;
    width: auto;
    height: auto;
    max-width: none;
    background-color: transparent;
    backdrop-filter: none;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-lg);
    padding: 0;
    overflow-y: visible;
    z-index: auto;
    transition: none;
    border-right: none;
    box-shadow: none;
  }

  .navbar-menu::before {
    display: none;
  }

  .navbar-menu li {
    width: auto;
    border-bottom: none;
    padding: 0;
  }

  .navbar-link {
    padding: 0.5rem 0.75rem;
    font-size: var(--fs-sm);
    color: var(--neutral-600);
    width: auto;
  }

  .navbar-link::after {
    display: block;
  }

  .navbar-link:hover {
    background-color: transparent;
  }

  .navbar-cta {
    margin-left: var(--space-md);
    margin-top: 0;
    width: auto;
  }

  .navbar-cta .btn {
    display: inline-block;
    width: auto;
  }

  body.menu-open {
    overflow: auto;
  }
}

/* ============================================
   DESKTOP STYLES (1024px and up)
   ============================================ */
@media screen and (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   MOBILE STYLES (max-width: 767px)
   ============================================ */
@media screen and (max-width: 767px) {
  /* Typography Adjustments */
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }

  /* Navigation Mobile - Redesigned */
  .navbar-container {
    height: 70px;
    padding: 0 var(--space-md);
  }

  /* Show hamburger button on mobile */
  .navbar-toggle {
    display: flex;
    z-index: 10002;
  }

  .navbar-toggle span {
    background-color: #ffffff !important;
  }

  /* Mobile menu - slides from right like horison */
  .navbar-menu {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    bottom: 0 !important;
    left: auto !important;
    width: 80% !important;
    max-width: 350px !important;
    height: 100vh !important;
    min-height: 100vh !important;
    background: #000000 !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.8) !important;
    padding: 5rem 2rem 2rem !important;
    z-index: 10001 !important;
    transition: right 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    overflow-y: auto !important;
    border-left: 2px solid var(--primary-cyan) !important;
    margin: 0 !important;
    transform: none !important;
  }

  .navbar-menu.active {
    right: 0 !important;
  }

  /* Mobile menu items */
  .navbar-menu li {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  /* Mobile menu links */
  .navbar-link {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: #ffffff !important;
    border-radius: 8px;
    transition: all 0.2s ease;
  }

  .navbar-link:hover,
  .navbar-link.active {
    background-color: rgba(133, 242, 242, 0.15);
    color: var(--primary-cyan) !important;
    transform: translateX(5px);
  }

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

  /* Hide CTA button on mobile */
  .navbar-cta {
    display: none !important;
  }

  /* Mobile menu backdrop overlay */
  body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10000;
    pointer-events: none;
  }

  body.menu-open::after {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

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

  /* Hamburger animation */
  .navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }

  .navbar-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Hero Section Mobile */
  .hero {
    min-height: 90vh;
    padding-top: 70px;
  }

  .hero-title {
    font-size: var(--fs-3xl);
  }

  .hero-description {
    font-size: var(--fs-lg);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

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

  /* Section Adjustments */
  .section {
    padding: var(--space-2xl) 0;
  }

  .section-lg {
    padding: var(--space-3xl) 0;
  }

  .section-header {
    margin-bottom: var(--space-2xl);
  }

  .section-title {
    font-size: var(--fs-2xl);
  }

  .section-description {
    font-size: var(--fs-base);
  }

  /* Grid Adjustments */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .stat-number {
    font-size: var(--fs-3xl);
  }

  /* Card Adjustments */
  .card-image {
    height: 180px;
  }

  .card-body {
    padding: var(--space-md);
  }

  /* Footer */
  .footer {
    padding: var(--space-2xl) 0 var(--space-md);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Button Sizes */
  .btn {
    padding: 0.75rem 1.5rem;
  }

  .btn-large {
    padding: 0.875rem 2rem;
    font-size: var(--fs-base);
  }

  /* Spacing Utilities Mobile */
  .container {
    padding: 0 var(--space-sm);
  }

  .mb-xl {
    margin-bottom: var(--space-lg);
  }
}

/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */
@media screen and (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: var(--fs-2xl);
  }

  .section-title {
    font-size: var(--fs-xl);
  }

  .card-icon {
    width: 50px;
    height: 50px;
    font-size: var(--fs-xl);
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: var(--fs-sm);
  }
}

/* ============================================
   LARGE DESKTOP (1440px and up)
   ============================================ */
@media screen and (min-width: 1440px) {
  .container {
    max-width: var(--container-2xl);
  }

  .section {
    padding: 120px 0;
  }

  .hero {
    min-height: 100vh;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .navbar,
  .navbar-toggle,
  .btn,
  .footer {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
  }

  .hero {
    min-height: auto;
    padding: 20px 0;
  }

  .section {
    page-break-inside: avoid;
    padding: 20px 0;
  }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
  :root {
    --primary-cyan: #0052a3;
    --neutral-700: #2c2c2c;
    --neutral-800: #1a1a1a;
  }

  .btn {
    border-width: 3px;
  }

  .card {
    border: 2px solid var(--neutral-300);
  }
}

/* ============================================
   CUSTOM MOBILE UPDATES - Hero with Lottie
   ============================================ */

/* Tablet Hero Layout Adjustment */
@media screen and (max-width: 1024px) {
  .hero-content {
    min-width: auto;
  }
}

/* Mobile Hero Layout with Lottie */
@media screen and (max-width: 767px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .hero-animation {
    max-width: 400px;
    height: 400px;
    order: -1;
  }

  .hero-content {
    text-align: center;
    min-width: auto;
    max-width: 100%;
  }

  .logo-img {
    height: 35px;
  }
}

@media screen and (max-width: 480px) {
  .hero-animation {
    max-width: 300px;
    height: 300px;
  }

  .logo-img {
    height: 30px;
  }
}

/* ============================================
   MOBILE HEADER STACKING FIXES
   ============================================ */
@media screen and (max-width: 767px) {
  /* Put the whole header above the overlay */
  .navbar {
    z-index: 10050 !important;
  }

  /* Menu above everything else */
  .navbar-menu {
    z-index: 10060 !important;
  }

  /* Backdrop stays below menu/header */
  body::after {
    z-index: 10000 !important;
  }

  /* Toggle button above everything */
  .navbar-toggle {
    z-index: 10070 !important;
  }
}
