/* ==========================================================================
   FOOTER MOBILE RESPONSIVE IMPROVEMENTS
   ========================================================================== */

/* Base footer mobile optimizations */
@media (max-width: 991px) {
    .footer {
        text-align: center;
    }
    
    .footer .row > .col-lg-4,
    .footer .row > .col-lg-2 {
        margin-bottom: 2rem;
    }
    
    .footer h5 {
        margin-bottom: 1.25rem;
        font-size: 1.2rem;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .footer-links li {
        margin-bottom: 0;
    }
    
    .footer-links a {
        padding: 0.5rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile devices (≤768px) */
@media (max-width: 768px) {
    .footer {
        padding: 50px 0 25px;
    }
    
    .footer .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .footer .row > div {
        margin-bottom: 2.5rem;
    }
    
    /* Mobile newsletter form improvements */
    .footer .input-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }
    
    .footer .input-group .form-control {
        border-radius: 25px !important;
        width: 100% !important;
        min-height: 50px !important;
        font-size: 16px !important; /* Prevent iOS zoom */
        padding: 0.875rem 1.25rem !important;
        text-align: center !important;
        border: 2px solid rgba(255,255,255,0.3) !important;
        background: rgba(255,255,255,0.15) !important;
        color: white !important;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.1) !important;
    }
    
    .footer .input-group .form-control::placeholder {
        color: rgba(255,255,255,0.8) !important;
        text-align: center !important;
        font-size: 16px !important;
    }
    
    .footer .input-group .form-control:focus {
        background: rgba(255,255,255,0.25) !important;
        border-color: var(--secondary-color) !important;
        box-shadow: 0 0 0 3px rgba(245,158,11,0.4) !important;
        outline: none !important;
    }
    
    .footer .input-group .btn {
        border-radius: 25px !important;
        width: 100% !important;
        min-height: 50px !important;
        font-size: 16px !important;
        padding: 0.875rem 1.5rem !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }
    
    /* Mobile social links */
    .footer .social-links {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important;
        margin: 1.5rem auto !important;
        flex-wrap: wrap !important;
    }
    
    .footer .social-links a {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.2rem !important;
        margin-right: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        background: rgba(255,255,255,0.1) !important;
        border: 2px solid rgba(255,255,255,0.2) !important;
        transition: all 0.3s ease !important;
    }
    
    .footer .social-links a:hover {
        background: var(--secondary-color) !important;
        border-color: var(--secondary-color) !important;
        transform: translateY(-3px) !important;
        box-shadow: 0 6px 15px rgba(0,0,0,0.3) !important;
    }
    
    /* Center copyright section on mobile */
    .footer .row:last-child {
        text-align: center !important;
    }
    
    .footer .row:last-child .col-md-6 {
        text-align: center !important;
        margin-bottom: 1rem !important;
    }
    
    .footer .row:last-child .col-md-6:last-child {
        margin-bottom: 0 !important;
    }
    
    .footer .footer-links {
        justify-content: center !important;
    }
}

/* Small mobile devices (≤576px) */
@media (max-width: 576px) {
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .footer h5 {
        font-size: 1.15rem;
        margin-bottom: 1rem;
    }
    
    .footer p,
    .footer a,
    .footer li {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .footer .row > div {
        margin-bottom: 2rem;
    }
    
    /* Smaller newsletter form for very small screens */
    .footer .input-group {
        max-width: 320px !important;
    }
    
    .footer .input-group .form-control,
    .footer .input-group .btn {
        min-height: 48px !important;
        font-size: 15px !important;
    }
    
    /* Smaller social icons for very small screens */
    .footer .social-links {
        gap: 12px !important;
    }
    
    .footer .social-links a {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.1rem !important;
    }
    
    /* Reduce spacing */
    .footer hr {
        margin: 1.5rem 0 !important;
    }
    
    .footer .row:last-child .col-md-6 {
        margin-bottom: 0.75rem !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .footer .footer-links a {
        min-height: 44px;
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
        transition: background-color 0.2s ease;
    }
    
    .footer .footer-links a:active {
        background: rgba(255,255,255,0.1);
    }
    
    .footer .social-links a {
        min-width: 48px;
        min-height: 48px;
    }
    
    .footer .input-group .form-control {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .footer .input-group .btn {
        -webkit-tap-highlight-color: transparent;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .footer {
        border-top: 3px solid white;
    }
    
    .footer .social-links a {
        border: 2px solid white !important;
    }
    
    .footer .input-group .form-control {
        border: 2px solid white !important;
    }
}

/* Landscape orientation optimizations for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .footer {
        padding: 35px 0 20px;
    }
    
    .footer .row > div {
        margin-bottom: 1.5rem;
    }
    
    .footer .social-links {
        margin: 1rem auto !important;
    }
}

/* Large mobile screens (between 576px and 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .footer .input-group {
        max-width: 450px !important;
    }
    
    .footer .social-links a {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.25rem !important;
    }
    
    .footer h5 {
        font-size: 1.25rem;
    }
    
    .footer p,
    .footer a,
    .footer li {
        font-size: 0.95rem;
    }
}

/* Fix for specific mobile navigation footer links */
@media (max-width: 768px) {
    .footer .footer-links {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .footer .footer-links li {
        width: 100%;
        text-align: center;
        margin-bottom: 0;
    }
    
    .footer .footer-links a {
        display: block;
        width: 100%;
        padding: 0.75rem;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        transition: all 0.3s ease;
        border-radius: 5px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .footer .footer-links a:hover,
    .footer .footer-links a:active {
        color: var(--secondary-color);
        background: rgba(255,255,255,0.1);
        padding-left: 0.75rem;
    }
}

/* Ensure proper newsletter button styling on mobile */
@media (max-width: 768px) {
    .footer .btn-primary-custom {
        background: var(--secondary-color) !important;
        border: none !important;
        color: white !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3) !important;
    }
    
    .footer .btn-primary-custom:hover,
    .footer .btn-primary-custom:focus,
    .footer .btn-primary-custom:active {
        background: #d97706 !important;
        border: none !important;
        color: white !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4) !important;
    }
}

/* Additional mobile fixes for footer margins */
@media (max-width: 991px) {
    .footer .mb-4 {
        margin-bottom: 2rem !important;
    }
    
    .footer .mb-3 {
        margin-bottom: 1.5rem !important;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
    .footer a:focus,
    .footer button:focus,
    .footer input:focus {
        outline: 3px solid var(--secondary-color) !important;
        outline-offset: 2px !important;
        border-radius: 5px !important;
    }
    
    .footer .social-links a:focus {
        outline: 3px solid var(--secondary-color) !important;
        outline-offset: 3px !important;
    }
}