/*
====================================================
 Consolidated Responsive Styles
 - Combines: mobile-nav.css, mobile-bottom-nav.css, mobile-courses.css
 - Ordered by breakpoints for predictable overrides
   Breakpoints used (max-width): 991.98px, 768px/767.98px, 576px, 480px, 360px
   Plus orientation-specific and desktop fallback (min-width: 992px)
====================================================
*/
.courses-slider-container .sec-course-card { height: 320px;}

/* ======================== */
/* Mobile Navigation Styles */
/* ======================== */
@media (max-width: 991.98px) {
    /* Ensure navbar has proper stacking context */
    .navbar { position: relative !important; z-index: 1000000 !important; }
    /* Mobile Navigation Container */
    .navbar .navbar-collapse {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: white !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
        transition: left 0.3s ease-in-out !important;
        z-index: 1000001 !important;
        overflow-y: auto !important;
        padding: 1rem !important;
        display: block !important;
        transform: translateZ(0) !important;
        isolation: isolate !important;
    }

    /* Show mobile menu */
    .navbar .navbar-collapse.show {
        left: 0 !important;
        pointer-events: auto !important;
        touch-action: auto !important;
    }

    /* Mobile Navigation Items */
    .navbar .navbar-nav { margin: 0 !important; padding: 0 !important; width: 100% !important; flex-direction: column !important; }
    .navbar .navbar-nav .nav-item { width: 100% !important; margin: 0 !important; border-bottom: 1px solid #f0f0f0 !important; }
    .navbar .navbar-nav .nav-item:last-child { border-bottom: none !important; }
    .navbar .navbar-nav .nav-link {
        padding: 1rem 0 !important;
        font-size: 1rem !important;
        color: var(--text-primary) !important;
        display: flex !important;
        align-items: center !important;
        /* justify-content: space-between !important; */
        text-decoration: none !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        position: relative !important;
        z-index: 1000003 !important;
    }
    .navbar .navbar-nav .nav-link:hover { background: rgba(1, 88, 98, 0.05) !important; transform: translateX(5px) !important; }
    .navbar .navbar-nav .nav-link.active { background: var(--primary-color) !important; color: white !important; }
    .navbar .navbar-nav .nav-link i { width: 20px !important; margin-right: 0.75rem !important; color: inherit !important; font-size: 1.1rem !important; }

    /* Mobile Action Buttons */
    .navbar .d-flex { flex-direction: column !important; width: 100% !important; margin-top: 1rem !important; gap: 0.5rem !important; }
    .navbar .btn { width: 100% !important; margin: 0 !important; padding: 0.75rem 1rem !important; font-size: 0.9rem !important; cursor: pointer !important; pointer-events: auto !important; touch-action: manipulation !important; }

    /* Overlay for mobile menu */
    .navbar-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        background: rgba(0, 0, 0, 0.3) !important;
        z-index: 1000000 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease-in-out !important;
        pointer-events: none !important;
        transform: translateZ(0) !important;
    }
    .navbar-backdrop.show { visibility: visible !important; pointer-events: auto !important; cursor: pointer !important; }

    /* Close button for mobile menu */
    .navbar .navbar-close {
        position: absolute !important;
        top: 1rem !important;
        right: 1rem !important;
        background: none !important;
        border: none !important;
        font-size: 1.5rem !important;
        color: var(--text-muted) !important;
        cursor: pointer !important;
        padding: 0.5rem !important;
        border-radius: 50% !important;
        transition: all 0.3s ease !important;
        z-index: 1000002 !important;
        display: block !important;
        transform: translateZ(0) !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
    .navbar .navbar-close:hover { background-color: rgba(0, 0, 0, 0.1) !important; color: var(--text-primary) !important; }

    /* Prevent body scroll when menu is open */
    body.navbar-open { overflow: hidden !important; position: fixed !important; width: 100% !important; }

    /* Mobile menu header */
    .navbar .mobile-menu-header { padding: 1rem 0 !important; margin-bottom: 1rem !important; border-bottom: 2px solid var(--primary-color) !important; text-align: center !important; display: block !important; }
    .navbar .mobile-menu-header h5 { margin: 0 !important; color: var(--primary-color) !important; font-weight: 600 !important; font-size: 1.1rem !important; }

    /* Ensure navbar toggler is visible */
    .navbar .navbar-toggler { display: block !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; padding: 0.375rem 0.75rem !important; font-size: 1.25rem !important; line-height: 1.5 !important; border-radius: 0.375rem !important; transition: box-shadow 0.15s ease-in-out !important; z-index: 999999 !important; cursor: pointer !important; transform: translateZ(0) !important; background: transparent !important; }
    .navbar .navbar-toggler:focus { box-shadow: 0 0 0 0.2rem rgba(1, 88, 98, 0.25) !important; outline: 0 !important; }
    .navbar .navbar-toggler-icon { display: inline-block !important; width: 1.5em !important; height: 1.5em !important; vertical-align: middle !important; background-repeat: no-repeat !important; background-position: center !important; background-size: 100% !important; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important; }
}

/* Desktop fallback for navbar */
@media (min-width: 992px) {
    .navbar .navbar-collapse { position: static !important; width: auto !important; height: auto !important; background: transparent !important; box-shadow: none !important; transition: none !important; overflow: visible !important; padding: 0 !important; left: auto !important; transform: none !important; margin-top: 0 !important; border-left: none !important; }
    .navbar-backdrop { display: none !important; }
    .navbar .navbar-close { display: none !important; }
    .navbar .mobile-menu-header { display: none !important; }
    .navbar .navbar-toggler { display: none !important; }
    .navbar .navbar-nav { flex-direction: row !important; }
    .navbar .navbar-nav .nav-item { width: auto !important; border-bottom: none !important; border-left: none !important; }
    .navbar .navbar-nav .nav-link { padding: 0.5rem 1rem !important; font-size: 0.9rem !important; color: var(--text-primary) !important; border-radius: 0.375rem !important; transition: all 0.3s ease !important; display: block !important; align-items: center !important; justify-content: flex-start !important; text-decoration: none !important; white-space: nowrap !important; margin: 0 !important; border-left: none !important; background: transparent !important; transform: none !important; }
    .navbar .navbar-nav .nav-link:hover { background-color: rgba(1, 88, 98, 0.1) !important; color: var(--primary-color) !important; transform: none !important; text-decoration: none !important; border-left-color: transparent !important; }
    .navbar .navbar-nav .nav-link.active { background-color: var(--primary-color) !important; color: white !important; border-left-color: transparent !important; }
    .navbar .navbar-nav .nav-link i { font-size: 0.9rem !important; margin-right: 0.5rem !important; width: auto !important; text-align: left !important; color: inherit !important; }
    .navbar .d-flex { flex-direction: row !important; width: auto !important; margin-top: 0 !important; gap: 0.75rem !important; }
    .navbar .btn { width: auto !important; margin: 0 !important; padding: 0.5rem 1rem !important; font-size: 0.9rem !important; }
}

/* =============================== */
/* Small Laptop Screens (12-13 inch) */
/* =============================== */
@media (min-width: 992px) and (max-width: 1366px) {
    /* Smaller navbar for 12-13 inch laptops */
    .navbar .navbar-nav .nav-link { 
        padding: 0.4rem 0.75rem !important; 
        font-size: 0.8rem !important; 
    }
    .navbar .navbar-nav .nav-link i { 
        font-size: 0.8rem !important; 
        margin-right: 0.4rem !important; 
    }
    .navbar .btn { 
        padding: 0.4rem 0.75rem !important; 
        font-size: 0.8rem !important; 
    }
    .navbar .d-flex { 
        gap: 0.5rem !important; 
    }
    .navbar-brand .logo-img {
        max-height: 35px !important;
    }
}

/* =============================== */
/* Medium Laptop Screens (13-15 inch) */
/* =============================== */
@media (min-width: 1367px) and (max-width: 1600px) {
    /* Slightly smaller navbar for medium laptops */
    .navbar .navbar-nav .nav-link { 
        padding: 0.45rem 0.85rem !important; 
        font-size: 0.85rem !important; 
    }
    .navbar .navbar-nav .nav-link i { 
        font-size: 0.85rem !important; 
        margin-right: 0.45rem !important; 
    }
    .navbar .btn { 
        padding: 0.45rem 0.85rem !important; 
        font-size: 0.85rem !important; 
    }
    .navbar .d-flex { 
        gap: 0.6rem !important; 
    }
    .navbar-brand .logo-img {
        max-height: 40px !important;
    }
}

/* =============================== */
/* Mobile Bottom Navigation Styles */
/* =============================== */
@media (max-width: 768px) {
    .mobile-bottom-nav { position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; background: white !important; border-top: 1px solid #e9ecef !important; z-index: 1050 !important; padding: 8px 0 !important; box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important; }
    .mobile-bottom-nav .nav-item { flex: 1 !important; text-align: center !important; }
    .mobile-bottom-nav .nav-link { display: flex !important; flex-direction: column !important; align-items: center !important; padding: 8px 4px !important; color: #6c757d !important; text-decoration: none !important; font-size: 0.75rem !important; transition: color 0.3s ease !important; }
    .mobile-bottom-nav .nav-link.active { color: #015862 !important; }
    .mobile-bottom-nav .nav-link i { font-size: 1.125rem !important; margin-bottom: 4px !important; }
    body { padding-bottom: 80px !important; }
    .mobile-cta-sticky, .mobile-phone-float { display: none !important; }
}

/* =============================== */
/* Course Cards + Hero Responsives */
/* =============================== */

/* Base (from mobile-courses.css) */
.sec-course-card { transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border-radius: 1rem; overflow: hidden; will-change: transform; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); animation: courseCardFadeIn 0.5s ease-out; }
.sec-course-card img { object-fit: cover; object-position: center; transition: all 0.4s ease; }
.sec-course-card:hover img { transform: scale(1.05); }
.sec-roadmap { background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, transparent 100%); padding: 1rem 0.5rem 0.5rem 0.5rem; z-index: 2; }
.sec-roadmap small { text-shadow: 2px 2px 4px rgba(0,0,0,0.8); font-weight: 600; }
.sec-branding { z-index: 3; }
.sec-logo .badge { font-size: 0.7rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
.sec-text small { font-size: 0.6rem; line-height: 1.1; }
.sec-gift-icons { z-index: 3; }
.sec-gift-icons i { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); }
.sec-slogan { z-index: 2; }
.sec-course-name { z-index: 2; }
@keyframes courseCardFadeIn { from { opacity: 0; transform: translateY(20px);} to { opacity: 1; transform: translateY(0);} }

/* Hero base */
.hero-slide { transition: all 0.3s ease; position: inherit; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; animation: heroSlideFadeIn 0.6s ease-out; }
.hero-slide-image { transition: all 0.3s ease; object-fit: cover; object-position: center; will-change: transform; backface-visibility: hidden; -webkit-backface-visibility: hidden; }

.hero-desc { transition: all 0.3s ease; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); }
@keyframes heroSlideFadeIn { from { opacity: 0; transform: scale(1.05);} to { opacity: 1; transform: scale(1);} }

/* =============================== */
/* Hero Slider Responsive - Sắp xếp từ nhỏ đến lớn */
/* =============================== */

/* Mobile <= 360px - Tiny Mobile (Ưu tiên cao nhất) */
@media (max-width: 360px) {
    .courses-slider-container .col-sm-6 { width: 50% !important; padding: 0 0.1rem !important; }
    .courses-slider-container .sec-course-card { height: 160px; margin-bottom: 0.25rem !important; }
    .courses-slider-container .sec-course-name h5 { font-size: 0.65rem !important; }
    .courses-slider-container .sec-course-name h6 { font-size: 0.5rem !important; }
    .courses-slider-container .sec-text small { font-size: 0.35rem !important; }

    /* Hero Slider - Tiny Mobile */
    .hero-slide { min-height: 30vh !important; }
    .hero-slider-section { min-height: 30vh !important; }
    
    /* Remove background overlay on mobile */
    .hero-overlay {
        display: none !important;
    }
    
    /* Carousel indicators for tiny mobile */
    .carousel-indicators {
        bottom: 0.75rem;
    }
    .carousel-indicators button {
        width: 6px;
        height: 6px;
        margin: 0 2px;
    }
    .carousel-indicators button.active {
        transform: scale(1.2);
        background-color: #fff;
        box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
    }
    
    /* Hide carousel controls on tiny mobile */
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    /* Carousel controls scale for tiny mobile (if shown) */
    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        transform: translateY(-50%) scale(1.02);
    }
    .carousel-control-prev:hover .carousel-control-prev-icon,
    .carousel-control-next:hover .carousel-control-next-icon {
        transform: scale(1.02);
    }
}

