/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    /* Ensure all pages have proper top spacing for fixed navbar */
    body {
        padding-top: 70px;
    }
    
    /* Main content adjustments */
    #home, 
    main, 
    .main-content {
        padding-top: 20px !important;
        margin-top: 0 !important;
    }
    
    /* Section spacing for smooth scroll anchors */
    section {
        scroll-margin-top: 80px;
    }
    
    /* Typography adjustments */
    .hero-title {
        font-size: 2.25rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-title * {
        font-size: inherit !important;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    h3 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
    
    /* Component adjustments */
    .cyber-button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        justify-content: center;
    }

    .cyber-terminal {
        padding: 1rem;
        margin-top: 1.25rem;
        max-height: 240px;
        overflow-y: auto;
    }
    
    .terminal-line {
        font-size: 0.75rem;
        height: 20px;
        max-width: 100% !important;
    }

    .tech-card, 
    .cyber-card {
        padding: 1rem;
    }
    
    /* Grid adjustments */
    .grid {
        gap: 1rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Section spacing */
    .py-24 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .py-16 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .py-12 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    /* Container adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    /* Flexbox adjustments */
    .flex-col.sm\:flex-row {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .space-x-4 > * + * {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .space-y-4 > * + * {
        margin-top: 0.75rem;
    }
    
    /* Text alignment adjustments */
    .md\:text-left {
        text-align: center;
    }

    .md\:justify-start {
        justify-content: center;
    }
    
    /* Background grid adjustments */
    .cyber-grid {
        background-size: 30px 30px;
    }

    /* Touch and accessibility improvements */
    .nav-link, 
    .cyber-button, 
    button,
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }
    
    /* Scrolling improvements */
    .scrollable-content {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Overflow fixes */
    .overflow-hidden {
        overflow-x: hidden;
    }
    
    /* Mobile-specific layout fixes */
    .mobile-menu a {
        display: block;
        min-height: 48px;
        text-align: left;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    body {
        padding-top: 65px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-title * {
        font-size: inherit !important;
    }

    .hero-subtitle {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1rem;
    }

    .tech-icon {
        font-size: 2rem;
    }

    .cyber-card {
        padding: 0.875rem;
    }

    .text-5xl {
        font-size: 2rem;
    }

    .text-4xl {
        font-size: 1.75rem;
    }

    .text-3xl {
        font-size: 1.5rem;
    }

    .py-24 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .px-6 {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    .gap-12 {
        gap: 1rem;
    }

    .mb-8 {
        margin-bottom: 1rem;
    }

    .mb-16 {
        margin-bottom: 1.5rem;
    }

    .container {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* Touch devices */
@media (hover: none) {
    .cyber-button:active {
        transform: translateY(-2px);
        box-shadow: 0 0 20px rgba(5, 117, 230, 0.6);
    }

    .cyber-card:active {
        transform: translateY(-3px);
        box-shadow: 0 0 10px rgba(0, 242, 96, 0.5), 0 0 20px rgba(5, 117, 230, 0.3);
    }

    .nav-link:active::after {
        width: 100%;
    }
}

/* Tablet devices */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Large screens */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .cyber-terminal {
        max-height: 300px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
}

/* Better FAQ layout on mobile */
@media (max-width: 640px) {
    body {
        padding-top: 65px;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .faq-item {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }

    .faq-question {
        font-size: 0.9375rem;
        padding-right: 1.5rem;
    }

    .faq-answer {
        font-size: 0.875rem;
        padding-top: 0.5rem;
    }
}

/* Print styles */
@media print {
    .cyber-nav,
    .mobile-menu,
    .mobile-menu-button {
        display: none;
    }
    
    body {
        padding-top: 0;
        background: white;
        color: black;
    }
    
    .cyber-card {
        border: 1px solid #ccc;
        background: white;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cyber-grid {
        animation: none;
    }
    
    .particle {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .cyber-nav {
        background: black;
        border-bottom: 2px solid white;
    }
    
    .nav-link {
        color: white;
    }
    
    .nav-link:hover {
        background: white;
        color: black;
    }
    
    .cyber-card {
        border: 2px solid white;
        background: black;
    }
} 