/* Mobile-First Responsive Design for 2026 Devices */
/* NOTE: This file ONLY contains mobile and tablet overrides */
/* Desktop styles are handled by base CSS files (navbar.css, style.css, etc.) */

/* ===== SMALL PHONES (320px - 480px) ===== */
@media (max-width: 480px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
        margin: 0 auto;
    }

    img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    /* Navigation - Mobile First */
    .navbar {
        flex-direction: column;
        position: relative;
        padding: 0.5rem 0 !important;
    }

    .navbar .container {
        padding: 0 1rem;
        gap: 0;
        flex-wrap: wrap;
    }

    .navbar-brand {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        flex: 1;
    }

    .logo img {
        max-width: 120px;
        height: auto;
    }

    /* Mobile Menu Toggle - SHOW on mobile */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
    }

    .mobile-menu-toggle span {
        width: 24px;
        height: 2px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Mobile menu styling */
    .nav-menu {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        flex-direction: column !important;
        width: 100% !important;
        background-color: #1a1a1a !important;
        z-index: 999 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease !important;
        border-bottom: 1px solid #333 !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        list-style: none !important;
    }

    .nav-menu.active {
        max-height: calc(100vh - 60px) !important;
        overflow-y: auto !important;
    }

    .nav-item {
        width: 100% !important;
        border-bottom: 1px solid #333 !important;
        border: none !important;
        position: relative !important;
    }

    .nav-link {
        display: block !important;
        padding: 1rem !important;
        text-align: left !important;
        width: 100% !important;
        color: #e0e0e0 !important;
    }

    .nav-link:hover {
        background-color: #2a2a2a;
        color: white !important;
    }

    .nav-actions {
        width: 100% !important;
        justify-content: flex-end !important;
        padding: 1rem !important;
        gap: 0.5rem !important;
    }

    .nav-cta {
        width: auto !important;
        padding: 0.5rem 1rem !important;
        margin: 0 !important;
        display: inline-block !important;
        text-align: center !important;
    }

    /* Mobile mega dropdown */
    .mega-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 0 !important;
        border-top: 1px solid #e5e7eb !important;
        border-bottom: none !important;
    }

    .mega-dropdown.active {
        max-height: 70vh !important;
        overflow-y: auto !important;
    }

    .mega-dropdown-content {
        padding: 1rem !important;
    }

    .mega-dropdown-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .mega-dropdown-card {
        padding: 1rem !important;
    }

    .card-icon-img {
        width: 36px !important;
        height: 36px !important;
    }

    .mega-dropdown-card h3 {
        font-size: 0.9rem !important;
    }

    .mega-dropdown-card p {
        font-size: 0.75rem !important;
    }

    /* Typography - Mobile */
    h1 {
        font-size: 24px;
        margin-bottom: 1rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }

    h3 {
        font-size: 16px;
        margin-bottom: 0.5rem;
    }

    p {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    /* Sections */
    section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 24px;
        text-align: center;
        margin-bottom: 2rem;
    }

    /* Hero Section - Mobile */
    .hero {
        padding: 2rem 0;
    }

    .hero .container {
        grid-template-columns: 1fr !important;
    }

    .hero-content {
        width: 100%;
    }

    .hero-text {
        width: 100%;
    }

    .hero-eyebrow {
        font-size: 12px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 14px;
        line-height: 1.6;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-buttons a {
        width: 100%;
        text-align: center;
    }

    /* Grid Layouts - Mobile First (1 column) */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .services-grid,
    .benefits-grid,
    .case-studies-grid,
    .blog-grid,
    .testimonials-carousel,
    .pricing-grid,
    .faq-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Cards */
    .card,
    .service-card,
    .case-study-card,
    .blog-card,
    .pricing-card,
    .testimonial-card {
        padding: 1.5rem;
        margin: 0;
    }

    /* Buttons */
    .btn {
        display: block;
        width: 100%;
        padding: 12px 16px;
        border-radius: 6px;
        text-align: center;
        font-size: 14px;
    }

    /* Forms */
    form {
        width: 100%;
    }

    input,
    textarea,
    select {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        margin-bottom: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border: 1px solid var(--border-color);
        border-radius: 4px;
    }

    /* Footer */
    .footer {
        padding: 2rem 0;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .footer-links {
        flex-direction: column;
    }
}

/* ===== TABLETS (481px - 768px) ===== */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .container {
        max-width: 90%;
        padding: 0;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .section-title {
        font-size: 26px;
    }

    /* Two columns for some grids */
    .benefits-grid,
    .testimonials-carousel {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hero-buttons {
        flex-direction: row;
    }

    .hero-buttons a {
        width: auto;
        flex: 1;
    }

    /* Mobile menu still showing on tablet */
    .mobile-menu-toggle {
        display: flex !important;
    }

    .nav-menu {
        position: fixed !important;
        top: 60px !important;
        max-height: 0 !important;
    }

    .nav-menu.active {
        max-height: calc(100vh - 60px) !important;
    }

    .mega-dropdown-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== LARGE TABLETS (769px - 1023px) ===== */
@media (min-width: 769px) and (max-width: 1023px) {
    .container {
        max-width: 95%;
        padding: 0;
    }

    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 26px;
    }

    h3 {
        font-size: 18px;
    }

    section {
        padding: 3rem 0;
    }

    .logo img {
        max-width: 180px;
    }

    /* Navigation - Tablet */
    .navbar {
        flex-direction: row;
        justify-content: space-between;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        background: transparent;
    }

    .nav-item {
        border: none;
    }

    .nav-link {
        padding: 0.5rem 1rem;
    }

    .nav-cta {
        margin: 0;
        width: auto;
    }

    /* Hero - Tablet */
    .hero {
        padding: 3rem 0;
    }

    .hero .container {
        grid-template-columns: 1fr 1fr !important;
        gap: 2rem;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    /* Three column grids */
    .services-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .benefits-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .case-studies-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Forms - Tablet */
    .contact-grid,
    .form-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }

    input[type="email"],
    input[type="text"] {
        margin-bottom: 0;
    }

    /* Footer - Tablet */
    .footer-content {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Buttons */
    .btn {
        display: inline-block;
        width: auto;
    }

    /* Mobile menu HIDDEN on large tablet */
    .mobile-menu-toggle {
        display: none !important;
    }

    .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        position: static !important;
        top: auto !important;
        width: auto !important;
        background: transparent !important;
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
    }
}

/* ===== DESKTOPS (1024px+) ===== */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
    }

    h1 {
        font-size: 40px;
    }

    h2 {
        font-size: 32px;
    }

    h3 {
        font-size: 18px;
    }

    section {
        padding: 4rem 0;
    }

    .logo img {
        max-width: 200px;
    }

    /* Desktop Navigation - ALWAYS visible */
    .navbar {
        flex-direction: row;
        justify-content: space-between;
    }

    .navbar .container {
        flex-direction: row;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 2rem !important;
        gap: 1rem;
    }

    .navbar-brand {
        width: auto;
        padding: 0;
        margin: 0;
        flex-shrink: 0;
    }

    /* Hide mobile menu toggle on DESKTOP */
    .mobile-menu-toggle {
        display: none !important;
    }

    /* Desktop menu - ALWAYS visible */
    .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        position: static !important;
        width: auto !important;
        background: transparent !important;
        max-height: none !important;
        overflow: visible !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        border: none !important;
        gap: 2rem !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 1 !important;
        justify-content: center !important;
        list-style: none !important;
    }

    .nav-item {
        width: auto !important;
        border: none !important;
        position: relative;
    }

    .nav-link {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding: 0 !important;
        width: auto !important;
        text-align: left !important;
    }

    .nav-actions {
        display: flex !important;
        width: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        flex-shrink: 0;
    }

    .nav-cta {
        width: auto !important;
        padding: 0.5rem 1rem !important;
        margin: 0 !important;
        display: inline-block !important;
        text-align: center !important;
    }

    /* Desktop mega dropdown */
    .mega-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background-color: #ffffff !important;
        border-bottom: 1px solid #e5e7eb !important;
        max-height: 500px !important;
    }

    .mega-dropdown-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }

    /* Grid layouts */
    .services-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .benefits-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .blog-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .case-studies-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .testimonials-carousel {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* Buttons */
    .btn {
        display: inline-block;
        width: auto;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-buttons {
        flex-direction: row;
    }

    .hero-buttons a {
        width: auto;
    }
}

/* ===== LARGE DESKTOPS (1920px+) ===== */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }

    h1 {
        font-size: 44px;
    }

    h2 {
        font-size: 36px;
    }

    section {
        padding: 5rem 0;
    }

    .mega-dropdown-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ===== FOLDABLE PHONES (Dual Screen Support) ===== */
