/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    position: relative;
    z-index: 1000;
    background: white;
}

/* ---- 1. Top Branding Bar ---- */
.header-brand-bar {
    background: #1E2F7A;
    padding: 20px 0;
    border-bottom: 1px solid #eef2f7;
}

.header-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.header-logo-link {
    flex-shrink: 0;
}

.header-logo {
    width: auto;
    height: 140px;
    display: block;
}

.header-college-info {
    /* flex: 1; */
    min-width: 0;
    text-align: center;
}

.header-society {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #dc2626;
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.header-college-name {
    font-family: 'Manrope', sans-serif;
    font-size: 35px;
    letter-spacing: 4px;
    font-weight: 900;
    /* color: var(--primary-color); */
    color: #fff;
    line-height: 1.2;
    margin-bottom: 4px;
}

.header-affiliation {
    display: block;
    font-size: 16px;
    /* color: var(--text-light); */
    color: #e7e7e7;
    font-weight: 600;
}

.header-est {
    flex-shrink: 0;
    text-align: center;
    padding: 0 20px;
    border-left: 1px solid #eef2f7;
}

.header-est-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    /* color: var(--text-light); */
    color: #e7e7e7;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.header-est-year {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
    font-weight: 800;
    /* color: var(--primary-color); */
    color: #e7e7e7;
}

/* ---- 2. Navigation Bar ---- */
.header-nav-bar {
    background: white;
    border-bottom: 2px solid #eef2f7;
}

.nav-wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    min-height: 46px;
    padding: 0;
}

.nav {
    display: flex;
    width: 100%;
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.header-nav-bar .nav-link {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 16px;
    padding: 12px 18px;
    text-decoration: none;
    transition: all 0.3s;
    display: block;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.header-nav-bar .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Active nav link - highlighted based on current page */
.nav-item.active>.nav-link {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Mega Menu Styles */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 99999;
    transform: translateX(-50%);
    background: #1E2F7A;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    padding: 30px;
    min-width: fit-content;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.has-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
}

.mega-menu-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
}

.mega-menu-column h3 {
    font-size: 15px;
    font-weight: 700;
    /* color: var(--primary-color); */
    color: #fff;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f4ff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Manrope', sans-serif;
}

.mega-menu-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-column ul li {
    margin-bottom: 5px;
}

.mega-menu-column ul li a {
    text-decoration: none;
    /* color: var(--text-dark); */
    color: #fff;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 6px;
    display: block;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    position: relative;
}

.mega-menu-column ul li a:hover {
    background: #f4f7ff;
    color: var(--primary-color);
    padding-left: 18px;
}

.mega-menu-column ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
    transition: height 0.25s ease;
}

.mega-menu-column ul li a:hover::before {
    height: 60%;
}

/* Nested Submenu Styles */
.mega-menu-column ul li.has-submenu {
    position: relative;
}

.mega-menu-column ul li.has-submenu::after {
    content: '›';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 20px;
    pointer-events: none;
    transition: color 0.3s;
}

.mega-menu-column ul li.has-submenu:hover::after {
    color: var(--primary-color);
}

.submenu-list {
    position: absolute;
    left: 100%;
    top: 0;
    background: #6D5E7B;
    min-width: 220px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 10px 0;
    border-radius: 4px;
    z-index: 100;
}

.mega-menu-column ul li.has-submenu:hover .submenu-list {
    opacity: 1;
    visibility: visible;
    transform: translateX(5px);
}

.submenu-list li {
    margin-bottom: 0 !important;
}

.submenu-list li a {
    color: white !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    border-radius: 0 !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.submenu-list li:last-child a {
    border-bottom: none;
}

.submenu-list li a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    padding-left: 25px !important;
}

.submenu-list li a::before {
    display: none !important;
}

/* ---- 3. Latest Update Ticker ---- */
.header-ticker {
    background: #f5c518;
    overflow: hidden;
}

.header-ticker-inner {
    display: flex;
    align-items: center;
    gap: 0;
    height: 38px;
}

.ticker-badge {
    flex-shrink: 0;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 3px;
    margin-right: 20px;
}

.ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.ticker-content {
    display: flex;
    gap: 60px;
    white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
}

.ticker-item {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    font-style: italic;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-block;
    padding-right: 60px;
}

.ticker-item:hover {
    color: #111;
    text-decoration: underline;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ---- Header Actions & Mobile ---- */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.hamburger-icon span {
    width: 24px;
    height: 2px;
    /* background: var(--primary-color); */
    background-color: #fff;
    display: block;
    margin: 5px 0;
    transition: 0.3s;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    position: relative;
    width: 90%;
    max-width: 600px;
}

.search-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 45px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input {
    width: 100%;
    padding: 20px 30px;
    font-size: 27px;
    border: none;
    border-radius: 50px;
    outline: none;
}

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */

.menu-overlay {
    position: fixed;
    top: 0;
    width: 100vw;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 50px;
}

.menu-search {
    position: relative;
    margin-bottom: 40px;
    padding-top: 20px;
}

.menu-search .search-input {
    width: 100%;
    padding: 15px 60px 15px 50px;
    font-size: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 30px;
    outline: none;
    background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>') no-repeat 20px center;
    transition: border-color 0.3s ease;
}

.menu-search .search-input:focus {
    border-color: var(--primary-color);
}

.menu-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 34px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.menu-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.menu-section ul {
    list-style: none;
}

.menu-section ul li {
    margin-bottom: 8px;
}

.menu-section ul li a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 16px;
    transition: color 0.3s ease, padding-left 0.3s ease;
    display: block;
    padding: 5px 0;
}

.menu-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 10px;
}

.menu-section mark {
    background-color: #fef08a;
    color: var(--text-dark);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.menu-section,
.menu-section ul li {
    transition: opacity 0.2s ease, height 0.2s ease;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: rgba(30, 58, 138, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(30, 58, 138, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .header-brand-row {
        flex-wrap: wrap;
        gap: 15px;
    }

    .header-est {
        display: none;
    }

    .header-college-name {
        font-size: 22px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-wrapper {
        display: none;
    }

    .header-ticker-inner {
        height: 34px;
    }

    .ticker-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
}

@media (max-width: 768px) {
    .header-brand-bar {
        padding: 12px 0;
    }

    .header-logo {
        height: 80px;
    }

    .header-society {
        font-size: 10px;
    }

    .header-college-name {
        font-size: 18px;
    }

    .header-affiliation {
        font-size: 11px;
    }

    .ticker-item {
        font-size: 12px;
    }
}

@media (max-width: 558px) {
    .menu-toggle {
        position: absolute;
        right: 10px;
        top: 30px;
    }
}