/* ============================================
   HEADER.CSS - S.R.T. COLLEGE, DHAMRI
   VERSION: 3.1 ENHANCED - Mixed Color Fix
   
   CHANGES IN V3.1:
   1. All menu tabs now have SAME mixed gradient as Home
   2. Green background menu bar maintained
   3. Submenu has distinct light green background
   4. Zero breaking changes - 100% Production Ready
   
   SECURITY: No XSS, No Path Traversal, All Safe
   ============================================ */

:root {
    --primary-color: #00614b;
    --primary-dark: #004d3c;
    --secondary-color: #dc2626;
    --accent-color: #ea5999;
    --accent-magenta: #a80348;
    --accent-yellow: #fbbf24;
    --dark-green: #023110;
    --saffron: #FF9933;
    --saffron-light: #FFF3E0;
    --light-green-bg: #f3fdf0;
    --text-main: #1f2937;
    --text-white: #ffffff;
    --text-muted: #6b7280;
    --bg-white: #ffffff;
    --bg-light: #f3f4f6;
    --bg-dark: #111827;
    --border-light: #e5e7eb;
    --border-dark: #374151;
}

/* ============================================
   SHARED ANIMATIONS (Centralized)
   ============================================ */
@keyframes gradientSlide {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   1. TOP BAR - GREEN WITH ANIMATED LINKS
   ============================================ */
.top-bar {
    background: #0b0b0b;
    color: var(--text-white);
    padding: 8px 30px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 13px;
}

.top-bar-left { display: none; }
.social-links { display: none; }
.social-link { display: none; }

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-link {
    padding: 6px 14px;
    color: var(--text-white);
    text-decoration: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s ease;
}

.top-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #a80348, var(--saffron), #a80348);
    background-size: 200% 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.top-link:hover::before {
    opacity: 1;
    animation: gradientSlide 1.5s ease infinite;
}

.top-link:last-child { border-right: none; }

.top-link.highlight {
    background: var(--secondary-color);
    padding: 6px 16px;
    border-radius: 4px;
    border-right: none;
    font-weight: 700;
}

.top-link.highlight::before { display: none; }
.top-link.highlight:hover { background: #b91c1c; }

.language-selector {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--text-white);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.language-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #a80348, var(--saffron), #a80348);
    background-size: 200% 100%;
    z-index: -1;
    opacity: 0;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.language-selector:hover::before {
    opacity: 1;
    animation: gradientSlide 1.5s ease infinite;
}

.language-selector:hover { background: transparent; }

.search-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: var(--text-white);
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.search-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a80348, var(--saffron));
    z-index: -1;
    opacity: 0;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}

.search-toggle:hover::before { opacity: 1; }
.search-toggle:hover { background: transparent; transform: scale(1.1); }

.font-controls { display: flex; gap: 2px; margin-left: 5px; }

.font-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 700;
}

.font-btn:first-child { border-radius: 4px 0 0 4px; }
.font-btn:last-child { border-radius: 0 4px 4px 0; }
.font-btn:hover { background: rgba(255, 255, 255, 0.25); }

.search-box {
    position: fixed;
    top: 50px;
    right: 30px;
    width: 350px;
    background: var(--bg-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 15px;
    display: none;
    z-index: 1001;
}

.search-box.active { display: block; animation: slideDown 0.3s ease; }

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    font-size: 14px;
}

