/* ===================================
   LEGION OFFENSIVE SECURITY
   Responsive Design Stylesheet
   Mobile-First Approach
   =================================== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .container {
    max-width: 1600px;
  }
}

/* Desktop (1200px - 1399px) */
@media (max-width: 1399px) {
  .hero-content h2 {
    font-size: 52px;
  }
}

/* Large Tablets & Small Desktops (992px - 1199px) */
@media (max-width: 1199px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .network-container {
    width: 100%;
    max-width: 550px;
    height: 550px;
    margin: 0 auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-container {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .cert-slider-section {
    position: relative;
    top: 0;
  }

  .hero-content h2 {
    font-size: 48px;
  }

  .page-hero h1 {
    font-size: 56px;
  }
}

/* Tablets (768px - 991px) */
@media (max-width: 991px) {
  .container,
  .header-inner,
  .footer-inner {
    padding: 0 30px;
  }

  nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-nav {
    display: none;
    position: fixed;
    top: 81px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }

  .mobile-nav.active {
    display: block;
  }

  .mobile-nav a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    font-size: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.3s;
  }

  .mobile-nav a:hover {
    color: var(--accent);
  }

  .hero-content h2 {
    font-size: 42px;
  }

  .hero-stats {
    gap: 30px;
  }

  .stat-value {
    font-size: 28px;
  }

  section {
    padding: 80px 0;
  }

  .section-header h2 {
    font-size: 36px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .ctf-categories {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .page-hero h1 {
    font-size: 48px;
  }

  .page-hero p {
    font-size: 18px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Mobile Landscape & Small Tablets (576px - 767px) */
@media (max-width: 767px) {
  .container,
  .header-inner,
  .footer-inner {
    padding: 0 20px;
  }

  .hero-content h2 {
    font-size: 36px;
  }

  .hero-content p {
    font-size: 16px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .network-container {
    height: 400px;
  }

  .terminal-overlay {
    max-height: 150px;
    padding: 12px;
    font-size: 10px;
  }

  .section-header h2 {
    font-size: 32px;
  }

  .section-header p {
    font-size: 14px;
  }

  section {
    padding: 60px 0;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 24px;
  }

  .card h3 {
    font-size: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-info {
    padding: 30px;
  }

  .contact-info h3 {
    font-size: 24px;
  }

  .about-features {
    grid-template-columns: 1fr;
  }

  .about-content h3 {
    font-size: 20px;
    margin-top: 30px;
  }

  .ctf-stats {
    grid-template-columns: 1fr;
  }

  .stat-box {
    padding: 30px;
  }

  .trusted-logos {
    gap: 40px;
  }

  .logo-item img {
    height: 40px !important;
  }

  /* About Page Grid Override for Mobile */
  .about-container {
    grid-template-columns: 1fr;
  }

  /* Contact Page Mobile Adjustments */
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 40px;
  }

  /* Contact page specific card fixes */
  section .card[style*="margin-bottom"] {
    margin-bottom: 20px !important;
  }

  /* Form input mobile sizing */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    width: 100% !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 14px 16px !important;
  }

  /* Service icon in contact cards */
  .service-icon {
    width: 50px !important;
    height: 50px !important;
    margin-bottom: 16px !important;
  }

  .service-icon svg {
    width: 24px !important;
    height: 24px !important;
  }

  .page-hero {
    padding: 80px 0 60px;
  }

  .page-hero h1 {
    font-size: 36px;
  }

  .page-hero p {
    font-size: 16px;
  }

  .cert-slide img {
    object-fit: contain;
  }

  .amb-grid {
    grid-template-columns: 1fr;
  }

  .brand-text h1 {
    font-size: 16px;
  }

  .brand-text p {
    font-size: 10px;
  }

  /* About Page Mission/Vision Mobile Fix */
  .about-container,
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Contact Page Mobile Fix */
  .contact-grid {
    grid-template-columns: 1fr !important;
  }

  .contact-info {
    margin-bottom: 40px;
  }

  /* Cert Badges Mobile */
  .cert-badges-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile Portrait (max 575px) */
@media (max-width: 575px) {
  .container,
  .header-inner,
  .footer-inner {
    padding: 0 16px;
  }

  .hero-content h2 {
    font-size: 28px;
  }

  .hero-content p {
    font-size: 15px;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-label {
    font-size: 11px;
  }

  .network-container {
    height: 350px;
  }

  .terminal-overlay {
    padding: 10px;
    font-size: 9px;
  }

  .terminal-title {
    font-size: 8px;
  }

  .section-header h2 {
    font-size: 28px;
  }

  .section-header {
    margin-bottom: 40px;
  }

  section {
    padding: 50px 0;
  }

  .card {
    padding: 20px;
  }

  .card h3 {
    font-size: 18px;
  }

  .card p {
    font-size: 14px;
  }

  .service-icon,
  .ctf-icon,
  .feature-icon {
    width: 50px;
    height: 50px;
  }

  .service-icon svg,
  .ctf-icon svg {
    width: 28px;
    height: 28px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 12px;
  }

  .blog-content {
    padding: 20px;
  }

  .blog-content h3 {
    font-size: 18px;
  }

  .blog-img {
    height: 180px;
  }

  .contact-info {
    padding: 24px;
  }

  .contact-info h3 {
    font-size: 20px;
  }

  /* Contact page cards on small mobile */
  .card {
    padding: 20px !important;
    margin-bottom: 16px !important;
  }

  /* Contact info section padding */
  .contact-info {
    padding: 24px !important;
  }

  /* Contact form submit button */
  button[type="submit"] {
    width: 100% !important;
    padding: 16px 24px !important;
  }

  /* Social icons container */
  div[style*="display: flex"][style*="gap: 16px"] {
    gap: 12px !important;
  }

  .stat-big {
    font-size: 36px;
  }

  .stat-desc {
    font-size: 11px;
  }

  .page-hero h1 {
    font-size: 32px;
  }

  .page-hero p {
    font-size: 15px;
  }

  .logo-square {
    width: 36px;
    height: 36px;
  }

  .brand-text h1 {
    font-size: 14px;
  }

  .brand-text p {
    font-size: 9px;
  }

  .slider-btn {
    width: 35px;
    height: 35px;
  }

  .slider-btn svg {
    width: 16px;
    height: 16px;
  }

  .cert-label {
    font-size: 14px;
    padding: 20px 15px 15px;
  }

  .about-feature {
    flex-direction: column;
    gap: 15px;
  }

  .footer-links {
    gap: 16px;
  }

  .footer-links a {
    font-size: 11px;
  }
}

/* Extra Small Devices (max 375px) */
@media (max-width: 375px) {
  .hero-content h2 {
    font-size: 24px;
  }

  .network-container {
    height: 300px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .card h3 {
    font-size: 16px;
  }

  .page-hero h1 {
    font-size: 28px;
  }

  .terminal-overlay {
    max-height: 120px;
  }

  .trusted-logos {
    gap: 30px;
  }

  .logo-item img {
    height: 35px !important;
  }
}

/* Landscape Orientation */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 40px 0;
  }

  section {
    padding: 40px 0;
  }

  .page-hero {
    padding: 60px 0 40px;
  }

  .network-container {
    height: 300px;
  }

  .terminal-overlay {
    max-height: 100px;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-square img,
  .client-logo,
  .card-img,
  .blog-img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Print Styles */
@media print {
  header,
  footer,
  .btn,
  .mobile-menu-toggle,
  nav,
  .network-container,
  .slider-btn,
  .slider-dots {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .container {
    max-width: 100%;
  }

  section {
    page-break-inside: avoid;
    border-bottom: 1px solid #ccc;
  }

  .card,
  .blog-card,
  .ctf-card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  a {
    text-decoration: underline;
  }
}

/* Reduced Motion Preference */
@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;
  }

  .fade-in,
  .slide-up,
  .slide-in-left,
  .slide-in-right,
  .scale-up {
    opacity: 1;
    transform: none;
  }

  .node,
  .terminal-icon,
  .cursor,
  .scan-line,
  .radar-sweep {
    animation: none !important;
  }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: light) {
  /* Will be implemented if needed */
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .card,
  .blog-card,
  .ctf-card,
  nav a,
  .footer-links a {
    -webkit-tap-highlight-color: rgba(225, 29, 29, 0.2);
  }

  .btn {
    padding: 14px 24px;
  }

  nav a,
  .mobile-nav a {
    padding: 16px 0;
  }

  .slider-btn {
    width: 48px;
    height: 48px;
  }

  .slider-dot {
    width: 12px;
    height: 12px;
  }
}

/* Container Queries (Future Enhancement) */
@supports (container-type: inline-size) {
  .card {
    container-type: inline-size;
  }

  @container (max-width: 300px) {
    .card h3 {
      font-size: 18px;
    }
  }
}

@media (max-width: 968px) {
  /* Override inline grid styles on contact page */
  .container > section .grid[style] {
    grid-template-columns: 1fr !important;
  }
}