/* ============================================================
   MR EGYPT TRIPS — Mobile Responsive CSS v1.0
   Covers: 320px → 1024px (phones & tablets)
   ============================================================ */

/* ===== PWA Install Banner ===== */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #001F3F 0%, #0d47a1 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.pwa-install-banner.show {
    transform: translateY(0);
}
.pwa-install-banner .pwa-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}
.pwa-install-banner .pwa-text {
    flex: 1;
}
.pwa-install-banner .pwa-text h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}
.pwa-install-banner .pwa-text p {
    margin: 2px 0 0;
    font-size: 0.75rem;
    opacity: 0.8;
}
.pwa-install-banner .btn-pwa-install {
    background: #fff;
    color: #001F3F;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
}
.pwa-install-banner .btn-pwa-dismiss {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
}

/* ===== GLOBAL FLUID TYPOGRAPHY ===== */
@media (max-width: 1024px) {
    html { font-size: 15px; }
    
    /* Icon size limits — prevent oversized icons on mobile */
    .fa-4x, .fa-5x, .fa-6x { font-size: 2.5rem !important; }
    .fa-3x { font-size: 2rem !important; }
    .fa-2x { font-size: 1.5rem !important; }
    i[style*="font-size: 5rem"], i[style*="font-size: 4rem"], 
    i[style*="font-size:5rem"], i[style*="font-size:4rem"] {
        font-size: 2.5rem !important;
    }
    
    /* Image size limits */
    img[height="100"], img[height="120"], img[height="150"] {
        height: auto !important;
        max-height: 80px !important;
    }
}

/* ===== TABLETS (769px - 1024px) ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    .container { max-width: 720px; }
    
    .display-3 { font-size: 2.5rem !important; }
    .display-4 { font-size: 2rem !important; }
    .display-6 { font-size: 1.5rem !important; }
    
    /* Trip cards: 2 per row on tablet */
    #tripsContainer .col-lg-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    /* Netflix carousel */
    .netflix-card { min-width: 200px; }
    
    /* Gallery */
    .gallery-carousel-section .gallery-item {
        width: 200px !important;
    }
}

/* ===== LARGE PHONES & SMALL TABLETS (429px - 768px) ===== */
@media (max-width: 768px) {
    .container { padding-left: 16px; padding-right: 16px; }
    
    /* Typography scaling */
    .display-3 { font-size: 2rem !important; }
    .display-4 { font-size: 1.75rem !important; }
    .display-6 { font-size: 1.3rem !important; }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    .lead { font-size: 1rem !important; }
    
    /* Hero section */
    .hero-section, .carousel-inner { min-height: 60vh !important; }
    #heroCarousel { max-height: 70vh !important; }
    .hero-content { text-align: center !important; }
    .hero-content .d-flex { justify-content: center; flex-wrap: wrap; }
    .hero-content .btn { width: 100%; max-width: 300px; }
    .hero-content h1 { font-size: 1.8rem !important; line-height: 1.3; }
    .hero-content p { font-size: 0.95rem !important; }

    /* Carousel controls */
    .carousel-control-prev, .carousel-control-next { width: 10% !important; }
    .carousel-control-prev-icon, .carousel-control-next-icon {
        padding: 8px !important;
        width: 32px; height: 32px;
    }
    
    /* Urgency bar */
    .urgency-bar { font-size: 0.8rem; padding: 8px 0; }
    .urgency-bar .container { flex-direction: column; gap: 4px !important; }
    .countdown-digit { font-size: 1.1rem; min-width: 28px; }
    
    /* Trust marquee */
    .trust-marquee-wrapper { padding: 6px 0 !important; }
    .trust-marquee img { height: 22px !important; margin: 0 10px !important; }
    .trust-marquee h6 { font-size: 0.7rem !important; }
    
    /* Stats section */
    #statsSection .stat-item i { font-size: 1.3rem !important; margin-bottom: 8px !important; }
    #statsSection h2 { font-size: 1.3rem; }
    #statsSection p { font-size: 0.7rem; }
    
    /* Search bar */
    .search-glass-wrapper { border-radius: 12px !important; }
    #tripSearch { font-size: 0.9rem !important; padding: 10px !important; }
    #voiceSearchBtn { display: none; }
    
    /* Story bubbles */
    .story-bubbles-wrap { max-width: 100% !important; border-radius: 12px !important; overflow-x: auto; }
    .story-bubble { margin: 0 4px; }
    .story-ring img { width: 40px; height: 40px; }
    
    /* Category filters */
    #categoryFilters { gap: 6px !important; }
    .filter-btn { padding: 6px 14px !important; font-size: 0.8rem !important; }
    
    /* Trip cards: single column */
    #tripsContainer .col-lg-4,
    #tripsContainer .col-sm-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .trip-card .card-body { padding: 16px !important; }
    .trip-card .card-title { font-size: 1.1rem; }
    .trip-card .h4 { font-size: 1.2rem !important; }
    .trip-card .d-flex.gap-2 { flex-direction: column; }
    .trip-card .d-flex.gap-2 .btn { width: 100%; }
    
    /* Netflix carousel */
    .netflix-carousel-container { gap: 12px; }
    .netflix-card { min-width: 160px; }
    .netflix-rank { font-size: 3rem; }
    
    /* Concierge */
    .concierge-box { padding: 20px !important; }
    .concierge-btn i { font-size: 1.5rem !important; }
    
    /* Parallax section */
    .parallax-story { padding: 40px 0; }
    .parallax-content { padding: 20px; }
    .parallax-content .display-4 { font-size: 1.5rem !important; }
    .parallax-content .row .col-md-4 { margin-bottom: 16px; }
    .parallax-content h4 { font-size: 1rem; }
    .parallax-content i.fa-3x { font-size: 1.8rem !important; }
    
    /* Gallery */
    .gallery-carousel-section .gallery-item {
        width: 150px !important;
        height: 150px !important;
    }
    
    /* Footer */
    footer .row > [class*="col-"] { margin-bottom: 24px; }
    footer .text-end, footer .text-start { text-align: center !important; }
    
    /* Modals */
    .modal-dialog { margin: 8px; }
    .modal-body { padding: 16px; }
    
    /* Tables */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 500px; }
    
    /* Forms */
    .form-control, .form-select { font-size: 16px !important; } /* Prevent iOS zoom on focus */
    
    /* Floating buttons */
    .whatsapp-float, .scroll-to-top {
        bottom: 80px !important; /* Make room for PWA banner */
    }
    
    /* Touch targets — minimum 44px for accessibility */
    .btn-sm { min-height: 38px; min-width: 38px; }
    a, button { min-height: 44px; display: inline-flex; align-items: center; }
    .nav-link { padding: 12px 16px !important; }
    
    /* Hide desktop-only elements */
    .d-none-mobile { display: none !important; }
}

