/* =========================================================================
   MOBILE FIXES - Comprehensive Mobile Responsiveness Optimization
   Created: 2025
   Purpose: Fix all mobile breaking issues across the site
   Apply after all other CSS files
   ========================================================================= */

/* =========================================================================
   GLOBAL FIXES - Prevent Horizontal Scrolling
   ========================================================================= */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* Ensure containers respect viewport */

/* =========================================================================
   HERO SECTION FIXES
   ========================================================================= */
@media (max-width: 768px) {
    .hero {
        padding: 140px 15px 60px 15px !important;
        min-height: auto;
    }

    /* Add gradient background to hero-background */
    .hero-background {
        background: linear-gradient(135deg, rgba(50, 17, 204, 0.05) 0%, rgba(250, 79, 7, 0.05) 100%);
        max-width: 100vw;
        overflow: hidden;
    }

    /* Keep orbs but reduce size and prevent overflow */
    .gradient-orb {
        max-width: 100vw;
        overflow: hidden;
    }

    .orb-1 {
        width: 300px !important;
        height: 300px !important;
        top: -100px !important;
        right: -50px !important;
    }

    .orb-2 {
        width: 250px !important;
        height: 250px !important;
        bottom: -75px !important;
        left: -50px !important;
    }

    .orb-3 {
        width: 200px !important;
        height: 200px !important;
    }

    .hero-pattern {
        max-width: 100vw;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 140px 12px 40px 12px !important;
    }

    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }

    .hero-description {
        font-size: 0.95rem !important;
    }

    .stat-number {
        font-size: 1.8rem !important;
    }

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

@media (max-width: 360px) {
    .hero {
        padding: 70px 10px 30px 10px !important;
    }

    .hero-title {
        font-size: 1.5rem !important;
    }

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

/* =========================================================================
   SERVICES GRID FIXES
   ========================================================================= */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .services-grid {
        gap: 1rem !important;
    }
}

/* =========================================================================
   CONTACT FORM FIXES
   ========================================================================= */
@media (max-width: 768px) {
    .contact-form-wrapper {
        padding: 2rem !important;
        border-radius: 20px !important;
    }
}

@media (max-width: 480px) {
    .contact-form-wrapper {
        padding: 1.5rem !important;
        border-radius: 16px !important;
      margin: 0;
        margin-left: -6px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
    }

    /* reCAPTCHA proper scaling */
    .g-recaptcha {
        transform: scale(0.85) !important;
        transform-origin: 0 0 !important;
        margin-bottom: 10px !important;
    }

    .form-group.recaptcha-wrapper {
        overflow: hidden;
        max-width: 100%;
    }
}

@media (max-width: 360px) {
    .contact-form-wrapper {
        padding: 1.25rem !important;
        border-radius: 12px !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
        border-radius: 8px !important;
        width: 100%;
    }

    .g-recaptcha {
        transform: scale(0.77) !important;
        transform-origin: 0 0 !important;
        margin-bottom: 8px !important;
    }

    .form-group.recaptcha-wrapper {
        display: flex;
        justify-content: center;
        overflow: hidden;
    }
}

@media (max-width: 340px) {
    .g-recaptcha {
        transform: scale(0.72) !important;
    }
}

/* =========================================================================
   NAVIGATION FIXES
   ========================================================================= */
@media (max-width: 968px) {
    .navbar, .navbar.scrolled {
        padding: 0 !important;
    }

    .nav-container {
        padding: 0 15px !important;
        height: 130px !important;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px !important;
        height: 80px !important;
    }

    .logo-img {
        height: 40px !important;
    }

    .dropdown-menu li a {
        padding: 0.65rem 2rem !important;
        font-size: 0.85rem !important;
    }

    .has-dropdown .nav-link {
        padding: 0.875rem 1.5rem !important;
    }
}

@media (max-width: 360px) {
    .dropdown-menu li a {
        padding: 0.6rem 1.5rem !important;
        font-size: 0.8rem !important;
    }
}

/* =========================================================================
   PORTFOLIO SLIDER FIXES
   ========================================================================= */
@media (max-width: 768px) {
    .portfolio-item {
        flex: 0 0 calc(100% - 20px) !important;
        min-width: 280px !important;
        max-width: 100% !important;
    }

    .portfolio-slider-wrapper {
        padding: 20px 30px !important;
    }
}

@media (max-width: 480px) {
    .portfolio-item {
        min-width: 260px !important;
    }

    .portfolio-slider-wrapper {
        padding: 15px 20px !important;
    }
}

@media (max-width: 360px) {
    .portfolio-item {
        min-width: calc(100vw - 80px) !important;
    }

    .portfolio-slider-wrapper {
        padding: 15px 15px !important;
    }
}

/* =========================================================================
   FAQ ACCORDION FIXES
   ========================================================================= */
@media (max-width: 480px) {
    .faq-question {
        padding: 16px !important;
    }

    .faq-question h3 {
        font-size: 15px !important;
        padding-right: 25px !important;
    }

    .faq-item.active .faq-answer {
        padding: 0 16px 16px 16px !important;
    }
}

@media (max-width: 360px) {
    .faq-question {
        padding: 14px !important;
    }

    .faq-question h3 {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    .faq-icon {
        width: 26px !important;
        height: 26px !important;
    }

    .faq-icon i {
        font-size: 11px !important;
    }

    .faq-item.active .faq-answer {
        padding: 0 14px 14px 14px !important;
    }

    .faq-answer p,
    .faq-answer li {
        font-size: 13px !important;
    }
}

/* =========================================================================
   GRID SYSTEM FIXES
   ========================================================================= */
@media (max-width: 768px) {
    .portfolio-grid,
    .why-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

@media (max-width: 480px) {
    .portfolio-grid,
    .why-grid {
        gap: 1.5rem !important;
    }

    .container {
        padding: 0px !important;
    }
}

@media (max-width: 360px) {
    .portfolio-grid,
    .why-grid {
        gap: 1rem !important;
    }

    .container {
        padding: 0 12px !important;
    }
}

/* =========================================================================
   MOBILE STICKY FOOTER FIXES
   ========================================================================= */
@media (max-width: 360px) {
    .mobile-contact-footer {
        padding: 10px 0 !important;
    }

    .mobile-contact-btn {
        padding: 5px 8px !important;
    }

    .mobile-contact-btn i {
        font-size: 18px !important;
        margin-bottom: 2px !important;
    }

    .mobile-contact-btn span {
        font-size: 9px !important;
    }

    /* Prevent footer overlap */
    .footer {
        padding-bottom: 90px !important;
    }
}

/* =========================================================================
   BUTTON AND INTERACTION FIXES
   ========================================================================= */
@media (max-width: 480px) {
    .btn-large {
        padding: 12px 24px !important;
        font-size: 14px !important;
        width: 100%;
    }

    .btn {
        min-height: 44px; /* iOS minimum touch target */
    }
}

/* =========================================================================
   Z-INDEX FIX - Dropdown Above Navbar
   ========================================================================= */
.dropdown-menu {
    z-index: 1001 !important;
}

.navbar {
    z-index: 1000 !important;
}

.mobile-contact-footer {
    z-index: 9999 !important;
}

/* =========================================================================
   UTILITY CLASSES FOR MOBILE
   ========================================================================= */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* Prevent text overflow */
@media (max-width: 480px) {
    h1, h2, h3, h4, h5, h6, p, span, a {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* =========================================================================
   END OF MOBILE FIXES
   ========================================================================= */
