/* Mobile Responsive Fixes */

/* ==========================
   FOOTER EMAIL SUBSCRIPTION FIX 
   ========================== */

/* Small mobile screens - Stack email input and button vertically */
@media (max-width: 575.98px) {
    .newsletter-form .input-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem;
    }
    
    .newsletter-form .form-control {
        width: 100% !important;
        margin-bottom: 0 !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        border-radius: 6px !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        background: rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
    }
    
    .newsletter-form .form-control::placeholder {
        color: rgba(255, 255, 255, 0.7) !important;
    }
    
    .newsletter-form .form-control:focus {
        border-color: #007bff !important;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
        background: rgba(255, 255, 255, 0.15) !important;
    }
    
    .newsletter-form .btn {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
        background-color: #007bff !important;
        border-color: #007bff !important;
        color: white !important;
        transition: all 0.3s ease !important;
    }
    
    .newsletter-form .btn:hover {
        background-color: #0056b3 !important;
        border-color: #004085 !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3) !important;
    }
    
    .newsletter-form .btn:active {
        transform: translateY(0) !important;
    }
}

/* Medium mobile screens - Better spacing */
@media (min-width: 576px) and (max-width: 767.98px) {
    .newsletter-form .input-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem;
    }
    
    .newsletter-form .form-control {
        width: 100% !important;
        padding: 0.6rem 0.9rem !important;
        font-size: 0.9rem !important;
        border-radius: 5px !important;
    }
    
    .newsletter-form .btn {
        width: 100% !important;
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
        border-radius: 5px !important;
    }
}

/* Tablet screens - Keep horizontal but better spacing */
@media (min-width: 768px) and (max-width: 991.98px) {
    .newsletter-form .input-group {
        display: flex !important;
        flex-direction: row !important;
    }
    
    .newsletter-form .form-control {
        flex: 1 !important;
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-right: none !important;
    }
    
    .newsletter-form .btn {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
        padding: 0.5rem 1rem !important;
        white-space: nowrap !important;
    }
}

/* ==========================
   HEADER MOBILE MENU BUTTON FIX 
   ========================== */

/* Hide mobile menu button when it shouldn't show */
@media (min-width: 1200px) {
    .mobile-nav-toggle {
        display: none !important;
    }
    
    .mobile-nav-overlay {
        display: none !important;
    }
}

/* Ensure mobile menu button shows correctly on smaller screens */
@media (max-width: 1199.98px) {
    .mobile-nav-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        padding: 6px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        border-radius: 6px !important;
    }
    
    .mobile-nav-toggle:hover {
        background-color: rgba(0, 123, 255, 0.1) !important;
    }
    
    .mobile-nav-toggle:focus {
        outline: none !important;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    }
    
    .mobile-nav-toggle .hamburger-line {
        display: block !important;
        width: 22px !important;
        height: 2.5px !important;
        background-color: var(--primary-color, #003366) !important;
        margin: 3px 0 !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-radius: 2px !important;
    }
    
    /* Active state animations */
    .mobile-nav-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
        background-color: #fff !important;
    }
    
    .mobile-nav-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0 !important;
        transform: scale(0) !important;
    }
    
    .mobile-nav-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px) !important;
        background-color: #fff !important;
    }
}

/* ==========================
   ADDITIONAL MOBILE FIXES 
   ========================== */

/* Fix header spacing on very small screens */
@media (max-width: 575.98px) {
    .main-header .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .main-header .row {
        margin-left: -0.375rem !important;
        margin-right: -0.375rem !important;
    }
    
    .main-header .row > div {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
    }
    
    /* Logo adjustments for small screens */
    .logo-link .logo-image {
        width: 35px !important;
        height: 35px !important;
    }
    
    .logo-text h1 {
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
    }
    
    .logo-text .tagline {
        font-size: 0.65rem !important;
    }
}

/* Fix footer spacing issues on mobile */
@media (max-width: 767.98px) {
    .main-footer .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Better spacing for footer sections */
    .footer-widget {
        margin-bottom: 2rem !important;
    }
    
    .footer-widget:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Footer company info adjustments */
    .footer-left-col p {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Footer links adjustments */
    .footer-widget ul li a {
        font-size: 0.85rem !important;
        padding: 0.25rem 0 !important;
        display: block !important;
    }
    
    /* Social links better spacing */
    .social-links {
        gap: 1.25rem !important;
        margin-top: 1rem !important;
    }
    
    .social-links a {
        font-size: 1.2rem !important;
        padding: 0.5rem !important;
        border-radius: 50% !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        transition: all 0.3s ease !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .social-links a:hover {
        background-color: rgba(255, 255, 255, 0.2) !important;
        transform: scale(1.1) !important;
    }
}

/* ==========================
   ACCESSIBILITY IMPROVEMENTS 
   ========================== */

/* Better focus states for mobile */
@media (max-width: 767.98px) {
    .newsletter-form .form-control:focus,
    .newsletter-form .btn:focus,
    .mobile-nav-toggle:focus {
        outline: 2px solid #007bff !important;
        outline-offset: 2px !important;
    }
    
    /* Better touch targets */
    .footer-widget ul li a {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .social-links a {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* ==========================
   PERFORMANCE OPTIMIZATIONS 
   ========================== */

/* Use transform3d for better performance */
.newsletter-form .btn,
.mobile-nav-toggle,
.social-links a {
    transform: translate3d(0, 0, 0) !important;
    backface-visibility: hidden !important;
}

/* Prevent text selection on interactive elements */
.mobile-nav-toggle,
.newsletter-form .btn {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}
