/* ═══════════════════════════════════════════════════════════════
   ANDROID & iOS MOBILE COMPATIBILITY FIXES
   Comprehensive mobile optimizations for all devices
   ═══════════════════════════════════════════════════════════════ */

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Fix viewport on mobile */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    html {
        height: -webkit-fill-available;
    }
    
    body {
        min-height: -webkit-fill-available;
    }
}

/* Touch-friendly tap targets */
a, button, input, select, textarea {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

/* Mobile Hero Section Optimizations */
@media (max-width: 991px) {
    .vanta-hero-section {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    .hero-centered-heading {
        top: 15% !important;
        padding: 0 15px;
    }
    
    .hero-main-title {
        font-size: 28px !important;
        line-height: 1.2;
    }
    
    .hero-main-caption {
        font-size: 16px !important;
    }
    
    .hero-anniversary-headline {
        font-size: 14px !important;
        margin-top: 10px;
    }
    
    /* Center images vertically */
    .vanta-center-image,
    .vanta-right-image {
        margin-top: 20px;
    }
    
    .vanta-center-image img,
    .vanta-right-image img {
        max-width: 100%;
        height: auto;
    }
    
    /* Hero buttons */
    .hero-cta-button,
    .hero-magazine-button-wrapper {
        position: relative;
        margin-top: 20px;
        text-align: center;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
    
    .hero-contact-info {
        position: relative;
        margin-top: 20px;
        text-align: center;
        right: auto !important;
        bottom: auto !important;
    }
}

/* Mobile Sections - Better Spacing */
@media (max-width: 767px) {
    .ptb-100 {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }
    
    .pt-100 {
        padding-top: 50px !important;
    }
    
    .pb-70 {
        padding-bottom: 40px !important;
    }
    
    /* Section Titles */
    .section-title {
        margin-bottom: 30px;
    }
    
    .section-title h2 {
        font-size: 24px !important;
        line-height: 1.3;
    }
    
    .section-title .sub-title {
        font-size: 14px !important;
    }
    
    /* Images - Responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Cards - Full Width on Mobile */
    .single-services-box,
    .single-case-study,
    .single-certification-box {
        margin-bottom: 25px;
    }
    
    /* Text - Readable Sizes */
    p {
        font-size: 15px;
        line-height: 1.6;
    }
    
    h1 { font-size: 28px !important; }
    h2 { font-size: 24px !important; }
    h3 { font-size: 20px !important; }
    h4 { font-size: 18px !important; }
    h5 { font-size: 16px !important; }
    h6 { font-size: 14px !important; }
    
    /* Buttons - Touch Friendly */
    .default-btn {
        padding: 12px 25px !important;
        font-size: 14px !important;
        min-height: 44px; /* Minimum touch target */
    }
    
    /* Forms - Mobile Friendly */
    .form-control {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 15px;
        min-height: 44px;
    }
    
    /* Container - Full Width */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Rotating 3D Logo - Smaller on Mobile */
    .rotating-3d-logo {
        top: 70px !important;
        left: 15px !important;
    }
    
    .rotating-3d-logo img {
        width: 60px !important;
    }
}

/* Capabilities Section - Mobile */
@media (max-width: 767px) {
    .services-area .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .services-area [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 20px;
    }
    
    .single-services-box {
        padding: 25px 20px;
    }
    
    .single-services-box .icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    .single-services-box h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .single-services-box p {
        font-size: 14px;
    }
}

/* Case Studies - Mobile */
@media (max-width: 767px) {
    .case-studies-area .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .case-studies-area [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 25px;
    }
    
    .case-study-image {
        height: 200px !important;
    }
    
    .case-study-content {
        padding: 20px !important;
    }
    
    .case-study-content h3 {
        font-size: 18px !important;
    }
}

/* Partners Section - Mobile */
@media (max-width: 767px) {
    .partner-slides {
        padding: 0 10px;
    }
    
    .partner-item {
        padding: 15px;
    }
    
    .partner-item img {
        max-width: 120px !important;
    }
}

/* Project Gallery - Mobile */
@media (max-width: 767px) {
    .magazine-container {
        max-width: 95vw !important;
        height: auto !important;
        min-height: 400px;
    }
    
    .magazine-wrapper {
        padding: 1rem 0.5rem;
    }
}

/* Contact Form - Mobile */
@media (max-width: 767px) {
    .contact-form {
        margin-top: 30px;
    }
    
    .contact-info {
        margin-bottom: 30px;
    }
    
    .contact-info ul li {
        padding: 20px 0;
    }
}

/* Footer - Mobile */
@media (max-width: 767px) {
    .footer-area {
        padding-top: 50px;
        padding-bottom: 30px;
    }
    
    .single-footer-widget {
        margin-bottom: 30px;
    }
    
    .copyright-area {
        text-align: center;
        padding-top: 20px;
    }
}

/* WhatsApp Icon - Mobile */
@media (max-width: 767px) {
    .hero-whatsapp-icon {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        right: 20px !important;
    }
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

* {
    box-sizing: border-box;
}

/* Smooth scrolling on mobile */
@media (max-width: 767px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix iOS Safari address bar */
    .vanta-hero-section {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    /* Fix iOS input zoom */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
    
    /* Fix iOS button highlights */
    button, a {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.3);
    }
}

/* Android specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Fix Android Chrome address bar */
    .vanta-hero-section {
        min-height: 100vh;
        min-height: calc(100vh - env(safe-area-inset-bottom));
    }
    
    /* Fix Android touch delays */
    a, button {
        touch-action: manipulation;
    }
}

/* Landscape orientation fixes */
@media (max-width: 991px) and (orientation: landscape) {
    .vanta-hero-section {
        min-height: auto;
        padding: 80px 0;
    }
    
    .hero-centered-heading {
        top: 10% !important;
    }
    
    .main-banner {
        padding: 60px 0;
    }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .hero-main-title {
        font-size: 24px !important;
    }
    
    .hero-main-caption {
        font-size: 14px !important;
    }
    
    .section-title h2 {
        font-size: 20px !important;
    }
    
    .mobile-nav-drawer {
        width: 95%;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .mobile-menu-toggle {
        top: max(15px, env(safe-area-inset-top));
        left: max(15px, env(safe-area-inset-left));
    }
    
    .vanta-hero-section {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* Performance optimizations */
@media (max-width: 767px) {
    /* Reduce animations on mobile for better performance */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* Disable Vanta on very small screens */
    @media (max-width: 480px) {
        #vanta-bg {
            display: none;
        }
        
        .vanta-hero-section {
            background: linear-gradient(135deg, #000000 0%, #1a3a5c 50%, #3a7bd5 100%);
        }
    }
}
