/* ==========================================
   RESPONSIVE CSS - MOBILE FIRST
   Modern & Adaptive Design
   ========================================== */

/* ==========================================
   MOBILE (Default - up to 768px)
   ========================================== */

/* Mobile Navigation */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: var(--space-4);
        padding: var(--space-10);
        transition: right var(--transition-slow);
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
        z-index: 1001;
    }

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

    .nav-link {
        font-size: var(--text-lg);
        width: 100%;
        text-align: center;
        padding: var(--space-4);
    }

    /* Hamburger Animation */
    .menu-toggle.active .hamburger:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle.active .hamburger:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }

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

    /* Hero Section */
    .hero-section {
        min-height: 100svh;
        padding: var(--space-16) var(--space-4);
    }

    .hero-badge {
        font-size: var(--text-xs);
        padding: var(--space-2) var(--space-4);
    }

    .hero-features {
        flex-direction: column;
        align-items: stretch;
    }

    .feature-pill {
        justify-content: center;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }

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

    .about-card {
        padding: var(--space-6);
    }

    .cta-box {
        padding: var(--space-6);
    }

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

    .service-card {
        padding: var(--space-6);
    }

    .service-header {
        flex-direction: column;
        text-align: center;
    }

    .service-title {
        font-size: var(--text-xl);
    }

    .emergency-box {
        flex-direction: column;
        text-align: center;
        padding: var(--space-6);
        gap: var(--space-4);
    }

    .btn-emergency {
        width: 100%;
        justify-content: center;
        font-size: var(--text-base);
        padding: var(--space-4) var(--space-6);
    }

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

    .contact-card {
        padding: var(--space-6);
    }

    .contact-details-box {
        padding: var(--space-6);
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: var(--space-6);
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-links {
        flex-direction: column;
        gap: var(--space-4);
    }

    /* Modal */
    .modal {
        padding: var(--space-4);
    }

    .modal-content {
        padding: var(--space-6);
    }

    /* Cookie Banner */
    .cookie-banner {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
        padding: var(--space-4);
    }

    /* Animated Shapes - Smaller on mobile */
    .shape-1 {
        width: 250px;
        height: 250px;
    }

    .shape-2 {
        width: 200px;
        height: 200px;
    }

    .shape-3 {
        width: 180px;
        height: 180px;
    }
}

/* ==========================================
   SMALL MOBILE (up to 480px)
   ========================================== */
@media (max-width: 480px) {
    .logo-img {
        height: 50px;
    }

    .section-header {
        margin-bottom: var(--space-10);
    }

    .hero-badge {
        flex-direction: column;
        text-align: center;
    }

    .badge-icon {
        font-size: var(--text-2xl);
    }

    .about-section,
    .services-section,
    .contact-section {
        padding: var(--space-16) 0;
    }

    .service-list li {
        font-size: var(--text-xs);
        padding: var(--space-2) 0 var(--space-2) var(--space-5);
    }

    .emergency-icon {
        font-size: 3rem;
    }

    .contact-card-icon {
        font-size: 2.5rem;
    }

    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: var(--space-4);
        right: var(--space-4);
    }
}

/* ==========================================
   TABLET (769px - 1024px)
   ========================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-menu {
        gap: var(--space-1);
    }

    .nav-link {
        font-size: var(--text-sm);
        padding: var(--space-2) var(--space-4);
    }

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

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

    .contact-content {
        grid-template-columns: 1fr 1fr;
    }

    .contact-info {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================
   DESKTOP (1025px and up)
   ========================================== */
@media (min-width: 1025px) {
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Hover effects for desktop */
    .service-card:hover .service-icon {
        animation: bounce 0.6s ease;
    }

    @keyframes bounce {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-10px); }
    }

    .about-card:hover .card-icon {
        animation: rotate 0.6s ease;
    }

    @keyframes rotate {
        0% { transform: rotate(0deg) scale(1); }
        50% { transform: rotate(10deg) scale(1.1); }
        100% { transform: rotate(0deg) scale(1); }
    }
}

/* ==========================================
   LARGE DESKTOP (1280px and up)
   ========================================== */
@media (min-width: 1280px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .emergency-box {
        padding: var(--space-12);
    }

    .emergency-icon {
        font-size: 5rem;
    }
}

