/* =============================================
   VIDYANEX – Comprehensive Responsive Fixes
   Covers: Mobile (≤480), Mobile-L (≤576), 
           Tablet (≤768), Laptop (≤992), 
           Desktop (≤1200)
   ============================================= */

/* --------------------------------
   1. GLOBAL FIXES
-------------------------------- */

/* Prevent horizontal scroll on all viewports */
html, body {
    overflow-x: clip !important; /* Most modern way to strictly prevent horizontal overflow */
    width: 100% !important;
    position: relative;
    max-width: 100vw;
}

/* Ensure no child can cause horizontal overflow */
body > * {
    max-width: 100vw;
}

/* --------------------------------
   2. NAVBAR + BANNER FIXES (ALL SIZES)
-------------------------------- */

/* Navbar is position: fixed (defined in styles.css). 
   Keep it ABOVE nav-links overlay. */
.navbar {
    z-index: 10003 !important;
}

/* Banner fixes removed */

/* ALL pages need top padding since navbar is fixed (81px tall) */
body {
    padding-top: 81px !important;
    margin-top: 0 !important;
}

/* Ensure navbar is tied to the top */
.navbar {
    top: 0 !important;
}

/* Ensure no residual banner spacing remains */
body.has-ugadi-banner {
    padding-top: 81px !important;
}

.hero-section, 
.hero_section,
.courses-hero,
.internship-hero,
.roadmap-hero {
    padding-top: 20px !important; /* Tighten the gap for all main hero sections */
}

/* --------------------------------
   3. HAMBURGER MENU (≤968px)
-------------------------------- */

@media (max-width: 968px) {

    /* Hamburger button - topmost */
    .hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 32px;
        height: 28px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 40000 !important; /* Topmost - even above navbar */
        padding: 0;
        flex-shrink: 0;
        position: relative;
    }

    .hamburger span {
        width: 100%;
        height: 3px;
        background-color: #7b2cbf !important; /* Force purple visibility */
        border-radius: 4px;
        transition: all 0.3s ease;
        transform-origin: 1px;
        pointer-events: none;
        display: block !important;
    }

    /* Hamburger active (X) animation */
    .hamburger.active span:nth-child(1) { transform: rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; transform: translateX(20px); }
    .hamburger.active span:nth-child(3) { transform: rotate(-45deg); }

    /* Nav right spacing */
    .nav-right {
        gap: 12px;
    }

    /* RE-MAPPING TO MATCH REFERENCE IMAGE (CENTERED CONTENT) */
    .nav-links {
        position: fixed;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        padding-top: 140px !important; /* more room for Top header */
        background-color: #1a1a1a !important; /* Deep dark as in image */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important; /* CENTERED */
        justify-content: flex-start !important;
        gap: 25px !important; 
        transform: translateY(-100%) !important;
        transition: transform 0.45s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
        z-index: 10002 !important;
        overflow-y: auto;
        margin: 0 !important;
    }

    body.nav-open .nav-links,
    .nav-links.active {
        transform: translateY(0) !important;
    }

    .nav-links li {
        width: 100% !important;
        text-align: center !important; /* CENTERED li content */
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav-links a:not(.btn) {
        font-size: 1.5rem !important; /* Sized like image */
        display: inline-block !important;
        color: #ffffff !important; 
        font-weight: 700 !important;
        transition: all 0.3s ease !important;
        padding: 5px 20px !important;
        text-align: center !important;
    }

    /* REMOVED DROPDOWNS / CHEVRONS as requested */
    .nav-links li a::after {
        display: none !important; 
    }

    .nav-links a:not(.btn):hover {
        color: #9333ea !important;
    }

    body.dark-mode .nav-links a:hover,
    body.dark-mode .nav-links a:active {
        background: rgba(167, 139, 250, 0.15) !important;
        color: #a78bfa !important;
        -webkit-text-fill-color: #a78bfa !important;
    }

    /* REFERENCE GRADIENT BUTTON */
    .nav-links .btn.btn-primary {
        margin: 40px auto !important;
        width: 90% !important;
        max-width: 450px; /* Wider in image */
        display: block !important;
        text-align: center !important;
        background: linear-gradient(90deg, #ff6b00, #ff006b) !important; /* Orange-Pink gradient */
        color: #ffffff !important;
        padding: 18px 24px !important;
        border-radius: 12px !important; /* more square-pill than true pill */
        font-weight: 800 !important;
        font-size: 1.25rem !important;
        border: none !important;
        box-shadow: 0 10px 30px rgba(255, 0, 107, 0.4) !important;
        text-decoration: none !important;
    }

    /* PERSISTENT HEADER - Always visible above the menu overlay */
    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 10003 !important; /* Strictly ABOVE .nav-links */
        height: 81px !important;
        background-color: #ffffff !important; /* Default light */
        display: block !important;
        transition: background-color 0.3s ease, box-shadow 0.3s ease;
    }

    body.dark-mode .navbar {
        background-color: #111111 !important; /* Dark mode background */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .navbar-container {
        display: flex !important;
        justify-content: space-between !important; /* Logo left, actions right */
        align-items: center !important;
        height: 100% !important;
        padding: 0 20px !important;
        max-width: 100% !important;
    }

    .nav-right {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
    }

    .nav-actions {
        display: flex !important;
        align-items: center !important;
        gap: 20px !important; /* Space between lightbulb and hamburger */
    }

    body.nav-open .navbar {
        background-color: transparent !important; /* Make it invisible background but content stays */
        box-shadow: none !important;
        border-bottom: none !important;
    }

    /* Transform hamburger into a Large Purple X at the right */
    body.nav-open .hamburger span:nth-child(1) {
        transform: translateY(8px) rotate(45deg) !important;
        background-color: #9333ea !important; 
        width: 32px;
    }
    body.nav-open .hamburger span:nth-child(2) {
        opacity: 0 !important;
    }
    body.nav-open .hamburger span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg) !important;
        background-color: #9333ea !important;
        width: 32px;
    }

    /* Ensure theme toggle doesn't distract in open menu */
    body.nav-open .theme-toggle {
        opacity: 0.3;
        pointer-events: none;
    }

    /* FIXED: Hamburger button visibility in all modes */
    .hamburger {
        z-index: 10005 !important;
    }

    .hamburger span {
        background-color: #7b2cbf !important; /* Purple for light mode */
    }

    body.dark-mode .hamburger span {
        background-color: #ffffff !important; /* White for dark mode */
    }
}

