/* ===== ONYX MAIL UNIFIED RESPONSIVE DESIGN ===== */
/* Mobile-first responsive styles for all components */
/* Version: 3.0.0-unified */

/* ===== SMALL MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
  :root {
    /* Further reduce spacing on very small screens */
    --space-2xl: 1.5rem;
    --space-3xl: 2rem;
    --space-4xl: 2.5rem;
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  /* Container adjustments */
  .container {
    padding: 0 var(--space-sm);
  }
  
  /* Navigation adjustments */
  .nav__menu {
    width: 100%;
  }
  
  /* Button adjustments */
  .btn {
    width: 100%;
    justify-content: center;
    font-size: var(--font-sm);
  }
  
  /* Modal adjustments */
  .modal__content {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
  }
}

/* ===== MOBILE (max-width: 768px) ===== */
@media (max-width: 768px) {
  /* ===== HEADER & NAVIGATION ===== */
  .header {
    height: 60px;
  }
  
  .nav__logo {
    max-width: 120px;
    max-height: 40px;
  }
  
  /* ===== FOOTER ===== */
  .footer {
    padding: var(--space-2xl) 0 var(--space-lg) 0;
  }
  
  .footer__content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }
  
  .footer__column {
    align-items: center;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
  }
  
  .footer__column:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .footer__list {
    align-items: center;
    width: 100%;
  }
  
  .footer__list li {
    width: 100%;
  }
  
  .footer__link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
  }
  
  /* ===== GRID SYSTEM ===== */
  .stats-grid,
  .grid--stats {
    grid-template-columns: 1fr !important;
    gap: var(--space-md) !important;
    max-width: 280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important; /* No top margin - spacing handled by description bottom margin */
    margin-bottom: 0 !important;
  }
  
  .stats-grid > div,
  .stats-grid .stat-item {
    width: 100% !important;
    max-width: 100% !important;
    /* Remove borders on mobile */
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
  
  .grid--features {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  /* ===== BUTTONS ===== */
  .btn,
  button,
  a.btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    padding: var(--space-sm) var(--space-lg);
  }
  
  /* Ensure Request Access buttons are consistent */
  .btn--secondary {
    background: transparent !important;
    border: 1px solid var(--color-primary) !important;
    color: var(--color-primary) !important;
  }
  
  .btn--secondary:hover,
  .btn--secondary:active {
    background: rgba(var(--color-primary-rgb), 0.1) !important;
    border-color: var(--color-secondary) !important;
    color: var(--color-secondary) !important;
  }
  
  /* ===== TOUCH TARGETS ===== */
  a,
  button,
  .btn,
  .nav__link,
  .footer__link,
  .expand-btn,
  .copy-btn,
  [onclick] {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* ===== CARDS ===== */
  .card,
  .feature-card {
    padding: var(--space-md);
  }
  
  /* ===== FORMS ===== */
  .form-input,
  .form-textarea,
  .form-select {
    min-height: 44px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* ===== SECTIONS ===== */
  .section {
    padding: var(--space-2xl) 0;
  }
  
  .section--hero {
    min-height: 100vh;
    padding: var(--space-xl) 0;
  }
  
  /* ===== TYPOGRAPHY ===== */
  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  p {
    font-size: var(--font-base);
    line-height: 1.6;
  }
  
  /* ===== MOBILE MENU OVERLAY ===== */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: var(--mobile-menu-width);
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-mobile-overlay);
  }
  
  .mobile-menu-overlay.active,
  #nuclear-menu-toggle:checked ~ .mobile-menu-overlay {
    display: block;
  }
  
  /* ===== VIEWPORT SAFETY ===== */
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  * {
    max-width: 100%;
  }
  
  img,
  video {
    max-width: 100%;
    height: auto;
  }
  
  /* ===== SPACING ADJUSTMENTS ===== */
  .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
  
  /* ===== HERO SECTIONS ===== */
  /* Standardize all hero sections to match about.html */
  .hero-section,
  .about-hero,
  .contact-hero {
    padding: var(--space-2xl) 0 !important; /* 48px top/bottom on mobile */
  }
  
  /* Reduce pt-5xl padding on mobile for all hero sections */
  .hero-section__content,
  .about-hero__content,
  .contact-hero__header {
    padding-top: var(--space-2xl) !important; /* 48px instead of 128px on mobile */
  }
  
  .hero-section__title {
    font-size: 2.5rem;
  }
  
  .hero-section__description {
    font-size: var(--font-base);
    margin-bottom: calc(var(--space-4xl) + var(--space-3xl)) !important; /* 96px + 64px = 160px on mobile */
  }
  
  .about-section {
    padding: var(--space-xl) 0;
  }
}

/* ===== TABLET (min-width: 769px and max-width: 1023px) ===== */
@media (min-width: 769px) and (max-width: 1023px) {
  /* Tablet-specific adjustments */
  .container {
    max-width: 900px;
  }
  
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer__content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== DESKTOP (min-width: 1024px) ===== */
@media (min-width: 1024px) {
  /* Desktop-specific enhancements */
  .container {
    max-width: var(--container-max-width);
  }
  
  /* Hover effects only on desktop */
  .card:hover,
  .feature-card:hover {
    transform: translateY(-4px);
  }
  
  .btn:hover {
    transform: translateY(-1px);
  }
}

/* ===== LARGE DESKTOP (min-width: 1280px) ===== */
@media (min-width: 1280px) {
  /* Large screen enhancements */
  .container--wide {
    max-width: 1400px;
  }
  
  .section {
    padding: var(--space-5xl) 0;
  }
}

/* ===== NARROW DESKTOP (min-width: 768px and max-width: 1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Fix for disappearing elements on narrow desktop */
  h1,
  h2,
  h3,
  .gradient-text {
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  .hero-section__title,
  .about-hero__title {
    opacity: 1 !important;
    color: var(--color-text-primary) !important;
  }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
  /* Landscape-specific adjustments */
  .header {
    height: 50px;
  }
  
  .section--hero {
    min-height: 100vh;
  }
  
  .nav__menu {
    padding-top: var(--space-lg);
  }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
  /* Touch device optimizations */
  .btn,
  a,
  button,
  [onclick] {
    -webkit-tap-highlight-color: rgba(var(--color-primary-rgb), 0.1);
  }
  
  /* Disable hover effects on touch devices */
  .card:hover,
  .feature-card:hover,
  .btn:hover {
    transform: none;
  }
  
  /* Enhance touch targets */
  .nav__link,
  .footer__link {
    min-height: 48px;
    padding: var(--space-md);
  }
}

/* ===== HIGH DPI / RETINA ===== */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  /* Retina optimizations */
  .nav__logo-img,
  .footer__logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  /* Print optimizations */
  .header,
  .footer,
  .nav__toggle,
  .mobile-menu-overlay,
  .btn {
    display: none !important;
  }
  
  .main {
    padding-top: 0 !important;
  }
  
  * {
    background: white !important;
    color: black !important;
  }
  
  a {
    text-decoration: underline !important;
  }
}

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

@media (prefers-contrast: high) {
  /* High contrast adjustments */
  .btn--secondary {
    border-width: 2px;
  }
  
  .card,
  .feature-card {
    border-width: 2px;
  }
  
  a:focus-visible,
  button:focus-visible {
    outline-width: 3px;
  }
}

/* ===== DARK MODE (if needed for future) ===== */
@media (prefers-color-scheme: dark) {
  /* Already dark by default */
}