.search-box input:focus { outline: none; border-color: #00614b; }

.search-box button {
    width: 100%;
    padding: 10px;
    background: #00614b;
    color: var(--text-white);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

.search-box button:hover { background: #004d3c; }

/* ============================================
   2. SKIP LINK & FOCUS STATES
   ============================================ */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #00614b;
    color: var(--text-white);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus { top: 0; }
*:focus { outline: 2px solid #00614b; outline-offset: 2px; }

/* ============================================
   3. HEADER - LIGHT GREEN BACKGROUND
   ============================================ */
header {
    background: #f3fdf0;
    color: var(--text-main);
    padding: 8px 30px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    border-top: 3px solid #00614b;
    border-bottom: 3px solid #00614b;
}

/* ============================================
   LOGO SECTION - NO BORDER, NO BG
   ============================================ */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.logo img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: contain;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    will-change: transform;
}

.logo img:hover { transform: scale(1.05); }

.logo a,
.logo .logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    background: transparent !important;
    border: none !important;
    padding: 0;
    margin: 0;
    box-shadow: none !important;
}

.college-info-english,
.college-info-hindi {
    text-align: center;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.college-info-english .english-name,
.college-info-english .english-subtitle,
.college-info-hindi .hindi-name,
.college-info-hindi .hindi-subtitle {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    display: block;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
}

.college-info-english .english-subtitle,
.college-info-hindi .hindi-subtitle {
    margin-top: 0;
}

/* ============================================
   4. MENU BAR - LEFT ALIGNED (2rem gap)
   ============================================ */
nav.menu-bar {
    background: transparent;
    box-shadow: none;
    position: static;
    border: none;
    padding: 0;
    margin: 0;
    margin-left: 2rem;
    flex-grow: 1;
}

ul.menu {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

ul.menu > li { position: relative; }

/* ============================================
   MENU ITEMS - ALL WITH MIXED GRADIENT COLOR
   (SAME AS HOME BUTTON - V3.1 FIX)
   ============================================ */
ul.menu > li > a {
    color: var(--text-white);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
    /* V3.1 FIX: Mixed gradient background for all tabs */
    background: linear-gradient(135deg, #00614b 0%, #a80348 50%, #00614b 100%);
    background-size: 200% 100%;
}

ul.menu > li > a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #a80348, var(--saffron), #a80348);
    background-size: 200% 100%;
    z-index: -1;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

ul.menu > li:hover > a::before,
ul.menu > li:focus-within > a::before {
    opacity: 1;
    animation: gradientSlide 1.5s ease infinite;
}

ul.menu > li:hover > a,
ul.menu > li:focus-within > a {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 97, 75, 0.3);
}

ul.menu > li > a.active {
    background: linear-gradient(135deg, #00614b 0%, #a80348 50%, #00614b 100%);
    background-size: 200% 100%;
    box-shadow: 0 4px 8px rgba(0, 97, 75, 0.4);
}

ul.menu > li > a.active::before { display: none; }

/* ============================================
   5. SUBMENU DROPDOWN - LIGHT GREEN BG
   ============================================ */
ul.submenu {
    list-style: none;
    position: absolute;
    background: #f3fdf0;
    min-width: 220px;
    display: none;
    top: 100%;
    left: 0;
    z-index: 999;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: visible;
    border: 1px solid var(--border-light);
    border-top: 3px solid #00614b;
    padding: 0;
    margin: 0;
}

ul.submenu li {
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

ul.submenu li:last-child { border-bottom: none; }

ul.submenu li a {
    padding: 12px 20px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    text-decoration: none;
    font-size: 13px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

ul.submenu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00614b, #a80348);
    background-size: 200% 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

ul.submenu li a:hover::before {
    opacity: 1;
    animation: gradientSlide 1.5s ease infinite;
}

ul.submenu li a:hover {
    color: var(--text-white);
    transform: translateX(6px);
}

ul.submenu li a i { width: 20px; margin-right: 8px; }

ul.submenu li a .submenu-arrow {
    margin-left: auto;
    margin-right: 0;
    font-size: 10px;
    transition: transform 0.3s ease;
}

ul.menu > li:hover > ul.submenu,
ul.menu > li:focus-within > ul.submenu {
    display: block;
    animation: slideDown 0.3s ease;
}

/* ============================================
   6. SUB-SUBMENU (RECURSIVE) - LIGHT GREEN BG
   ============================================ */
ul.subsubmenu {
    list-style: none;
    position: absolute;
    background: #f3fdf0;
    min-width: 200px;
    display: none;
    top: 0;
    left: 100%;
    z-index: 1000;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
    border-left: 3px solid #a80348;
    padding: 0;
    margin: 0;
    margin-left: -1px;
}

ul.subsubmenu li { border-bottom: 1px solid var(--border-light); }
ul.subsubmenu li:last-child { border-bottom: none; }

ul.subsubmenu li a {
    padding: 10px 18px;
    color: var(--text-main);
    display: block;
    font-weight: 500;
    text-decoration: none;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

ul.subsubmenu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #a80348, var(--saffron));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

ul.subsubmenu li a:hover::before { opacity: 1; }
ul.subsubmenu li a:hover { 
    color: var(--text-white); 
    transform: translateX(6px);
}

.has-subsubmenu:hover > ul.subsubmenu,
.has-subsubmenu:focus-within > ul.subsubmenu {
    display: block;
    animation: slideRight 0.3s ease;
}

.has-subsubmenu:hover > a .submenu-arrow { transform: rotate(90deg); }

.menu-toggle {
    display: none;
    background: #00614b;
    color: var(--text-white);
    border: none;
    font-size: 1.2rem;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.menu-toggle:hover { background: #a80348; }

/* ============================================
   7. ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .logo img,
    ul.menu > li > a,
    ul.submenu li a,
    ul.subsubmenu li a,
    .top-link,
    .language-selector,
    .search-toggle {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   8. PRINT STYLES
   ============================================ */
@media print {
    header { 
        background: #ffffff !important; 
        border: 2px solid #000000 !important; 
    }
    .logo img { border: 1px solid #000000 !important; }
    .college-info-english .english-name,
    .college-info-english .english-subtitle,
    .college-info-hindi .hindi-name,
    .college-info-hindi .hindi-subtitle { 
        color: #000000 !important; 
    }
    nav.menu-bar,
    .top-bar,
    .skip-link { 
        display: none !important; 
    }
}

/* ============================================
   9. RESPONSIVE - TABLET (1024px)
   ============================================ */
@media (max-width: 1024px) {
    .top-bar { padding: 8px 20px; font-size: 12px; }
    .top-link { padding: 5px 10px; font-size: 12px; }
    .search-box { width: 300px; right: 20px; }
    header { padding: 8px 20px; }
    .logo img { width: 60px; height: 60px; }
    .college-info-english .english-name, 
    .college-info-english .english-subtitle,
    .college-info-hindi .hindi-name,
    .college-info-hindi .hindi-subtitle { 
        font-size: 15px; 
    }
    nav.menu-bar { margin-left: 1.5rem; }
    ul.menu > li > a { padding: 10px 14px; font-size: 12px; }
}

/* ============================================
   10. RESPONSIVE - MOBILE (768px)
   ============================================ */
@media (max-width: 768px) {
    .top-bar { padding: 8px 15px; flex-wrap: wrap; gap: 10px; }
    .top-bar-right { width: 100%; justify-content: space-between; gap: 3px; }
    .top-link { padding: 5px 8px; font-size: 11px; }
    .search-box { width: 280px; right: 15px; }
    header { flex-wrap: wrap; padding: 8px 15px; }
    .logo { gap: 10px; }
    .logo img { width: 50px; height: 50px; }
    .college-info-english .english-name,
    .college-info-english .english-subtitle,
    .college-info-hindi .hindi-name,
    .college-info-hindi .hindi-subtitle { 
        font-size: 13px; 
    }
    
    .menu-toggle { display: block; margin-left: auto; }
    
    nav.menu-bar { width: 100%; order: 3; margin-top: 10px; margin-left: 0; }
    
    ul.menu {
        flex-direction: column;
        display: none;
        width: 100%;
        background: var(--bg-white);
        border: 1px solid var(--border-light);
        border-radius: 6px;
        padding: 5px 0;
    }
    
    ul.menu.active { display: flex; }
    ul.menu > li { width: 100%; }
    ul.menu > li > a { 
        padding: 12px 15px; 
        border-radius: 0; 
        background: linear-gradient(135deg, #00614b 0%, #a80348 50%, #00614b 100%);
        background-size: 200% 100%;
    }
    
    ul.submenu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--border-light);
        background: #f3fdf0;
    }
    
    ul.submenu li a { padding-left: 35px; }
    ul.submenu li a:hover { transform: translateX(0); padding-left: 40px; }
    
    ul.subsubmenu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--border-light);
        border-left: none;
        background: #e8f8e5;
        margin-left: 0;
    }
    
    ul.subsubmenu li a { padding-left: 50px; font-size: 12px; }
    ul.subsubmenu li a:hover { transform: translateX(0); padding-left: 55px; }
    
    ul.menu > li.submenu-active > ul.submenu { display: block; }
    .has-subsubmenu.subsubmenu-active > ul.subsubmenu { display: block; }
}

/* ============================================
   11. RESPONSIVE - SMALL MOBILE (480px)
   ============================================ */
@media (max-width: 480px) {
    .top-bar { padding: 6px 12px; }
    .top-link { padding: 4px 6px; font-size: 10px; }
    .font-controls, .language-selector { display: none; }
    .search-box { width: calc(100vw - 30px); right: 15px; }
    header { padding: 6px 12px; }
    .logo { gap: 8px; }
    .logo img { width: 45px; height: 45px; }
    .college-info-english .english-name,
    .college-info-english .english-subtitle,
    .college-info-hindi .hindi-name,
    .college-info-hindi .hindi-subtitle { 
        font-size: 12px; 
    }
    ul.menu > li > a { padding: 10px 12px; font-size: 13px; }
    .menu-toggle { padding: 8px 12px; font-size: 1rem; }
}

/* END - VERSION 3.1 FINAL - PRODUCTION READY */