/* ==============================================================================
   RVIT – Ultimate Optimized Header CSS (v5.0 - Final Production)
   Independent Scoped Styles, Mobile Optimized, High Performance
   ============================================================================== */

/* Scope everything under #rvit-header-wrapper to prevent global bleed */
/* ==================== LAYOUT & PERFORMANCE FIXES ==================== */
/* 1. Lift Header Above All Page Content */
#rvit-header-wrapper {
    position: relative;
    z-index: 999999 !important;
    /* Highest priority */

    /* Color Variables Restored & Scoped */
    --rvit-navy: #0a192f;
    --rvit-navy-deep: #020c1b;
    --rvit-navy-light: #0f2440;
    --rvit-gold: #fbbf24;
    --rvit-gold-dark: #d97706;
    --rvit-font-head: 'Montserrat', sans-serif;
    --rvit-font-body: 'Plus Jakarta Sans', sans-serif;
    --rvit-trans: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: var(--rvit-font-body);
    box-sizing: border-box;
    line-height: normal;
}

/* 2. Ensure Overflow is never hidden for containers holding dropdowns */
.rvit-main-header,
.rvit-bg-nav,
.navbar {
    overflow: visible !important;
}

/* 3. Performance & Smoothness */
html {
    scroll-behavior: smooth !important;
    scroll-padding-top: 80px;
}

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* GPU Acceleration */
.rvit-bg-nav,
.rvit-main-header {
    /* transform: translateZ(0); Removed to prevent breaking fixed positioning context */
    backface-visibility: hidden;
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
/* Smooth scrolling for entire site */
html {
    scroll-behavior: smooth !important;
    scroll-padding-top: 80px;
    /* Account for fixed header */
}

/* Optimize rendering performance */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* GPU Acceleration for smooth animations */
.rvit-bg-nav,
.rvit-main-header,
.rvit-comp-sidebar,
.rvit-back-to-top {
    will-change: transform;
    transform: translateZ(0);
    /* Safe for these elements individualy */
    backface-visibility: hidden;
}

/* ==================== GLOBAL SCROLLBAR STYLING ==================== */
/* Custom Gold Scrollbar - Applied to body and html for maximum compatibility */

/* Webkit Browsers (Chrome, Safari, Edge) */
body::-webkit-scrollbar,
html::-webkit-scrollbar {
    width: 12px !important;
    height: 12px !important;
}

body::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
    background: #f8f9fa !important;
    border-radius: 10px !important;
}

body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%) !important;
    border-radius: 10px !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3) !important;
}

body::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.5) !important;
}

/* Firefox Scrollbar Support */
html,
body {
    scrollbar-width: thin !important;
    scrollbar-color: #fbbf24 #f8f9fa !important;
}

/* Reset for internal elements */
#rvit-header-wrapper *,
#rvit-header-wrapper *::before,
#rvit-header-wrapper *::after {
    box-sizing: border-box;
}

#rvit-header-wrapper a {
    text-decoration: none;
    color: inherit;
}

/* ==================== 1. TOP BAR ==================== */
.rvit-top-bar {
    background-color: var(--rvit-navy-deep);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rvit-top-bar a {
    transition: var(--rvit-trans);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rvit-top-bar a:hover {
    color: var(--rvit-gold);
}

.rvit-top-bar i {
    color: var(--rvit-gold);
    font-size: 0.75rem;
}

.rvit-text-gold {
    color: var(--rvit-gold) !important;
}

/* ==================== 2. MAIN HEADER ==================== */
.rvit-main-header {
    background: #fff;
    padding: 8px 0;
    position: relative;
    z-index: 1040;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* Brand */
.rvit-brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rvit-logo-img {
    height: 55px;
    width: auto;
    transition: transform 0.3s;
}

#rvit-header-wrapper .rvit-brand-wrap:hover .rvit-logo-img {
    transform: scale(1.05);
}

.rvit-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.rvit-brand-title {
    font-family: var(--rvit-font-head);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--rvit-navy);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.rvit-brand-sub {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Extras */
.rvit-header-extras {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rvit-badge-pill {
    font-family: var(--rvit-font-head);
    font-weight: 700;
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}

.rvit-badge-ugc {
    background: rgba(251, 191, 36, 0.15);
    color: var(--rvit-gold-dark);
    border: 1px solid var(--rvit-gold);
}

.rvit-badge-naac {
    background: var(--rvit-navy);
    color: #fff;
}

.rvit-btn-apply {
    background: var(--rvit-gold);
    color: var(--rvit-navy);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 8px 18px;
    border-radius: 30px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    transition: var(--rvit-trans);
}

.rvit-btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(251, 191, 36, 0.5);
    color: var(--rvit-navy);
}

/* ==================== 3. NAVIGATION ==================== */
/* ==================== 3. NAVIGATION ==================== */
.rvit-bg-nav {
    background: var(--rvit-navy);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    width: 100%;
    z-index: 1050;
}

/* Fixed State Class (Added via JS) */
.rvit-bg-nav.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    animation: rvitSlideDown 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-top: none;
}

@keyframes rvitSlideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Scope Navbar Styles specifically */
#rvit-header-wrapper .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-family: var(--rvit-font-head);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 12px 10px !important;
    transition: var(--rvit-trans);
}

#rvit-header-wrapper .navbar-nav .nav-link:hover,
#rvit-header-wrapper .navbar-nav .nav-link.active {
    color: var(--rvit-gold) !important;
}

