/* 
    Project: ROYAL EDUCATIONAL CONSULTANCY
    Description: Advanced Responsive Styles
*/

/* --- Tablets and Small Laptops --- */
@media (max-width: 1200px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    .hero-section {
        height: auto;
        padding: 100px 0;
    }
    .hero-content h1 {
        font-size: 2.8rem;
    }
}

/* --- Mobile View Overhaul (Congestion Fix) --- */
@media (max-width: 991px) {
    .navbar {
        padding: 10px 0;
    }
    
    .navbar-brand {
        font-size: 18px !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px;
    }

    .navbar-brand img {
        height: 40px !important;
        width: 40px !important;
        vertical-align: middle !important;
    }

    .brand-text {
        line-height: 1.1;
        display: flex;
        flex-direction: column;
    }

    .main-brand {
        font-size: 17px !important;
        font-weight: 800 !important;
    }

    .sub-brand {
        font-size: 9px !important;
        letter-spacing: 3px !important;
        font-weight: 700 !important;
        color: #555 !important;
        margin-top: 1px !important;
        opacity: 0.9;
    }

    .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 10000;
        padding: 40px 25px;
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1);
        border: none !important;
        margin-top: 0 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .navbar-collapse.show {
        transform: translateX(0);
    }

    .navbar-nav {
        width: 100%;
        margin-top: 30px;
        padding-bottom: 80px;
        flex-shrink: 0;
    }

    .nav-item {
        margin: 12px 0;
        width: 100%;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }

    .navbar-collapse.show .nav-item {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered animation for menu items */
    .navbar-collapse.show .nav-item:nth-child(1) { transition-delay: 0.1s; }
    .navbar-collapse.show .nav-item:nth-child(2) { transition-delay: 0.15s; }
    .navbar-collapse.show .nav-item:nth-child(3) { transition-delay: 0.2s; }
    .navbar-collapse.show .nav-item:nth-child(4) { transition-delay: 0.25s; }
    .navbar-collapse.show .nav-item:nth-child(5) { transition-delay: 0.3s; }
    .navbar-collapse.show .nav-item:nth-child(6) { transition-delay: 0.35s; }
    .navbar-collapse.show .nav-item:nth-child(7) { transition-delay: 0.4s; }

    .nav-link {
        margin: 0 !important;
        padding: 15px !important;
        font-size: 1.4rem !important;
        font-weight: 800 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
        color: var(--primary-color) !important;
    }

    .btn-apply.nav-link {
        background: var(--primary-color) !important;
        color: #fff !important;
        border-radius: 15px !important;
        margin-top: 25px !important;
        padding: 18px !important;
        border: none !important;
        box-shadow: 0 10px 20px rgba(93, 58, 38, 0.2);
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .section-padding {
        padding: 50px 0;
    }
}

/* --- Small Mobile Devices --- */
@media (max-width: 768px) {
    .top-bar { display: none !important; }

    /* Marquee Fix - Single Line Scrolling for Mobile */
    .marquee-container {
        padding: 8px 40px 8px 10px !important;
        font-size: 12px;
        height: auto;
        min-height: 40px;
        display: flex;
        align-items: center;
        background: linear-gradient(90deg, #5D3A26, #3D261A) !important;
        overflow: hidden !important;
        width: 100% !important;
    }
    
    .marquee-content {
        animation: marquee 20s linear infinite !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }

    .marquee-item {
        display: inline-block !important;
        margin-right: 30px !important;
        margin-bottom: 0 !important;
    }

    .marquee-close {
        position: absolute;
        right: 5px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        background: rgba(0,0,0,0.2) !important;
        width: 25px !important;
        height: 25px !important;
        font-size: 14px !important;
        border-radius: 50%;
    }

    .hero-section { padding: 40px 0; text-align: center; }
    .hero-content h2 { font-size: 1.1rem !important; }
    .hero-content h1 { font-size: 1.6rem !important; line-height: 1.2; margin-bottom: 20px !important; min-height: auto !important; }
    .typewriter-text { font-size: 1.5rem !important; }
    
    /* Promise Banner Fix */
    .promise-banner {
        width: 92%;
        margin: -30px auto 30px;
        padding: 15px;
        border-radius: 12px;
    }
    .promise-banner h4 { font-size: 0.9rem !important; line-height: 1.4; }
    .promise-banner h4 span { display: block; margin-top: 4px; font-weight: 800; }
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 32px !important;
        width: 32px !important;
    }
    .brand-text { 
        padding-top: 2px;
    }
    
    .main-brand {
        font-size: 14px !important;
        letter-spacing: -0.2px;
    }

    .sub-brand {
        font-size: 7.5px !important;
        letter-spacing: 2.5px !important;
        margin-top: 0px !important;
    }

    .brand-text span { 
        font-size: 14px !important;
        margin-left: 1px;
    }
    
    /* Ensure rows don't cause overflow */
    .row {
        margin-right: 0 !important;
        margin-left: 0 !important;
        overflow: hidden;
    }
    
    .container, .container-fluid {
        padding-right: 15px !important;
        padding-left: 15px !important;
        overflow: hidden;
    }

    .hero-content h1 { font-size: 1.4rem !important; }

    /* Modern Horizontal Scroll for Rows */
    .mobile-scroll-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding: 10px 5px 30px !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    
    .mobile-scroll-row::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .mobile-scroll-row > [class*="col-"] {
        flex: 0 0 85% !important;
        max-width: 85% !important;
        scroll-snap-align: center;
        margin-right: 15px;
    }

    .course-card {
        height: 100% !important;
        margin-bottom: 0 !important;
    }
}

/* Mobile Bottom Action Bar - Premium Fix */
@media (max-width: 767.98px) {
    body { padding-bottom: 75px !important; }
    
    .mobile-bottom-bar {
        position: fixed;
        bottom: 20px;
        left: 5%;
        width: 90%;
        height: 70px;
        display: flex !important;
        background: rgba(255, 255, 255, 0.8) !important;
        backdrop-filter: blur(15px) saturate(180%);
        -webkit-backdrop-filter: blur(15px) saturate(180%);
        z-index: 9999;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        overflow: hidden;
    }

    .mobile-bottom-bar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        padding: 8px 2px;
        transition: all 0.3s ease;
    }

    .mobile-bottom-bar a i { font-size: 1.3rem; margin-bottom: 4px; }
    .mobile-bottom-bar a span { font-size: 10px !important; font-weight: 700; text-transform: uppercase; }

    /* Premium Glow Effects */
    .mobile-bottom-bar a:nth-child(1) { 
        background: #5D3A26; color: #fff; 
        border-right: 1px solid rgba(255,255,255,0.1); 
        box-shadow: 0 0 15px rgba(93, 58, 38, 0.4);
    }
    
    .mobile-bottom-bar a:nth-child(2) { 
        background: #25d366; color: #fff; 
        border-right: 1px solid rgba(255,255,255,0.1); 
        box-shadow: 0 0 15px rgba(37, 211, 102, 0.4);
        animation: pulse-green 2s infinite;
    }

    .mobile-bottom-bar a:nth-child(3) { 
        background: #fff; color: #5D3A26; 
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.8); 
        position: relative; z-index: 1; 
    }

    @keyframes pulse-green {
        0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
        70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
        100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
    }

    .mobile-bottom-bar a:active { transform: scale(0.95); opacity: 0.9; }

    /* Hide desktop floaters */
    .whatsapp-float, .call-float { display: none !important; }

    /* About Page Specific Fixes */
    .display-5 {
        font-size: 1.8rem !important;
    }
    
    .founder-box {
        text-align: center;
    }

    .founder-story-ring {
        width: 200px !important;
        height: 200px !important;
        margin-bottom: 20px;
    }

    .founder-quote-bg {
        font-size: 150px !important;
        top: -10px !important;
        right: 10px !important;
        opacity: 0.03 !important;
    }

    .about-advanced-img {
        margin-bottom: 20px;
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .mvv-container:hover .mvv-card {
        filter: none !important;
        transform: none !important;
    }

    .mvv-card {
        padding: 30px 20px !important;
        text-align: center;
    }

    .timeline {
        padding-left: 40px !important;
    }

    .timeline-item {
        padding: 15px !important;
    }

    .timeline-year {
        font-size: 0.95rem !important;
    }

    /* Courses Page Specific Fixes */
    .row.g-5 {
        --bs-gutter-y: 2rem !important;
    }

    .course-card-header {
        padding: 30px 20px !important;
    }

    .course-card-header h3 {
        font-size: 1.3rem !important;
    }

    .course-card-body {
        padding: 25px 20px !important;
    }

    .course-list li {
        padding: 10px 12px !important;
        font-size: 0.95rem;
    }

    .founder-assurance-card {
        padding: 30px 20px !important;
        border-radius: 20px !important;
        text-align: center;
    }

    .founder-assurance-card .ps-lg-5 {
        padding-left: 0 !important;
    }

    .founder-assurance-card .mt-4 {
        margin-top: 25px !important;
    }

    .founder-assurance-card .btn {
        width: 100%;
        margin-bottom: 15px;
        margin-right: 0 !important;
        font-size: 0.95rem !important;
        padding: 12px 20px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .founder-assurance-card .btn i {
        margin: 0 !important;
        font-size: 1.2rem;
    }

    .course-footer-info {
        padding: 12px 15px !important;
        font-size: 0.9rem;
    }

    /* Study Abroad Page Specific Fixes */
    .page-hero .btn {
        width: 100%;
        padding: 12px 20px !important;
        font-size: 1rem !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .flag-card {
        padding: 20px 10px !important;
    }

    .flag-card img {
        width: 60px !important;
    }

    .flag-card h5 {
        font-size: 1rem !important;
    }

    .step-icon {
        font-size: 2.5rem !important;
        margin-bottom: 10px !important;
    }

    .abroad-list li {
        display: flex !important;
        align-items: flex-start !important;
        margin-bottom: 20px !important;
        line-height: 1.4 !important;
    }

    .abroad-list li i {
        margin-top: 4px;
        font-size: 1rem !important;
        min-width: 20px;
        margin-right: 15px !important;
        flex-shrink: 0;
    }

    .abroad-list li div {
        flex-grow: 1;
    }

    .abroad-list li strong {
        display: block;
        margin-bottom: 2px;
        color: var(--primary-color);
        font-size: 1.05rem;
    }

    /* Contact Page Specific Fixes */
    .contact-form-premium {
        padding: 30px 20px !important;
        border-radius: 20px !important;
    }

    .contact-form-premium .text-center.mb-5 {
        margin-bottom: 30px !important;
    }

    .contact-form-premium h3 {
        font-size: 1.5rem !important;
    }

    .floating-input, .floating-select, .floating-textarea {
        padding: 14px 15px !important;
        font-size: 15px !important;
    }

    .floating-label {
        top: 14px !important;
        left: 15px !important;
        font-size: 14px !important;
    }

    .btn-premium {
        padding: 15px 30px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
    }

    .contact-card-v2 {
        padding: 20px !important;
    }

    .map-container {
        height: 350px !important;
        border-radius: 20px !important;
    }

    .guarantee-tag {
        padding: 6px 15px !important;
        font-size: 12px !important;
    }

    .quick-contact-grid {
        grid-template-columns: 1fr !important;
    }

    .floating-input:focus ~ .floating-label,
    .floating-input:not(:placeholder-shown) ~ .floating-label,
    .floating-textarea:focus ~ .floating-label,
    .floating-textarea:not(:placeholder-shown) ~ .floating-label {
        top: -10px !important;
        font-size: 11px !important;
    }

    .social-circle {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
}
