/* ========================================
   XONIX - Responsive Design
   Mobile-First Approach
   ======================================== */

/* ========================================
   Extra Small Devices (Mobile, 320px+)
   ======================================== */

@media (max-width: 575.98px) {
  :root {
    font-size: 14px;
  }

  /* Typography */
  h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 1.25rem !important;
  }

  h4 {
    font-size: 1.1rem !important;
  }

  p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* Navigation */
  .navbar {
    padding: 0.5rem 0;
  }

  .logo-img {
    height: 40px !important;
  }

  .navbar-nav {
    gap: 0 !important;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem;
  }

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

  .hero-heading {
    font-size: 1.75rem !important;
    margin-bottom: 0.75rem;
  }

  .hero-subheading {
    font-size: 1rem !important;
    margin-bottom: 1rem;
  }

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

  .glass-badge {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    max-width: 90%;
  }

  /* Buttons */
  .btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
  }

  .btn-lg {
    padding: 0.65rem 1.25rem !important;
    font-size: 0.9rem !important;
  }

  /* CTA Buttons Container */
  .btn-play {
    flex-direction: column;
    gap: 0.5rem;
  }

  .play-icon {
    width: 40px;
    height: 40px;
    margin-left: 0 !important;
  }

  /* Sections */
  .section {
    padding: 3rem 0;
  }

  .section-heading {
    font-size: 1.75rem !important;
    margin-bottom: 1rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
  }

  .section-badge {
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
  }

  /* Grids */
  .products-grid,
  .services-grid,
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Cards */
  .product-card,
  .service-card,
  .stat-card,
  .glass-morphism {
    padding: 1rem !important;
  }

  .product-card {
    border-radius: 0.75rem !important;
  }

  .product-stats {
    gap: 0.5rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  /* About Section */
  .about-features {
    margin: 1rem 0;
  }

  .feature-box {
    padding: 0.75rem !important;
    gap: 0.75rem;
  }

  .feature-box h5 {
    font-size: 0.9rem;
  }

  .feature-box p {
    font-size: 0.8rem;
  }

  /* Contact */
  .contact-info {
    padding: 1rem !important;
  }

  .contact-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }

  .form-label {
    font-size: 0.85rem;
  }

  /* Footer */
  .footer-section {
    padding-top: 2rem;
  }

  .footer-logo {
    height: 40px;
  }

  .footer-links li {
    margin-bottom: 0.5rem;
  }

  .footer-links a {
    font-size: 0.9rem;
  }

  .section-heading {
    font-size: 1.5rem;
  }

  /* Mobile Menu */
  .mobile-menu {
    width: 100% !important;
  }

  /* Animations - Reduce intensity */
  .animate-float {
    animation-duration: 4s;
  }

  .orb-1,
  .orb-2 {
    width: 250px !important;
    height: 250px !important;
  }

  .neural-particle {
    width: 2px;
    height: 2px;
  }

  /* Touch targets */
  button,
  a,
  .nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Form inputs */
  input,
  textarea,
  select {
    font-size: 1rem !important; /* Prevent zoom on iOS */
    min-height: 44px;
  }

  /* Landscape optimization */
  @media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
      min-height: 100vh;
      padding-top: 50px;
    }

    .section {
      padding: 2rem 0;
    }
  }
}

/* ========================================
   Small Devices (Tablets, 576px+)
   ======================================== */

@media (min-width: 576px) and (max-width: 767.98px) {
  h1 {
    font-size: 2.5rem !important;
  }

  h2 {
    font-size: 2rem !important;
  }

  .hero-heading {
    font-size: 2.5rem !important;
  }

  .hero-subheading {
    font-size: 1.25rem !important;
  }

  .section-heading {
    font-size: 2rem !important;
  }

  .products-grid,
  .services-grid {
    grid-template-columns: 1fr !important;
  }

  .section {
    padding: 4rem 0;
  }

  .btn {
    padding: 0.65rem 1.25rem !important;
    font-size: 0.9rem !important;
  }
}

/* ========================================
   Medium Devices (Tablets, 768px+)
   ======================================== */

@media (min-width: 768px) and (max-width: 991.98px) {
  h1 {
    font-size: 3rem !important;
  }

  h2 {
    font-size: 2.25rem !important;
  }

  .hero-heading {
    font-size: 3.5rem !important;
  }

  .hero-subheading {
    font-size: 1.5rem !important;
  }

  .section-heading {
    font-size: 2.5rem !important;
  }

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

  .section {
    padding: 5rem 0;
  }

  .btn {
    padding: 0.75rem 1.5rem !important;
  }

  /* Tablet menu enhancement */
  .navbar-nav {
    gap: 1rem !important;
  }

  .container-custom {
    padding: 0 1.5rem;
  }
}

/* ========================================
   Large Devices (Desktops, 992px+)
   ======================================== */