/* --------------------------------
   4. UGADI BANNER – MOBILE FIXES
-------------------------------- */

/* Banner mobile fixes removed */

/* --------------------------------
   5. HERO SECTION RESPONSIVENESS
-------------------------------- */

/* Desktop: two-column grid */
@media (min-width: 969px) {
    .hero-section .container {
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
        align-items: center;
        gap: 40px;
    }
}

/* Laptop (≤1200px) */
@media (max-width: 1200px) {
    .hero-content h1 {
        font-size: 3rem;
    }
}

/* Tablet (≤992px) – stack hero */
@media (max-width: 992px) {
    .hero-section .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

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

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-search {
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-image-wrapper.ecosystem-wrapper {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem !important;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .hero-search {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .hero-search input,
    .hero-search button {
        width: 100%;
    }

    /* Ecosystem on mobile: strictly contain it */
    .hero-image-wrapper.ecosystem-wrapper {
        height: 380px !important;
        width: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.7rem !important;
    }

    .hero-image-wrapper.ecosystem-wrapper {
        height: 320px;
    }
}

/* --------------------------------
   6. NAVBAR LOGO – RESPONSIVE
-------------------------------- */

@media (max-width: 576px) {
    .logo img {
        height: 50px;
    }

    .navbar-container {
        padding: 6px 16px;
    }
}

/* --------------------------------
   7. STATS SECTION
-------------------------------- */

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .stat-card {
        padding: 20px 10px;
    }

    .stat-card h2 {
        font-size: 1.8rem;
    }

    .stat-card p {
        font-size: 0.9rem;
    }
}

/* --------------------------------
   8. COURSES GRID
-------------------------------- */

@media (max-width: 1200px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* --------------------------------
   9. MUST EXPLORE SECTION
-------------------------------- */

@media (max-width: 1200px) {
    .must-explore-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .must-explore-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .must-explore-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .must-explore-grid {
        grid-template-columns: 1fr;
        max-width: 340px;
        margin: 0 auto;
    }
}

/* --------------------------------
   10. WHY CHOOSE SECTION
-------------------------------- */

@media (max-width: 1100px) {
    .why-choose-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 576px) {
    .why-choose-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 40px auto 0;
    }
}

/* --------------------------------
   11. PLACEMENT MARQUEE
-------------------------------- */

@media (max-width: 768px) {
    .placement-track img {
        height: 280px;
    }

    .placement-marquee-wrapper::before,
    .placement-marquee-wrapper::after {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .placement-track img {
        height: 220px;
    }
}

/* --------------------------------
   12. TESTIMONIALS
-------------------------------- */

@media (max-width: 768px) {
    .testimonials-carousel-container {
        padding: 0 10px;
    }

    .testimonial-nav {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        font-size: 1rem;
        background: rgba(255,255,255,0.95);
        z-index: 20;
        border: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    .testimonial-nav.prev { left: 0; }
    .testimonial-nav.next { right: 0; }

    .testimonials-grid-new {
        padding-left: 44px;
        padding-right: 44px;
    }

    .outcome-card {
        min-width: 280px;
        max-width: 280px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .outcome-card {
        min-width: 260px;
        max-width: 260px;
    }
}

/* --------------------------------
   13. INDUSTRY / MENTOR SECTION
-------------------------------- */

@media (max-width: 768px) {
    .industry-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --------------------------------
   14. CTA CARD
-------------------------------- */

@media (max-width: 576px) {
    .cta-card {
        padding: 40px 20px;
    }

    .cta-card h2 {
        font-size: 1.6rem;
    }
}

/* --------------------------------
   15. FAQ SECTION
-------------------------------- */

@media (max-width: 576px) {
    .faq-question {
        font-size: 0.95rem;
        padding: 16px;
    }

    .faq-answer {
        padding: 0 16px;
    }
}

/* --------------------------------
   16. HIRING PARTNERS
-------------------------------- */

@media (max-width: 576px) {
    .hiring-partners-section .section-header-center h2 {
        font-size: 1.5rem;
    }
}

/* --------------------------------
   17. FOOTER RESPONSIVE
-------------------------------- */

@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 30px;
    }
}

@media (max-width: 576px) {
    .footer-content {
        display: flex !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 30px !important;
        padding: 0 10px !important;
    }

    .footer-section {
        width: 100%;
    }

    .footer-section ul {
        list-style: none;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-section p,
    .footer-section a {
        text-align: center !important;
        justify-content: center !important;
    }

    .footer-section p {
        max-width: 100% !important;
    }

    .social-icons {
        justify-content: center;
    }

    .footer-section a:hover {
        transform: translateY(-2px) !important;
    }

    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* --------------------------------
   18. HIRING PARTNERS & PLACEMENT MARQUEE MOBILE FIXES
   Forcing horizontal layout to prevent stacking/giant logos
-------------------------------- */

@media (max-width: 968px) {
    /* Hiring Partners */
    .hiring-partners-wrapper {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
    }

    .scrolling-logos {
        width: 100% !important;
        display: block !important;
        overflow: hidden !important;
        max-width: 100vw !important;
    }

    .scrolling-logos-track {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 30px !important; /* Smaller gap on mobile */
        width: max-content !important;
        animation: scroll-logos 20s linear infinite !important;
    }

    .scrolling-logos-track img {
        height: 30px !important; /* Smaller height for mobile */
        width: auto !important;
        flex-shrink: 0 !important;
        max-width: 120px !important; /* Prevent giant logos like Wipro */
        object-fit: contain !important;
    }

    /* Placement Marquee */
    .placement-marquee-section {
        padding: 40px 0 !important;
    }

    .placement-track {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 20px !important;
        width: max-content !important;
        animation: scroll-placement 40s linear infinite !important;
    }

    .placement-track img {
        height: 180px !important; /* Optimized height for mobile */
        width: auto !important;
        flex-shrink: 0 !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
    }

    /* Gradient Fades for Mobile */
    .placement-marquee-wrapper::before,
    .placement-marquee-wrapper::after {
        width: 40px !important;
    }
}

/* Redefining Keyframes to ensure they are available in this scope */
@keyframes scroll-logos {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 15px)); }
}

@keyframes scroll-placement {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 10px)); }
}