/* ==========================================
   EXTRA LARGE DESKTOP (1600px and up)
   ========================================== */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }

    .hero-content {
        max-width: 1000px;
    }

    .shape-1 {
        width: 500px;
        height: 500px;
    }

    .shape-2 {
        width: 450px;
        height: 450px;
    }

    .shape-3 {
        width: 400px;
        height: 400px;
    }
}

/* ==========================================
   LANDSCAPE MOBILE (max height 600px)
   ========================================== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: var(--space-16) var(--space-6);
    }

    .hero-badge {
        margin-bottom: var(--space-3);
    }

    .hero-title {
        margin-bottom: var(--space-4);
    }

    .hero-subtitle {
        margin-bottom: var(--space-4);
    }

    .hero-features {
        display: none;
    }

    .hero-cta {
        flex-direction: row;
        gap: var(--space-3);
    }

    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        padding: var(--space-6);
        gap: var(--space-2);
    }
}

/* ==========================================
   REDUCED MOTION (Accessibility)
   ========================================== */
@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;
    }

    .shape {
        animation: none !important;
    }

    .pulse {
        animation: none !important;
    }
}

/* ==========================================
   HIGH CONTRAST MODE (Accessibility)
   ========================================== */
@media (prefers-contrast: high) {
    :root {
        --color-gray-700: #000000;
        --color-gray-900: #000000;
    }

    .service-card,
    .about-card,
    .contact-card {
        border-width: 3px;
    }

    .btn-primary,
    .btn-secondary {
        border-width: 3px;
    }

    .gradient-text {
        -webkit-text-fill-color: var(--color-secondary);
    }
}

/* ==========================================
   DARK MODE (System Preference)
   ========================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --color-gray-50: #1f2937;
        --color-gray-100: #111827;
        --color-gray-200: #374151;
        --color-gray-700: #d1d5db;
        --color-gray-800: #1f2937;
        --color-gray-900: #f9fafb;
        --color-white: #0a0a0a;
    }

    body {
        background: #0a0a0a;
        color: var(--color-gray-900);
    }

    .header {
        background: rgba(0, 0, 0, 0.8);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .about-section {
        background: #111827;
    }

    .services-section {
        background: #0a0a0a;
    }

    .about-card,
    .service-card {
        background: #1f2937;
        border-color: #374151;
    }

    .service-card:hover,
    .about-card:hover {
        border-color: var(--color-primary-light);
    }

    .modal-content {
        background: #1f2937;
        color: var(--color-gray-900);
    }

    .modal-body h3 {
        color: var(--color-primary-light);
    }

    .cookie-banner {
        background: rgba(31, 41, 55, 0.95);
        border-color: #374151;
    }

    .hamburger {
        background: var(--color-gray-900);
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    .header,
    .cookie-banner,
    .scroll-to-top,
    .menu-toggle,
    .modal,
    .hero-features,
    .hero-cta,
    .animated-shapes {
        display: none !important;
    }

    .hero-section {
        min-height: auto;
        page-break-after: always;
    }

    .section-header,
    .service-card,
    .about-card {
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }

    .hero-title,
    .section-title {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }

    .gradient-text {
        -webkit-text-fill-color: #666 !important;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .service-card,
    .about-card {
        border: 1px solid #000;
        box-shadow: none;
    }

    .contact-section {
        background: #fff !important;
        color: #000 !important;
    }

    .contact-link {
        color: #000 !important;
    }
}

/* ==========================================
   TOUCH DEVICES - Better tap targets
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    .nav-link,
    .btn-primary,
    .btn-secondary,
    .contact-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .scroll-to-top {
        width: 56px;
        height: 56px;
    }

    /* Remove hover effects on touch devices */
    .service-card:hover,
    .about-card:hover {
        transform: none;
    }

    /* Tap highlight */
    * {
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.3);
    }
}

/* ==========================================
   ULTRA-WIDE SCREENS (2000px+)
   ========================================== */
@media (min-width: 2000px) {
    .container {
        max-width: 1600px;
    }

    .hero-content {
        max-width: 1200px;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-10);
    }

    .about-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================
   SAFE AREAS (iOS Notch Support)
   ========================================== */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .cookie-banner {
        left: max(var(--space-6), env(safe-area-inset-left));
        right: max(var(--space-6), env(safe-area-inset-right));
        bottom: max(var(--space-6), env(safe-area-inset-bottom));
    }

    .scroll-to-top {
        right: max(var(--space-6), env(safe-area-inset-right));
        bottom: max(var(--space-6), env(safe-area-inset-bottom));
    }
}