/* Mobile <= 480px - Extra Small Mobile */
@media (max-width: 480px) {
    .courses-slider-container .col-sm-6 { width: 50% !important; padding: 0 0.15rem !important; }
    .courses-slider-container .sec-course-card { height: 180px ; margin-bottom: 0.3rem !important; }
    .courses-slider-container .sec-course-name h5 { font-size: 0.7rem !important; }
    .courses-slider-container .sec-course-name h6 { font-size: 0.55rem !important; }
    .courses-slider-container .sec-text small { font-size: 0.4rem !important; }

    /* Hero Slider - Extra Small Mobile */
    .hero-slide { height: 210px;}
    .hero-slider-section { height: 210px; }
    
    /* Remove background overlay on mobile */
    .hero-overlay {
        display: none !important;
    }
    
    /* Carousel indicators for extra small mobile */
    .carousel-indicators {
        bottom: 0.875rem;
    }
    .carousel-indicators button {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
    .carousel-indicators button.active {
        transform: scale(1.18);
        background-color: #fff;
        box-shadow: 0 0 7px rgba(255, 255, 255, 0.65);
    }
    
    /* Hide carousel controls on extra small mobile */
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    /* Carousel controls scale for extra small mobile (if shown) */
    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        transform: translateY(-50%) scale(1.03);
    }
    .carousel-control-prev:hover .carousel-control-prev-icon,
    .carousel-control-next:hover .carousel-control-next-icon {
        transform: scale(1.03);
    }
}