/* --------------------------------
   19. SECTION HEADERS MOBILE
-------------------------------- */

@media (max-width: 576px) {
    .section-title-icon {
        flex-direction: column;
        gap: 8px;
        font-size: 1.8rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.7rem;
    }

    h3 {
        font-size: 1.3rem;
    }
}

/* --------------------------------
   19. BUTTONS ON MOBILE
-------------------------------- */

@media (max-width: 480px) {
    .btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

/* --------------------------------
   20. DARK MODE NAV MOBILE
-------------------------------- */

@media (max-width: 968px) {
    body.dark-mode .hamburger span {
        background-color: #ffffff !important; /* White lines in dark mode for contrast */
    }

    body.dark-mode .testimonial-nav {
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
    }
}

/* --------------------------------
   21. CHATBOT - MOBILE FIX
-------------------------------- */

@media (max-width: 576px) {
    .chatbot-window {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 80px;
        width: auto;
        height: 60vh;
        max-height: 480px;
        z-index: 10000;
    }

    .chatbot-toggle {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .floating-buttons {
        bottom: 80px;
        right: 14px;
        gap: 10px;
    }
}

/* --------------------------------
   22. ECOSYSTEM ANIMATION – TABLET FIX
-------------------------------- */
@media (max-width: 768px) {
    .hero-image-wrapper.ecosystem-wrapper {
        overflow: hidden;
    }
}

/* --------------------------------
   23. HIDE FLOATING ELEMENTS WHEN MOBILE NAV IS OPEN
       Prevents floating buttons showing on top of nav overlay
-------------------------------- */
@media (max-width: 968px) {
    /* When hamburger is active (nav is open), hide all floaters */
    body:has(.hamburger.active) .floating-buttons,
    body:has(.hamburger.active) .genai-floating-btn,
    body:has(.hamburger.active) .chatbot-widget,
    body:has(.hamburger.active) .chatbot-toggle {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Fallback class-based approach (for browsers without :has() support) */
    .nav-open .floating-buttons,
    .nav-open .genai-floating-btn,
    .nav-open .chatbot-widget,
    .nav-open .chatbot-toggle {
        display: none !important;
        visibility: hidden !important;
    }
}