@media (horizontal-viewport-segments: 2) {
    body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }

    .navbar {
        grid-column: 1 / -1;
    }

    main {
        grid-column: 1 / -1;
    }
}

/* ===== LANDSCAPE ORIENTATION (small height) ===== */
@media (orientation: landscape) and (max-height: 600px) {
    section {
        padding: 1.5rem 0;
    }

    .hero {
        padding: 1.5rem 0;
    }

    .hero .container {
        grid-template-columns: 1fr 1fr !important;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 13px;
    }

    h2 {
        font-size: 20px;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATION ===== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    a,
    input,
    button {
        min-height: 44px;
        min-width: 44px;
    }

    /* More spacing for touch */
    .nav-link {
        padding: 1rem;
    }

    /* Remove hover effects on touch devices */
    .service-card:hover {
        transform: none !important;
    }

    .case-study-card:hover {
        transform: none !important;
    }

    /* Add active/focus states instead */
    .service-card:active,
    .service-card:focus {
        opacity: 0.8;
    }
}

/* ===== HIGH RESOLUTION DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #f0f0f0;
    }

    .navbar {
        background-color: #222;
    }

    .card,
    .service-card,
    .case-study-card,
    .blog-card,
    .pricing-card {
        background-color: #222;
        color: #f0f0f0;
    }

    input,
    textarea,
    select {
        background-color: #333;
        color: #f0f0f0;
        border-color: #444;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .footer,
    .nav-cta,
    .nav-menu,
    .mobile-menu-toggle {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    p, li {
        page-break-inside: avoid;
    }
}