/* Mobile <= 576px - Small Mobile */
@media (max-width: 576px) {
    .courses-slider-container .col-sm-6 { width: 50% !important; padding: 0 0.2rem !important; }
    .courses-slider-container .sec-course-card { height: 200px ; margin-bottom: 0.4rem !important; }
    .courses-slider-container .sec-course-name h5 { font-size: 0.8rem !important; }
    .courses-slider-container .sec-slogan h6 { font-size: 0.6rem !important; }
    .courses-slider-container .sec-text small { font-size: 0.45rem !important; }

    /* Hero Slider - Small Mobile */
    .hero-slide { height: 100%; }
    .hero-slider-section {height: 210px; }
    
    /* Remove background overlay on mobile */
    .hero-overlay {
        display: none !important;
    }
    
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Carousel indicators for small mobile */
    .carousel-indicators {
        bottom: 1rem;
    }
    .carousel-indicators button {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
    .carousel-indicators button.active {
        transform: scale(1.15);
        background-color: #fff;
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    }
    
    /* Hide carousel controls on small mobile */
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    /* Carousel controls scale for small mobile (if shown) */
    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        transform: translateY(-50%) scale(1.04);
    }
    .carousel-control-prev:hover .carousel-control-prev-icon,
    .carousel-control-next:hover .carousel-control-next-icon {
        transform: scale(1.04);
    }
}