/* Dropdown Menus (Desktop Default) - Aggressive Reset */
#rvit-header-wrapper .dropdown-menu {
    border: none;
    border-top: 2px solid var(--rvit-gold) !important;
    border-radius: 0 0 6px 6px !important;
    padding: 5px 0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    font-size: 0.85rem !important;
    min-width: 220px !important;
    margin-top: 0 !important;
    background: #ffffff !important;
    text-align: left !important;
    list-style: none !important;
    left: 0;

    /* FIX: Force Visibility */
    z-index: 99999 !important;
    display: none;
    /* By default hidden, shown on hover/click */
}

/* Ensure no global list styles interfere */
#rvit-header-wrapper ul,
#rvit-header-wrapper li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

#rvit-header-wrapper .dropdown-item {
    padding: 8px 18px !important;
    color: #334155 !important;
    font-weight: 500 !important;
    transition: var(--rvit-trans);
    white-space: normal !important;
    background: transparent;
    border: none;
    display: block !important;
    width: 100% !important;
    clear: both;
}

#rvit-header-wrapper .dropdown-item:hover,
#rvit-header-wrapper .dropdown-item:focus {
    background: #f8fafc !important;
    color: var(--rvit-gold-dark) !important;
    padding-left: 22px !important;
}

/* Desktop Only Rules */
@media (min-width: 992px) {
    #rvit-header-wrapper .dropdown:hover .dropdown-menu {
        display: block !important;
        animation: rvitFadeUp 0.3s ease;
        z-index: 99999 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #rvit-header-wrapper .dropdown-item {
        /* Force one line per item */
        white-space: nowrap !important;
    }

    #rvit-header-wrapper .dropdown-menu {
        width: auto !important;
        /* Let it expand to fit text */
        min-width: 250px;
        max-width: none !important;
        /* Remove width cap */
    }
}

@keyframes rvitFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 4. MARQUEE ==================== */
.rvit-announcement-bar {
    background: #111827;
    height: 38px;
    overflow: hidden;
    border-bottom: 2px solid var(--rvit-gold-dark);
    display: flex;
    align-items: center;
}

.rvit-marquee-wrapper {
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    /* Prevent vertical stretch */
    height: 100%;
    /* Match parent height */
    mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}

.rvit-marquee-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: rvitLinearScroll 70s linear infinite;
    gap: 50px;
}

.rvit-marquee-content:hover {
    animation-play-state: paused;
}

.rvit-marquee-item {
    display: inline-flex;
    align-items: center;
    color: #cbd5e1;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.rvit-badge-new {
    background: var(--rvit-gold);
    color: #000;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.rvit-badge-scholar {
    background: #3b82f6;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.rvit-mq-link {
    color: var(--rvit-gold);
    text-decoration: underline !important;
    margin-left: 6px;
    font-weight: 600;
}

.rvit-mq-link:hover {
    color: #fff;
}

@keyframes rvitLinearScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==================== 5. SIDEBAR ==================== */
.rvit-comp-sidebar {
    position: fixed;
    right: -60px;
    /* Start Hidden */
    top: auto;
    bottom: 35%;
    /* Fixed at bottom right area */
    transform: none;
    /* No vertical transform needed with bottom % */
    z-index: 2147483647 !important;
    display: flex;
    flex-direction: column;
    transition: right 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.rvit-comp-sidebar.visible {
    right: 0;
    /* Slide In */
}

.rvit-sb-icon {
    width: 42px;
    /* Increased from 38px for better visibility */
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 1.1rem;
    border-radius: 4px 0 0 4px;
    margin-bottom: 2px;
    transition: var(--rvit-trans);
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.1);
}

.rvit-sb-icon:hover {
    width: 50px;
    padding-right: 5px;
}

.rvit-sb-wa {
    background: #25D366;
}

.rvit-sb-yt {
    background: #FF0000;
}