@media (min-width: 992px) and (max-width: 1199.98px) {
  h1 {
    font-size: 3.5rem !important;
  }

  h2 {
    font-size: 2.75rem !important;
  }

  .hero-heading {
    font-size: 4rem !important;
  }

  .hero-subheading {
    font-size: 1.75rem !important;
  }

  .section-heading {
    font-size: 3rem !important;
  }

  .section {
    padding: 6rem 2rem;
  }

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

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

  /* Navbar optimization */
  .navbar-nav {
    gap: 2rem !important;
  }
}

/* ========================================
   Extra Large Devices (Large Desktops, 1200px+)
   ======================================== */

@media (min-width: 1200px) and (max-width: 1399.98px) {
  h1 {
    font-size: 3.75rem !important;
  }

  h2 {
    font-size: 3rem !important;
  }

  .hero-heading {
    font-size: 4.5rem !important;
  }

  .hero-subheading {
    font-size: 2rem !important;
  }

  .section-heading {
    font-size: 3.25rem !important;
  }

  .section {
    padding: 6rem 0;
  }

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

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

/* ========================================
   Ultra Wide Screens (1400px+)
   ======================================== */

@media (min-width: 1400px) {
  :root {
    font-size: 16px;
  }

  h1 {
    font-size: 4rem !important;
  }

  h2 {
    font-size: 3.25rem !important;
  }

  .hero-heading {
    font-size: 5rem !important;
  }

  .hero-subheading {
    font-size: 2.25rem !important;
  }

  .section-heading {
    font-size: 3.5rem !important;
  }

  .section {
    padding: 7rem 0;
  }

  .container-custom {
    max-width: 1400px !important;
  }

  .products-grid,
  .services-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

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

  /* Enhanced animations on larger screens */
  .orb-1,
  .orb-2 {
    width: 500px !important;
    height: 500px !important;
  }

  .hero-section {
    min-height: 110vh;
  }
}

/* ========================================
   Orientation-Specific Styles
   ======================================== */

/* Portrait Orientation */
@media (orientation: portrait) {
  .hero-section {
    min-height: 100vh;
  }

  .section {
    padding: 4rem 0;
  }
}

/* Landscape Orientation */
@media (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: 60px 0;
  }

  .hero-heading {
    font-size: 2.5rem !important;
  }

  .hero-subheading {
    font-size: 1rem !important;
  }

  .hero-description {
    font-size: 0.85rem;
  }

  .section {
    padding: 3rem 0;
  }
}

/* ========================================
   High Resolution Displays
   ======================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Enhance text rendering on high DPI */
  html {
    -webkit-font-smoothing: subpixel-antialiased;
  }

  /* Slightly increase touch targets */
  button,
  a {
    min-height: 48px;
  }
}

/* ========================================
   Touch Device Optimizations
   ======================================== */

@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn:hover {
    transform: none;
    box-shadow: none;
  }

  .glass-morphism:hover {
    transform: none;
  }

  /* Increase touch target sizes */
  .btn,
  button,
  a {
    min-height: 48px;
    min-width: 48px;
  }

  /* Reduce motion for touch devices */
  .animate-float,
  .animate-glow,
  .animate-pulse {
    animation-duration: 8s;
  }
}

/* ========================================
   Dark Mode Support
   ======================================== */

@media (prefers-color-scheme: dark) {
  /* Already dark by default, no changes needed */
}

@media (prefers-color-scheme: light) {
  /* Optional: Light theme support */
  body {
    background: #f9fafb;
    color: #1f2937;
  }

  .text-light {
    color: #374151 !important;
  }

  .section-background {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  }
}

/* ========================================
   Reduced Motion Support
   ======================================== */

@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;
  }

  .float {
    animation: none;
  }

  .hover-scale:hover,
  .hover-lift:hover {
    transform: none;
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .navbar-section,
  .hero-section,
  .footer-section {
    display: none;
  }

  .section {
    page-break-inside: avoid;
    padding: 1rem 0;
  }

  * {
    animation: none !important;
    transition: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .text-light,
  .text-muted {
    color: #666 !important;
  }

  .glass-morphism {
    background: transparent !important;
    border: 1px solid #ccc !important;
  }
}

/* ========================================
   Specific Component Responsive Adjustments
   ======================================== */

/* Contact Form */
@media (max-width: 767.98px) {
  .contact-info {
    margin-bottom: 1.5rem;
  }

  .form-control-custom {
    margin-bottom: 1rem;
  }
}

/* Product Cards */
@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Footer Responsive */
@media (max-width: 767.98px) {
  .footer-section .row {
    text-align: center;
  }

  .footer-links {
    margin-bottom: 1.5rem;
  }
}

/* Navbar Responsive */
@media (max-width: 991.98px) {
  .navbar-collapse {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 158, 255, 0.2);
  }

  .btn-primary {
    width: 100%;
    margin-top: 1rem;
  }
}

/* Hero CTA Buttons */
@media (max-width: 575.98px) {
  .btn-play {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .btn-play span {
    margin-left: 0 !important;
  }
}

@media (min-width: 576px) {
  .btn-play {
    flex-direction: row;
  }
}