/* Mobile <= 768px - Mobile */
@media (max-width: 767.98px) {
    .courses-slider-container .col-sm-6 { flex: 0 0 auto; width: 50% !important; padding: 0 0.25rem !important; }
    .courses-slider-container .sec-course-card { margin-bottom: 0.5rem !important; }

    /* Hero Slider - Mobile */
    .hero-slide { min-height: 45vh !important; }
    .hero-slider-section { height: 210px; }
    
    /* Remove background overlay on mobile */
    .hero-overlay {
        display: none !important;
    }
    
    /* Hide carousel controls on mobile */
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    /* Carousel controls scale for mobile (if shown) */
    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        transform: translateY(-50%) scale(1.05);
    }
    .carousel-control-prev:hover .carousel-control-prev-icon,
    .carousel-control-next:hover .carousel-control-next-icon {
        transform: scale(1.05);
    }
    
    /* Adjust indicators for mobile */
    .carousel-indicators {
        bottom: 1rem;
    }
    
    .carousel-indicators button {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
    .carousel-indicators button.active {
        transform: scale(1.12);
        background-color: #fff;
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    }
}

/* Tablet <= 992px - Tablet */
@media (max-width: 991.98px) and (min-width: 768px) {
    .courses-slider-container .sec-course-card { height: 280px ; }
    .courses-slider-container .sec-course-name h5 { font-size: 1rem !important; }
    .courses-slider-container .sec-slogan h6 { font-size: 0.7rem !important; }

    /* Hero Slider - Tablet */
    .hero-slide { min-height: 50vh !important; }
    .hero-slider-section { height: 210px; }
    
    /* Remove background overlay on mobile */
    .hero-overlay {
        display: none !important;
    }
    
    /* Carousel Controls - Tablet */
    .carousel-control-prev,
    .carousel-control-next {
        margin: 0 1rem;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 28px;
        height: 28px;
        padding: 6px;
    }
    
    /* Carousel controls scale for tablet */
    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        transform: translateY(-50%) scale(1.05);
    }
    .carousel-control-prev:hover .carousel-control-prev-icon,
    .carousel-control-next:hover .carousel-control-next-icon {
        transform: scale(1.05);
    }
    
    /* Carousel indicators for tablet */
    .carousel-indicators {
        bottom: 1.5rem;
    }
    
    .carousel-indicators button {
        width: 12px;
        height: 12px;
        margin: 0 5px;
    }
    .carousel-indicators button.active {
        transform: scale(1.1);
        background-color: #fff;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
}

