/* ========================================
   Responsive Design
   ======================================== */

/* Tablet Landscape and Below (1024px) */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    .container {
        padding: 0 30px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-content,
    .ai-content {
        gap: 3rem;
    }

    .contact-content {
        gap: 3rem;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    /* Safe area padding for notched devices */
    .hero {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        gap: 0;
        transition: left 0.3s ease;
        border-top: 1px solid rgba(0, 217, 255, 0.2);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    }

    .nav-menu .nav-link {
        color: var(--text-white);
        font-size: 1.2rem;
    }

    .nav-toggle {
        display: flex;
    }

    /* Hide desktop emergency badge from navbar on mobile */
    .nav-wrapper > .emergency-badge {
        display: none;
    }

    /* Show mobile emergency badge inside menu */
    .mobile-emergency {
        border-bottom: none !important;
        padding-top: 2rem !important;
        display: block;
    }

    .emergency-badge-mobile {
        width: 100%;
        justify-content: center;
        margin: 0;
        font-size: 1rem;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .soc-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .stat-item {
        width: 100%;
    }

    .emergency-badge {
        font-size: 0.85rem;
        padding: 0.5rem 0.9rem;
        margin-left: 1rem;
    }

    /* Network Nodes - Reduce for mobile */
    .node {
        width: 60px;
        height: 60px;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-text .section-title {
        text-align: center;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stat-box {
        padding: 1.5rem;
    }

    .stat-number-large {
        font-size: 2.5rem;
    }

    /* AI Solutions */
    .ai-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .ai-text .section-title {
        text-align: center;
    }

    .ai-brain {
        width: 250px;
        height: 250px;
    }

    .ai-shield i {
        font-size: 60px;
    }

    .scan-ring {
        width: 160px;
        height: 160px;
    }

    .ai-node {
        width: 40px;
        height: 40px;
    }

    .ai-node i {
        font-size: 16px;
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    :root {
        --section-padding: 40px;
    }

    .container {
        padding: 0 20px;
    }

    /* Navigation */
    .logo {
        font-size: 1.2rem;
    }

    .logo i {
        font-size: 1.4rem;
    }

    /* Hero - Note: horizontal padding handled above for safe areas */
    .hero {
        min-height: 100vh;
        padding-top: 100px;
        padding-bottom: 80px;
    }

    .hero-content {
        padding: 1.5rem 1rem 2rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
        padding: 0 0.5rem;
        word-wrap: break-word;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }

    .hero-cta {
        padding: 0 0.5rem;
    }

    .emergency-badge-mobile {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        flex-direction: row;
        text-align: center;
        gap: 0.5rem;
        display: inline-flex;
        max-width: 100%;
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
    }

    .badge-text {
        max-width: 100%;
        overflow-wrap: break-word;
        font-size: 0.7rem;
        line-height: 1.3;
    }

    .pulse-dot {
        width: 8px;
        height: 8px;
        flex-shrink: 0;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Services */
    .service-card {
        padding: 2rem;
    }

    .service-icon {
        font-size: 2.5rem;
    }

    .service-title {
        font-size: 1.3rem;
    }

    /* About */
    .about-description {
        font-size: 1rem;
    }

    .about-features li {
        font-size: 0.95rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .stat-number-large {
        font-size: 2rem;
    }

    /* AI Solutions */
    .ai-brain {
        width: 200px;
        height: 200px;
    }

    .ai-shield i {
        font-size: 50px;
    }

    .scan-ring {
        width: 140px;
        height: 140px;
    }

    .ai-node {
        width: 35px;
        height: 35px;
    }

    .ai-node i {
        font-size: 14px;
    }

    .data-stream {
        width: 1px;
        height: 60px;
    }

    .ai-description {
        font-size: 1rem;
    }

    .ai-feature {
        padding: 1rem;
    }

    .ai-feature i {
        font-size: 1.5rem;
    }

    .ai-feature h4 {
        font-size: 1rem;
    }

    /* Contact */
    .info-item {
        padding: 1rem;
    }

    .info-item i {
        font-size: 1.5rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer {
        padding: 2rem 0 1rem;
    }

    /* Network Nodes - Hide some for very small screens */
    .node-4,
    .node-5 {
        display: none;
    }
}

/* Very Small Devices (360px) */
@media (max-width: 360px) {
    .hero {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
    }

    .hero-content {
        padding: 1rem 0.5rem;
        box-sizing: border-box;
    }

    .hero-title {
        font-size: 1.8rem;
        padding: 0 0.25rem;
    }

    .hero-subtitle {
        padding: 0 0.25rem;
    }

    .emergency-badge-mobile {
        font-size: 0.85rem;
        padding: 0.6rem 0.9rem;
        gap: 0.4rem;
    }

    .badge-text {
        font-size: 0.65rem;
    }

    .pulse-dot {
        width: 7px;
        height: 7px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .stat-box {
        padding: 1rem;
    }
}

/* Landscape Mode Adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 120px 0 60px;
    }

    .hero-content {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        margin-bottom: 2rem;
    }

    .soc-stats {
        flex-direction: row;
        gap: 1rem;
    }

    .stat-item {
        padding: 1rem;
    }

    .scroll-indicator {
        display: none;
    }

    .network-nodes {
        display: none;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo,
    .hero-title,
    .section-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .scroll-indicator,
    .soc-background,
    #socCanvas,
    .network-nodes,
    .nav-toggle {
        display: none !important;
    }

    body {
        background-color: white;
        color: black;
    }

    .hero,
    .services,
    .about,
    .ai-solutions,
    .contact {
        page-break-inside: avoid;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-indicator,
    .network-nodes,
    .pulse-dot,
    .neural-network {
        animation: none !important;
    }
}

/* Dark Mode Support (if user has system dark mode) */
@media (prefers-color-scheme: dark) {
    /* Already dark themed, but can add adjustments if needed */
}

/* Light Mode Override (if implemented in future) */
@media (prefers-color-scheme: light) {
    /* Keep dark theme as primary design */
}
