/* ============================================
   NA-M25 - Responsive Design
   Mobile-first responsive styles
   ============================================ */

/* ============================================
   Mobile Optimizations (< 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Hero Section */
    .hero-section {
        height: 100svh; /* Use svh for mobile browsers */
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
        margin-bottom: 20px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .hero-cta {
        padding: 14px 30px;
        font-size: 1rem;
    }
    
    .scroll-indicator {
        bottom: 20px;
    }
    
    /* Technology Section */
    .tech-section {
        padding: 80px 0;
    }
    
    .tech-content {
        position: static;
        top: auto;
    }
    
    .tech-feature-item {
        padding: 20px;
        gap: 15px;
    }
    
    .tech-feature-icon {
        font-size: 2rem;
    }
    
    .tech-feature-title {
        font-size: 1.1rem;
    }
    
    .tech-chart-container {
        padding: 30px 20px;
    }
    
    .tech-chart {
        height: 300px;
    }
    
    .chart-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-stat-value {
        font-size: 2rem;
    }
    
    /* Industries Section */
    .industries-section {
        padding: 80px 0 60px;
    }
    
    .horizontal-scroll-wrapper {
        /* Disable horizontal scroll on mobile */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    .horizontal-scroll-container {
        display: flex;
        flex-direction: row;
        width: auto;
    }
    
    .industry-card {
        min-width: 100vw;
        height: 80vh;
        scroll-snap-align: start;
        flex-shrink: 0;
    }
    
    .industry-content {
        padding: 0 30px;
    }
    
    .industry-number {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .industry-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
        margin-bottom: 15px;
    }
    
    .industry-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .industry-features {
        gap: 15px;
        margin-bottom: 35px;
    }
    
    .industry-feature {
        font-size: 1rem;
        gap: 12px;
    }
    
    .industry-cta {
        padding: 12px 28px;
        font-size: 1rem;
    }
    
    /* Verification Section */
    .verification-section {
        padding: 80px 0;
    }
    
    .verification-block {
        padding: 30px 20px;
    }
    
    .verification-subtitle {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .esg-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .esg-tab {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .esg-stat-value {
        font-size: 2.5rem;
    }
    
    .esg-stat-label {
        font-size: 0.9rem;
    }
    
    /* Contact Section */
    .contact-section {
        padding: 80px 0;
    }
    
    .contact-form-wrapper {
        padding: 30px 20px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .form-submit {
        padding: 15px 35px;
        font-size: 1rem;
    }
    
    /* Footer */
    .footer {
        padding: 60px 0 30px;
    }
    
    .footer-grid {
        gap: 30px;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    /* Section spacing */
    .section-title {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 20px;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .section-label {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
}

/* ============================================
   Tablet Optimizations (768px - 1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-title {
        font-size: clamp(4rem, 8vw, 6rem);
    }
    
    .tech-grid {
        gap: 60px;
    }
    
    .verification-grid {
        gap: 50px;
    }
    
    .contact-content {
        gap: 50px;
    }
    
    .industry-title {
        font-size: clamp(3.5rem, 7vw, 4.5rem);
    }
}

/* ============================================
   Large Desktop (> 1440px)
   ============================================ */
@media (min-width: 1440px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-title {
        font-size: 8rem;
    }
    
    .section-title {
        font-size: 4.5rem;
    }
}

/* ============================================
   Landscape Mobile
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        height: auto;
        min-height: 100vh;
        padding: 100px 20px 60px;
    }
    
    .hero-title {
        font-size: 3rem;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .industry-card {
        height: auto;
        min-height: 100vh;
        padding: 80px 0;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .nav-link:hover::after {
        width: 0;
    }
    
    .tech-feature-item:hover {
        transform: none;
    }
    
    .cert-card:hover {
        transform: none;
    }
    
    /* Increase touch targets */
    .nav-link,
    .cta-button,
    .esg-tab,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Disable custom cursor on touch */
    .custom-cursor {
        display: none !important;
    }
}

/* ============================================
   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;
    }
    
    .scroll-indicator-line {
        animation: none;
    }
    
    .custom-cursor {
        display: none;
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: light) {
    /* If you want to add light mode support in the future */
    /* body {
        background: #ffffff;
        color: #000000;
    } */
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .main-header,
    .scroll-progress,
    .custom-cursor,
    .back-to-top,
    .mobile-menu,
    .scroll-indicator,
    .particle-canvas {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero-section,
    section {
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="#"]::after {
        content: "";
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */
@media (prefers-contrast: high) {
    .nav-link,
    .section-title,
    .hero-title {
        text-shadow: none;
    }
    
    .tech-chart-container,
    .verification-block,
    .contact-form-wrapper {
        border-width: 2px;
    }
}

/* ============================================
   Browser-Specific Fixes
   ============================================ */

/* Safari specific */
@supports (-webkit-touch-callout: none) {
    .hero-section {
        height: -webkit-fill-available;
    }
}

/* Firefox specific */
@-moz-document url-prefix() {
    .custom-cursor {
        mix-blend-mode: normal;
    }
}

/* ============================================
   Loading State
   ============================================ */
body:not(.loaded) {
    overflow: hidden;
}

body:not(.loaded) .hero-section {
    opacity: 0;
}

body.loaded .hero-section {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* ============================================
   Accessibility Improvements
   ============================================ */

/* Focus visible styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid #39FF14;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: #39FF14;
    color: #0A2F1F;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
}

.skip-to-main:focus {
    top: 10px;
    left: 10px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   Performance Optimizations
   ============================================ */

/* GPU acceleration for animated elements */
.hero-title-line,
.particle-canvas,
.custom-cursor,
.industry-card,
.tech-chart-container {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Contain layout shifts */
.tech-chart,
.particle-canvas {
    contain: layout style paint;
}

/* ============================================
   Fallbacks for Older Browsers
   ============================================ */

/* Backdrop filter fallback */
@supports not (backdrop-filter: blur(20px)) {
    .main-header.scrolled {
        background: rgba(10, 47, 31, 0.95);
    }
    
    .tech-chart-container,
    .verification-block,
    .contact-form-wrapper {
        background: rgba(12, 56, 41, 0.8);
    }
}

/* Grid fallback */
@supports not (display: grid) {
    .tech-grid,
    .verification-grid,
    .contact-content,
    .footer-grid {
        display: block;
    }
    
    .tech-grid > *,
    .verification-grid > *,
    .contact-content > *,
    .footer-grid > * {
        margin-bottom: 40px;
    }
}

/* Sticky fallback */
@supports not (position: sticky) {
    .tech-content {
        position: static;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.hide-on-mobile {
    display: block;
}

.show-on-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }
    
    .show-on-mobile {
        display: block;
    }
}

.text-glow {
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

.neon-border {
    border: 1px solid rgba(57, 255, 20, 0.3);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.2);
}

/* Smooth scrolling for all anchor links */
html {
    scroll-padding-top: 80px;
}

/* iOS safe area support */
@supports (padding: max(0px)) {
    .main-header,
    .hero-section,
    .contact-section,
    .footer {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .back-to-top {
        right: max(40px, calc(env(safe-area-inset-right) + 20px));
        bottom: max(40px, calc(env(safe-area-inset-bottom) + 20px));
    }
}
