/* ==========================================================================
   ZIRA Responsive Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Mobile First Breakpoints (standard mobile-first approach)
   -------------------------------------------------------------------------- */

/* Small Devices (640px and up) */
@media (min-width: 640px) {
    :root {
        --text-4xl: 2.5rem;
        --text-5xl: 3rem;
        --text-6xl: 3.5rem;
    }
}

/* Medium Devices (768px and up) - Tablets */
@media (min-width: 768px) {
    :root {
        --text-4xl: 2.5rem;
        --text-5xl: 3.5rem;
        --text-6xl: 4rem;
        --text-7xl: 5rem;
        
        --header-height: 5rem;
        --section-padding-y: var(--space-24);
        --section-padding-x: var(--space-8);
    }
    
    /* Grid adjustments */
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Large Devices (1024px and up) - Small Laptops */
@media (min-width: 1024px) {
    :root {
        --text-5xl: 4rem;
        --text-6xl: 4.5rem;
        --text-7xl: 5.5rem;
        --text-8xl: 6.5rem;
        
        --section-padding-y: var(--space-32);
    }
    
    /* Grid adjustments */
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr repeat(3, 1fr);
    }
}

/* Extra Large Devices (1280px and up) - Desktops */
@media (min-width: 1280px) {
    :root {
        --text-6xl: 5rem;
        --text-7xl: 6rem;
        --text-8xl: 7.5rem;
    }
    
    /* Grid adjustments */
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------------------------------
   Maximum Width Container
   -------------------------------------------------------------------------- */
@media (min-width: 1400px) {
    .container {
        max-width: 1380px;
    }
}

/* --------------------------------------------------------------------------
   Mobile Navigation
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Mobile nav adjustments */
    .mobile-nav {
        padding: var(--space-4);
    }
    
    .mobile-nav-link {
        padding: var(--space-3);
        font-size: var(--text-base);
    }
    
    /* Footer mobile */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .footer-brand {
        max-width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Tablet Adjustments (768px - 1023px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Hero section */
    .hero-content {
        padding: var(--space-8);
    }
    
    /* Cards */
    .card {
        padding: var(--space-5);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Large Screens (1920px and up)
   -------------------------------------------------------------------------- */
@media (min-width: 1920px) {
    :root {
        --text-5xl: 4.5rem;
        --text-6xl: 5.5rem;
        --text-7xl: 7rem;
        --text-8xl: 9rem;
    }
    
    .container {
        max-width: 1600px;
    }
}

/* --------------------------------------------------------------------------
   High DPI / Retina Displays
   -------------------------------------------------------------------------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisp borders */
    .retina-border {
        border-width: 0.5px;
    }
}

/* --------------------------------------------------------------------------
   Touch Devices
   -------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .hover-lift:hover {
        transform: none;
    }
    
    .hover-scale:hover {
        transform: none;
    }
    
    /* Increase touch targets */
    .btn {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Remove animations that might cause issues */
    .animate-float {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   Landscape Mode on Mobile
   -------------------------------------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-8) 0;
    }
    
    .hero-content {
        padding: var(--space-4);
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .header,
    .footer,
    .mobile-nav,
    .btn,
    canvas {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    .section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .card {
        border: 1px solid #ccc;
        background: white;
        box-shadow: none;
    }
}

/* --------------------------------------------------------------------------
   Screen Reader Only - Visible on Focus
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: var(--space-2) var(--space-4);
    z-index: 100;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* --------------------------------------------------------------------------
   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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* --------------------------------------------------------------------------
   Dark Mode (respects system preference)
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    :root {
        /* ZIRA is designed for dark mode by default */
    }
}

/* Light mode override if needed */
@media (prefers-color-scheme: light) {
    :root.light-mode {
        --color-bg-primary: #F8FAFC;
        --color-bg-secondary: #F1F5F9;
        --color-bg-tertiary: #E2E8F0;
        --color-bg-card: rgba(255, 255, 255, 0.8);
        
        --color-text-primary: #0F172A;
        --color-text-secondary: #475569;
        --color-text-tertiary: #64748B;
        
        --color-border: rgba(0, 0, 0, 0.1);
    }
}

/* --------------------------------------------------------------------------
   Prefers Contrast
   -------------------------------------------------------------------------- */
@media (prefers-contrast: high) {
    :root {
        --color-border: rgba(0, 0, 0, 0.3);
        --color-text-secondary: #334155;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border-width: 2px;
    }
}

/* --------------------------------------------------------------------------
   Firefox Specific
   -------------------------------------------------------------------------- */
@-moz-document url-prefix() {
    /* Smooth scrolling fix for Firefox */
    html {
        scroll-behavior: auto;
    }
}

/* --------------------------------------------------------------------------
   Safari Specific
   -------------------------------------------------------------------------- */
@supports (-webkit-appearance: none) {
    /* Safari-specific fixes if needed */
    .safari-only {
        /* Styles for Safari only */
    }
}

/* --------------------------------------------------------------------------
   Internet Explorer 11 (if still needed)
   -------------------------------------------------------------------------- */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    /* IE11 specific fixes */
    .grid {
        display: -ms-grid;
    }
}

/* --------------------------------------------------------------------------
   Responsive Typography
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
    :root {
        --text-base: 0.9375rem;
    }
    
    h1 {
        font-size: var(--text-4xl);
        letter-spacing: var(--tracking-tight);
    }
    
    h2 {
        font-size: var(--text-3xl);
    }
    
    h3 {
        font-size: var(--text-2xl);
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    h1 {
        font-size: var(--text-5xl);
    }
}
