/* ===============================================
   MOBILE OPTIMIZATION - FIXED VERSION
   Only affects mobile devices, preserves desktop design
   =============================================== */

/* ================= MOBILE MENU TOGGLE (HIDDEN ON DESKTOP) ================= */
.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: #111;
        cursor: pointer;
        padding: 10px;
        z-index: 1001;
    }

    .navbar-transparent .mobile-menu-toggle {
        color: #ffffff;
    }
}

/* ================= MOBILE NAVIGATION (ONLY ON MOBILE) ================= */
@media (max-width: 768px) {
    /* Mobile menu panel */
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        gap: 0;
        padding: 80px 0 20px;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .navbar-transparent .nav-links {
        background: #ffffff;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #e9ecef;
    }

    .nav-links a {
        display: block;
        padding: 15px 25px;
        width: 100%;
        color: #333 !important;
        text-shadow: none !important;
    }

    /* Mobile dropdown */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .dropdown.active .dropdown-menu {
        max-height: 400px;
    }

    .dropdown > a {
        position: relative;
    }

    .dropdown > a::after {
        content: "▼";
        position: absolute;
        right: 25px;
        font-size: 0.7rem;
        transition: transform 0.3s ease;
    }

    .dropdown.active > a::after {
        transform: rotate(180deg);
    }

    .dropdown-menu a {
        padding-left: 40px !important;
        background: #f8f9fa;
        color: #333 !important;
    }

    /* Overlay when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* ================= MOBILE-ONLY RESPONSIVE ADJUSTMENTS ================= */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding: 0 15px;
    }

    /* Hero sections */
    .hero,
    .about-hero,
    .works-hero {
        padding: 60px 0;
        min-height: 60vh;
    }

    .hero-content h1,
    .about-hero h1,
    .works-hero h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    /* Section padding */
    .about-intro,
    .mission-vision,
    .why-choose,
    .hse-commitment,
    .cta-section,
    .portfolio-section,
    .works-stats,
    .works-cta,
    .core-values {
        padding: 50px 0 !important;
    }

    /* Grids become single column */
    .grid-2-col,
    .mv-grid,
    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    .values-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .features-grid,
    .why-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px;
    }

    /* Contact form */
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 25px;
    }

    /* Buttons */
    .cta-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
    }

    /* Filter buttons */
    .filter-buttons {
        gap: 10px;
    }

    .filter-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

/* ================= VERY SMALL DEVICES (< 576px) ================= */
@media (max-width: 575px) {
    .hero-content h1,
    .about-hero h1,
    .works-hero h1 {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .stat-number {
        font-size: 2.5rem;
    }
}

/* ================= TABLET ADJUSTMENTS (768px - 991px) ================= */
@media (min-width: 769px) and (max-width: 991px) {
    .values-grid,
    .features-grid,
    .why-grid,
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* ================= TOUCH OPTIMIZATION (MOBILE ONLY) ================= */
@media (max-width: 768px) {
    /* Better touch targets */
    .nav-links a,
    .filter-btn,
    button {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Prevent zoom on input focus (iOS) */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Remove tap highlight */
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ================= FIX IOS VIEWPORT HEIGHT ================= */
@media (max-width: 768px) {
    .hero-fullscreen,
    .hero,
    .about-hero,
    .works-hero {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

/* ================= LANDSCAPE MODE (MOBILE) ================= */
@media (max-width: 768px) and (orientation: landscape) {
    .hero,
    .about-hero,
    .works-hero {
        min-height: 70vh;
        padding: 40px 0;
    }

    section {
        padding: 40px 0 !important;
    }
}

/* ================= SMOOTH SCROLLING ================= */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ================= MOBILE IMAGES ================= */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    .project-image,
    .about-image img {
        height: auto;
        min-height: 200px;
    }
}

/* ================= PREVENT HORIZONTAL SCROLL ================= */
body {
    overflow-x: hidden;
}

/* ================= 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;
    }
}