/* ===== STANDARD PHONES (376px - 428px) ===== */
@media (max-width: 428px) {
    .container { padding-left: 12px; padding-right: 12px; }
    
    .display-3 { font-size: 1.6rem !important; }
    .display-4 { font-size: 1.4rem !important; }
    .display-6 { font-size: 1.2rem !important; }
    
    /* Hero */
    .hero-section, .carousel-inner { min-height: 50vh !important; }
    .hero-content h1 { font-size: 1.5rem !important; }
    .hero-content p { font-size: 0.85rem !important; max-width: 100%; }
    .hero-content { padding: 0 8px; }
    .hero-content .row { margin-top: 60px !important; }
    
    /* Stats compact */
    #statsSection .col-6 { padding: 4px !important; }
    #statsSection i { font-size: 1.2rem !important; }
    #statsSection h2 { font-size: 1.1rem; margin-bottom: 2px; }
    #statsSection p { font-size: 0.65rem; margin-bottom: 0; }
    
    /* Concierge buttons smaller */
    .concierge-btn { padding: 10px !important; }
    .concierge-btn i { font-size: 1.2rem !important; }
    .concierge-btn span { font-size: 0.7rem !important; }
    
    /* Booking form compact */
    .modal-body .row .col-md-6 { padding: 4px 0; }
    
    /* Netflix */
    .netflix-card { min-width: 140px; }
    
    /* PWA banner compact */
    .pwa-install-banner { padding: 12px 14px; gap: 8px; }
    .pwa-install-banner .pwa-icon { width: 40px; height: 40px; }
    .pwa-install-banner .pwa-text h6 { font-size: 0.85rem; }
    .pwa-install-banner .btn-pwa-install { padding: 6px 14px; font-size: 0.8rem; }
}

/* ===== SMALL PHONES (320px - 375px) ===== */
@media (max-width: 375px) {
    html { font-size: 13px; }
    .container { padding-left: 10px; padding-right: 10px; }
    
    .display-3 { font-size: 1.4rem !important; }
    .hero-content h1 { font-size: 1.3rem !important; }
    
    /* Category filters scroll horizontal */
    #categoryFilters { 
        flex-wrap: nowrap !important; 
        overflow-x: auto;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 8px;
    }
    #categoryFilters::-webkit-scrollbar { display: none; }
    .filter-btn { flex-shrink: 0; }
    
    /* Stats 2x2 grid */
    #statsSection .col-6 { flex: 0 0 50%; }
    
    /* Netflix */
    .netflix-card { min-width: 120px; }
    .netflix-rank { font-size: 2rem; }
    
    /* Reduce paddings */
    section { padding-top: 24px !important; padding-bottom: 24px !important; }
    .py-5 { padding-top: 24px !important; padding-bottom: 24px !important; }
    .mb-5 { margin-bottom: 24px !important; }
}

/* ===== NAVBAR MOBILE ===== */
@media (max-width: 768px) {
    /* Navbar compact */
    .navbar { padding: 8px 0; }
    .navbar-brand img { max-height: 36px; }
    
    /* Language switcher compact */
    .lang-switcher .btn, .nav-item .btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    /* Dropdown full width on mobile */
    .navbar .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.2) !important;
        transform: none !important;
        padding: 20px;
    }
}

/* ===== LANDSCAPE MODE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section, .carousel-inner { min-height: 100vh !important; }
    .hero-content h1 { font-size: 1.5rem !important; }
    .hero-content p { display: none; }
    #statsSection { display: none; }
}

/* ===== SAFE AREA (notch phones) ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar { padding-top: env(safe-area-inset-top); }
    .pwa-install-banner { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== DARK MODE MOBILE TWEAKS ===== */
@media (max-width: 768px) {
    [data-theme="dark"] .trust-marquee-wrapper { background: #1a1a1a !important; }
    [data-theme="dark"] .search-glass-wrapper { background: #1e293b !important; }
    [data-theme="dark"] #searchDropdown { background: #1e293b !important; }
}

/* ===== PRINT STYLES ===== */
@media print {
    .pwa-install-banner, .whatsapp-float, .scroll-to-top,
    .urgency-bar, #smartConcierge, .trust-marquee-wrapper,
    .navbar-toggler { display: none !important; }
}

/* ===== SMOOTH SCROLLING ===== */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
