/* Mobile App Overlay Styles - Global functionality for encouraging app downloads */
/* Updated: 2024 - Small screen font size adjustments */

#mobile-app-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #4db0d5 0%, #1A1A3B 100%);
    display: none; /* Hidden by default, shown via JavaScript */
    overflow: hidden;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    /* Prevent overlay from affecting slick carousel calculations */
    transform: translateZ(0);
    will-change: transform;
    /* Prevent layout shifts and scrolling */
    contain: layout style paint;
    isolation: isolate;
}

.mobile-app-banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
    height: 100%;
    padding: 8% 5% 4% 5%; /* Increased horizontal padding for better spacing */
    text-align: center;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-y: auto;
    gap: 4%; /* Responsive gap based on container size */
}

.mobile-app-banner-text h3 {
    margin: 0 0 3% 0; /* Responsive margin */
    font-size: clamp(20px, 7vw, 36px); /* Increased responsive font size */
    font-weight: 700;
    color: #EEFF41;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    text-align: center;
}

.mobile-app-banner-text p {
    margin: 25px 0 4% 0; /* Added 25px top margin */
    font-size: clamp(12px, 4vw, 16px); /* Responsive font size */
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5; /* More line spacing */
    font-weight: 300;
    max-width: 85%; /* Reduced max width to prevent overflow */
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left;
}

.mobile-app-banner-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2%; /* Responsive gap */
    width: 100%;
    max-width: 85%; /* Reduced max width to match text */
    margin: 0 auto;
}

/* Close button (X) */
.mobile-app-banner-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    z-index: 100001;
    line-height: 1;
    padding: 0;
    margin: 10px 10px;
}

.mobile-app-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Continue to Website Button */
.continue-to-website-btn {
    display: inline-block;
    padding: 0;
    margin-top: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: underline;
    width: auto;
    max-width: none;
}

.continue-to-website-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}

/* App Store Buttons */
.app-store-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3%; /* Responsive gap */
    width: 100%;
    max-width: 100%;
}

#mobile-app-banner .app-store-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important; /* Remove padding since we're using images */
    background: transparent !important; /* Remove background since we're using images */
    border: none !important; /* Remove border since we're using images */
    border-radius: 0 !important; /* Remove border radius since we're using images */
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    max-width: 200px; /* Limit width for app store images */
    box-shadow: none !important;
    outline: none !important;
}

#mobile-app-banner .app-store-button:hover {
    transform: translateY(-2px);
    text-decoration: none;
    background: transparent !important;
    border: none !important;
}

#mobile-app-banner .app-store-button:hover .app-store-image {
    opacity: 0.8;
}

#mobile-app-banner .app-store-image {
    width: 100%;
    height: auto;
    max-width: 250px; /* Increased size for better readability */
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Prevent body scrolling when overlay is shown */
body.has-mobile-banner {
    overflow: hidden; /* Prevent scrolling when overlay is shown */
}

/* Desktop screens - hide overlay */
@media (min-width: 769px) {
    #mobile-app-banner {
        display: none !important;
    }
}

/* Small screens - adjust button sizes */
@media (max-width: 480px) {
    .mobile-app-banner-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .continue-to-website-btn {
        font-size: 14px;
        padding: 0;
        margin-top: 35px;
    }
}

/* Very small screens - extra tight spacing */
@media (max-width: 360px) and (max-height: 650px) {
    .mobile-app-banner-content {
        padding: 6% 4% 3% 4%; /* Increased horizontal padding for better spacing */
        gap: 3%; /* Smaller gap */
    }
    
    .mobile-app-banner-text h3 {
        font-size: clamp(18px, 6vw, 24px); /* Increased title range for small screens */
        margin-bottom: 2%;
        max-width: 90%; /* Ensure title doesn't overflow */
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
    
    #mobile-app-banner .mobile-app-banner-text p {
        font-size: 18px !important; /* Fixed 18px font size */
        margin-bottom: 8px !important;
        line-height: 1.4 !important; /* Increased line height for better readability */
        max-width: 300px !important; /* Adjusted max width */
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: left !important;
    }
    
    .mobile-app-banner-actions {
        max-width: 90%; /* Match text width for very small screens */
        align-items: center;
        justify-content: center;
    }
    
    #mobile-app-banner .app-store-button {
        max-width: 200px; /* Increased size for better readability */
    }
    
    #mobile-app-banner .app-store-image {
        max-width: 200px; /* Increased size for better readability */
    }
    
    .mobile-app-banner-close {
        top: 8px;
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
    
    .continue-to-website-btn {
        font-size: 13px;
        padding: 8px 16px;
        margin-top: 10px;
    }
}
