/* Header Structure & Mega Menu */

/* Left Column - Logo & General Information */
.megamenu-panel .col-3 {
    padding-right: 1.875rem !important; border-right: 2px solid rgba(255, 255, 255, 0.2);
}

/* Logo in Structure Section */
.megamenu-panel .col-3 img {
    margin-bottom: 1.875rem; opacity: 0.6;
    transition: opacity 0.3s ease;
}

.megamenu-panel .col-3 img:hover {
    opacity: 0.8;
}

/* General Information Links - Left Column */
.megamenu-panel .col-3 > ul.list-unstyled > li {
    margin-bottom: 0.5rem !important; line-height: 1.5;
}

.megamenu-panel .col-3 > ul.list-unstyled > li a {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    display: block !important;
    position: relative !important;
    color: rgba(255, 255, 255, 1) !important;
}

.megamenu-panel .col-3 > ul.list-unstyled > li a:hover {
    color: rgba(255, 255, 255, 1) !important;
    text-shadow: 0 0 0.5px rgba(255, 255, 255, 0.8), 0 0 0.5px rgba(255, 255, 255, 0.8) !important;
}

/* Institute/Faculty Titles (h4) - Same level as General Information */
.megamenu-panel h4 {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important; margin-top: 0 !important;
    line-height: 1.5 !important;
    min-height: auto !important;
    display: block !important;
}

.megamenu-panel h4 a {
    text-decoration: none !important;
    transition: none !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    display: block !important;
    position: relative !important;
    color: rgba(255, 255, 255, 1) !important;
}

.megamenu-panel h4 a:hover {
    color: rgba(255, 255, 255, 1) !important;
    text-shadow: 0 0 0.5px rgba(255, 255, 255, 0.8), 0 0 0.5px rgba(255, 255, 255, 0.8) !important;
}

/* Spacing between multiple h4 titles - No border lines */
.megamenu-panel .list-unstyled + h4 {
    margin-top: 20px !important;
    padding-top: 0;
    border-top: none;
}