/* Mobile <= 768px - Mobile (Ưu tiên cao hơn tablet) */
@media (max-width: 767.98px) {
    .courses-slider-container .sec-course-card { height: 190px }
    .courses-slider-container .sec-course-name h5 { font-size: 0.9rem !important; }
    .courses-slider-container .sec-slogan h6 { font-size: 0.65rem !important; }
    .courses-slider-container .sec-text small { font-size: 0.5rem !important; }
    .courses-slider-container .carousel-control-prev,
    .courses-slider-container .carousel-control-next { display: none !important; }
}

/* =============================== */
/* Landscape Orientation - Ưu tiên cao hơn mobile thường */
/* =============================== */

/* Landscape <= 767.98px - Mobile Landscape */
@media (max-width: 767.98px) and (orientation: landscape) {
    .courses-slider-container .sec-course-card { height: 140px; }
    .courses-slider-container .sec-course-name h5 { font-size: 0.6rem !important; }

    /* Hero Slider - Mobile Landscape */
    .hero-slide { min-height: 25vh !important; }
    .hero-slider-section { min-height: 25vh !important; }
    
    /* Remove background overlay on mobile */
    .hero-overlay {
        display: none !important;
    }
    
    /* Carousel indicators for landscape */
    .carousel-indicators {
        bottom: 0.75rem;
    }
    .carousel-indicators button {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
    .carousel-indicators button.active {
        transform: scale(1.15);
        background-color: #fff;
        box-shadow: 0 0 7px rgba(255, 255, 255, 0.65);
    }
    
    /* Hide carousel controls on landscape */
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    /* Carousel controls scale for landscape (if shown) */
    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        transform: translateY(-50%) scale(1.03);
    }
    .carousel-control-prev:hover .carousel-control-prev-icon,
    .carousel-control-next:hover .carousel-control-next-icon {
        transform: scale(1.03);
    }
}

/* Desktop - Show overlay */
@media (min-width: 992px) {
    /* Full height for desktop */
    .hero-slide { min-height: 100vh !important; }
    .hero-slider-section { min-height: 100vh !important; }
    
    /* Show background overlay on desktop */
    .hero-overlay {
        display: block !important;
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .sec-course-card:hover { transform: none !important; }
    .sec-course-card:active { transform: scale(0.98) !important; }
    .hero-slide-image { will-change: transform; }
    
    /* Improve touch targets */
    /* .carousel-indicators button {
        /* min-width: 44px;
        min-height: 44px; */
    } */
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-slide-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .hero-slide-image,
    .carousel-control-prev,
    .carousel-control-next {
        transition: none !important;
        animation: none !important;
    }
    
    .animate-fade-in-up {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}