.rvit-sb-in {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.rvit-sb-li {
    background: #0077b5;
}

.rvit-sb-ap {
    background: var(--rvit-navy);
    writing-mode: vertical-lr;
    height: auto;
    padding: 15px 5px;
    font-size: 0.75rem;
    font-weight: 700;
    width: 42px;
    /* Match new icon width */
    border-radius: 4px 0 0 4px;
    margin-top: 10px;
    letter-spacing: 1px;
}

.rvit-sb-ap:hover {
    width: 50px;
    background: var(--rvit-gold);
    color: #000 !important;
}

/* Back to Top */
.rvit-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--rvit-gold);
    color: var(--rvit-navy);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--rvit-trans);
    z-index: 1020;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.rvit-back-to-top.active {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
}

.rvit-back-to-top:hover {
    transform: translateY(-5px);
    background: var(--rvit-navy);
    color: var(--rvit-gold);
}

/* ==================== 6. MOBILE RESPONSIVE ==================== */
@media (max-width: 1200px) {
    #rvit-header-wrapper .navbar-nav .nav-link {
        padding: 12px 6px !important;
        font-size: 0.7rem;
    }
}

@media (max-width: 991px) {

    /* Reset Desktop Nav Background but KEEP fixed structure if needed */
    .rvit-bg-nav {
        background: transparent;
        padding: 0;
        border: none;
        height: auto;
        box-shadow: none;
    }

    /* When fixed on mobile, give it a background so it's readable */
    .rvit-bg-nav.fixed-header {
        background: var(--rvit-navy) !important;
        padding-top: 5px;
        /* Slight padding for looks */
    }

    /* Mobile Menu Container */
    #rvit-header-wrapper .navbar-collapse {
        background: var(--rvit-navy);
        /* Dark Navy */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 9999;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        padding: 0;
        margin-top: 4px;
        border-top: 3px solid var(--rvit-gold);
        max-height: 85vh;
        overflow-y: auto;
    }

    /* Mobile Nav Links */
    #rvit-header-wrapper .navbar-nav .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        padding: 10px 15px !important;
        /* Compact */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 0.85rem;
        /* Compact */
        font-weight: 600;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Clear Dropdown Toggle Artifacts */
    #rvit-header-wrapper .navbar-nav .dropdown-toggle::after {
        margin-left: auto;
    }

    /* Mobile Active State - Only Highlight if Explicitly Active or Expanded */
    #rvit-header-wrapper .navbar-nav .nav-link.active,
    #rvit-header-wrapper .navbar-nav .nav-link[aria-expanded="true"] {
        background: rgba(255, 255, 255, 0.05);
        color: var(--rvit-gold) !important;
        padding-left: 25px !important;
    }

    /* Mobile Dropdown Styling */
    #rvit-header-wrapper .dropdown-menu.show {
        display: block;
    }

    #rvit-header-wrapper .dropdown-menu {
        display: none;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--rvit-gold);
        margin: 0;
        padding: 0;
        background: #f8fbff;
        /* Light BG for contrast */
        width: 100%;
    }

    #rvit-header-wrapper .dropdown-item {
        padding: 8px 15px 8px 25px;
        /* Compact */
        font-size: 0.8rem;
        border-bottom: 1px solid #e2e8f0;
        color: #334155;
        /* Dark text */
        line-height: 1.4;
    }

    #rvit-header-wrapper .dropdown-item:last-child {
        border-bottom: none;
    }

    #rvit-header-wrapper .dropdown-item:hover {
        background: #f1f5f9;
        color: var(--rvit-gold-dark);
        padding-left: 30px;
    }

    /* Mobile Header Layout */
    .rvit-main-header {
        padding: 5px 0;
    }

    .rvit-logo-img {
        height: 45px;
    }

    .rvit-brand-title {
        font-size: 1.1rem;
    }

    .rvit-brand-sub {
        font-size: 0.65rem;
    }

    .rvit-navbar-toggler {
        border: 2px solid var(--rvit-navy);
        padding: 8px 12px;
        color: var(--rvit-navy);
        font-size: 1.2rem;
        border-radius: 6px;
    }

    .rvit-marquee-content {
        animation-duration: 90s;
        /* Slow down */
    }

    .rvit-social-mob:hover {
        color: var(--rvit-gold) !important;
    }
}

@media (max-width: 576px) {

    /* Hide Top Bar on Small Mobile */
    .rvit-top-bar {
        display: none !important;
    }

    /* Force Title Layout */
    .rvit-brand-title {
        font-size: 1.0rem;
        letter-spacing: -0.5px;
        line-height: 1.1;
    }

    .rvit-brand-sub {
        font-size: 0.65rem;
    }

    .rvit-logo-img {
        height: 35px;
    }

    .rvit-brand-wrap {
        gap: 6px;
    }

    .rvit-navbar-toggler {
        padding: 4px 8px;
        font-size: 1rem;
    }
}