/* First h4 in each column - no border */
.megamenu-panel .col-4 > h4:first-child,
.megamenu-panel .col-3 > h4:first-child {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Department/Program Lists under h4 */
.megamenu-panel h4 + ul.list-unstyled {
    margin-bottom: 0 !important;
    padding-left: 0.9375rem !important; }

.megamenu-panel h4 + ul.list-unstyled li {
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
}

.megamenu-panel h4 + ul.list-unstyled li a {
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    display: block !important;
    position: relative !important;
}

.megamenu-panel h4 + ul.list-unstyled li a:hover {
    color: rgba(255, 255, 255, 1) !important;
    text-shadow: 0 0 0.5px rgba(255, 255, 255, 0.8), 0 0 0.5px rgba(255, 255, 255, 0.8) !important;
}

/* Institute Columns Spacing & Width */
.megamenu-panel-row .col-9 {
    width: 70.25% !important;
}

.megamenu-panel .col-9 {
    padding-left: 30px !important;
}

.megamenu-panel .col-9 .col-4 {
    padding: 0 15px !important;
}

.megamenu-panel .col-9 .col-4:first-child {
    padding-left: 0 !important;
}

.megamenu-panel .col-9 .col-4:last-child {
    padding-right: 0 !important;
}

/* Direct .col-4 children (Абітурієнт menu) */
.megamenu-panel-row > .col-4 {
    padding: 0 15px !important;
}

.megamenu-panel-row > .col-4:first-child {
    padding-left: 0 !important;
}

.megamenu-panel-row > .col-4:last-child {
    padding-right: 0 !important;
}

/* Override base navigation styles - Keep text white */
.megamenu-panel .list-unstyled li a,
.megamenu-panel .list-unstyled li a:hover,
.megamenu-panel h4 a,
.megamenu-panel h4 a:hover {
    color: rgba(255, 255, 255, 1) !important;
    text-decoration: none !important;
}

/* Add text emphasis on hover using text-shadow (no layout shift) */
.megamenu-panel .list-unstyled li a:hover,
.megamenu-panel h4 a:hover {
    text-shadow: 0 0 0.5px rgba(255, 255, 255, 0.8), 0 0 0.5px rgba(255, 255, 255, 0.8) !important;
}

/* Text spans - no background by default, position above ::after */
.megamenu-panel .list-unstyled li a span,
.megamenu-panel h4 a span {
    padding: 5px 10px 5px 10px !important;
    display: inline-block !important;
    transition: none !important;
    position: relative !important;
    z-index: 1 !important;
}

/* NO padding shift on hover - prevent jumping */
.megamenu-panel .list-unstyled li a:hover span,
.megamenu-panel h4 a:hover span {
    padding: 5px 10px 5px 10px !important;
}

/* Background effect - ONLY show on hover */
.megamenu-panel .list-unstyled li a::after,
.megamenu-panel h4 a::after {
    content: '' !important;
    display: block !important;
    width: 0 !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 3px !important;
    transition: width 300ms ease-in-out !important;
    z-index: 0 !important;
}

.megamenu-panel .list-unstyled li a:hover::after,
.megamenu-panel h4 a:hover::after {
    width: 100% !important;
}

/* Bullet points - keep in place, white color */
.megamenu-panel .list-unstyled li a::before {
    font-family: 'FontAwesome' !important;
    content: "\f111" !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.3rem !important;
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    margin-top: -2px !important;
    z-index: 1 !important;
    transition: none !important;
}

.megamenu-panel .list-unstyled li a:hover::before {
    left: 0 !important;
    color: rgba(255, 255, 255, 1) !important;
}

/* Mega Menu Panel Background */
.megamenu-panel {
    background: linear-gradient(135deg, #0092cf 0%, #00a8ec 100%) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Better padding for the entire panel */
.megamenu-panel {
    padding: 50px 30px 60px !important;
}

/* Single-column dropdowns should be narrow, not full-width */
/* Maximum specificity with multiple selectors to override all inline styles */
/* Desktop only - fit-content for megamenu-panel-quarter */
@media (min-width: 992px) {
    div.megamenu-panel.megamenu-panel-quarter[style],
    .navigation-landscape div.megamenu-panel.megamenu-panel-quarter[style],
    body div.megamenu-panel.megamenu-panel-quarter[style] {
        width: fit-content !important;
        min-width: auto !important;
        max-width: none !important;
    }

    .navigation-landscape .megamenu-panel.megamenu-panel-quarter,
    .megamenu-panel.megamenu-panel-quarter.nav-submenu,
    .nav-menu .megamenu-panel.megamenu-panel-quarter,
    body .megamenu-panel.megamenu-panel-quarter {
        width: fit-content !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

/* Mobile - full width */
@media (max-width: 991px) {
    .navigation-portrait .megamenu-panel.megamenu-panel-quarter,
    .navigation-portrait div.megamenu-panel.megamenu-panel-quarter[style],
    body .navigation-portrait .megamenu-panel.megamenu-panel-quarter {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Also target any mega menu that only has one column container - desktop only */
@media (min-width: 992px) {
    .navigation-landscape .megamenu-panel:not(:has(.col-9)):not(:has(.col-6)):not(:has(.col-4)):not(:has(.col-3)) {
        width: fit-content !important;
    }
}

.megamenu-panel-quarter .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* Scrollbar styling for mega menu (if content overflows) */
.megamenu-panel::-webkit-scrollbar {
    width: 8px;
}

.megamenu-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.megamenu-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.megamenu-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Typography improvements */
.megamenu-panel {
    font-family: 'Gotham Pro', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    letter-spacing: 0.2px;
}

/* Better line heights */
.megamenu-panel ul {
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .megamenu-panel h4 {
        font-size: 0.9rem !important;
        min-height: auto;
    }
    
    .megamenu-panel h4 + ul.list-unstyled li a {
        font-size: 0.8rem;
    }
}

@media (max-width: 1200px) {
    .megamenu-panel .col-3 {
        padding-right: 20px !important;
    }
    
    .megamenu-panel .col-9 {
        padding-left: 20px !important;
    }
    
    .megamenu-panel .col-9 .col-4 {
        padding: 0 10px !important;
    }
    
    /* Direct .col-4 children (Абітурієнт menu) */
    .megamenu-panel-row > .col-4 {
        padding: 0 10px !important;
    }
}

/* Mobile responsiveness */
@media (max-width: 992px) {
    .megamenu-panel .col-3,
    .megamenu-panel .col-9 {
        padding: 0 !important;
        border-right: none !important;
    }
    
    .megamenu-panel .col-9 .col-4 {
        padding: 15px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .megamenu-panel .col-9 .col-4:last-child {
        border-bottom: none;
    }
    
    /* Direct .col-4 children (Абітурієнт menu) */
    .megamenu-panel-row > .col-4 {
        padding: 15px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .megamenu-panel-row > .col-4:last-child {
        border-bottom: none;
    }
    
    .megamenu-panel h4 {
        min-height: auto;
        margin-bottom: 10px !important;
    }
    
    .megamenu-panel .list-unstyled + h4 {
        margin-top: 20px !important;
        padding-top: 20px;
    }
}

/* Animation on menu open */
.megamenu-panel {
    animation: fadeInDown 0.3s ease-in-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
.megamenu-panel a:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Print styles */
@media print {
    .megamenu-panel {
        display: none !important;
    }
}

/* ================================================
   ADDITIONAL HEADER STYLES (Moved from inline)
   ================================================ */

/* Navigation menus wrapper */
.nav-menus-wrapper {
    transition-property: none;
}

/* Mega menu logo opacity */
.megamenu-panel .mt-2.mb-4 {
    opacity: 0.5;
}

/* Mega menu section headings with padding */
.megamenu-panel .col-4 h4,
.megamenu-panel .col-3 h4 {
    padding-top: 0.3125rem; }

/* Font weight adjustment for specific h4 span */
.megamenu-panel h4 span {
    font-weight: 300;
}

/* Smaller font size for specific submenu items */
.megamenu-panel li a span {
    font-size: 0.9rem;
}

/* Mega menu positioning - right aligned */
.megamenu-panel.nav-submenu[style*="right: 0"] {
    right: 0px;
}

/* Mega menu positioning - left aligned */
.megamenu-panel.nav-submenu[style*="right: auto"],
.megamenu-panel-quarter.nav-submenu {
    right: auto;
}

