/**
 * Pure CSS Header Navigation
 * No Bootstrap - Clean hierarchical dropdown menus
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Header Container */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
}

.logo a {
    display: block;
    line-height: 0;
}

.logo img {
    height: 60px;
    width: auto;
}

/* Main Navigation */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu>li {
    position: relative;
}

.nav-menu>li>a {
    display: block;
    padding: 28px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu>li>a:hover {
    color: #007bff;
}

/* Level 1 Dropdown (Subcategories) */
.has-dropdown {
    position: relative;
}

.dropdown-level1 {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.has-dropdown:hover .dropdown-level1 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-level1>li {
    position: relative;
}

.dropdown-level1>li>a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-level1>li>a:hover {
    background: #f8f9fa;
    color: #007bff;
    border-left-color: #007bff;
    padding-left: 25px;
}

.dropdown-level1>li>a .arrow {
    opacity: 0.5;
    transition: all 0.3s ease;
}

.dropdown-level1>li:hover>a .arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* Level 2 Dropdown (Formations) */
.has-submenu {
    position: relative;
}

.dropdown-level2 {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 400px;
    max-width: 500px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 15px 50px rgba(0, 123, 255, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 123, 255, 0.1);
    list-style: none;
    padding: 15px 0;
    margin-left: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-height: 80vh;
    overflow-y: auto;
}

.has-submenu:hover .dropdown-level2 {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

/* Keep dropdown visible when hovering over it */
.dropdown-level2:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dropdown-level2>li {
    list-style: none;
}

.dropdown-level2>li>a {
    display: flex;
    align-items: flex-start;
    padding: 10px 20px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.dropdown-level2>li>a:hover {
    background: #f0f7ff;
    color: #007bff;
    padding-left: 25px;
}

/* Icon styles removed - no emojis */

/* View All Links */
.dropdown-level2>li.view-all {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.dropdown-level2>li.view-all a {
    color: #007bff;
    font-weight: 600;
}

.dropdown-level2>li.view-all a:hover {
    background: #e7f3ff;
    color: #0056b3;
}

.dropdown-level1>li.main-view-all {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #e0e0e0;
}

.dropdown-level1>li.main-view-all a {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff !important;
    font-weight: 600;
    padding: 12px 20px;
    margin: 5px 10px;
    border-radius: 6px;
    border-left: 3px solid transparent !important;
}

.dropdown-level1>li.main-view-all a:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
    padding-left: 20px !important;
}

/* Scrollbar Styling */
.dropdown-level2::-webkit-scrollbar {
    width: 6px;
}

.dropdown-level2::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dropdown-level2::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.dropdown-level2::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Tablet/Medium Desktop Responsive Styles (1270px to 992px) */
@media (max-width: 1270px) and (min-width: 992px) {
    .header-container {
        padding: 0 15px;
    }

    .nav-menu {
        gap: 0;
        margin: 0;
    }

    .nav-menu>li>a {
        padding: 28px 12px;
        font-size: 15px;
    }

    .dropdown-level1 {
        min-width: 250px;
    }

    .dropdown-level2 {
        min-width: 350px;
        max-width: 450px;
    }

    .logo img {
        height: 55px;
    }
}

/* Additional adjustment for tighter screens */
@media (max-width: 1100px) and (min-width: 992px) {
    .nav-menu>li>a {
        padding: 28px 8px;
        font-size: 14px;
    }

    .dropdown-level1 {
        min-width: 230px;
    }

    .dropdown-level2 {
        min-width: 320px;
        max-width: 400px;
    }
}

/* Mobile Styles */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .main-nav {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 20px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .main-nav.active {
        transform: translateX(0);
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .nav-menu>li {
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-menu>li>a {
        padding: 15px 0;
    }

    /* Mobile Dropdowns - Accordion Style */
    .dropdown-level1 {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: #f8f9fa;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.3s ease;
    }

    .has-dropdown.active .dropdown-level1 {
        max-height: 2000px;
        padding: 10px 0;
    }

    .dropdown-level1>li>a {
        padding: 12px 20px;
    }

    .dropdown-level2 {
        position: static;
        box-shadow: none;
        border: none;
        margin-left: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.3s ease;
    }

    .has-submenu.active .dropdown-level2 {
        max-height: 1500px;
        padding: 10px 0;
    }

    .dropdown-level2>li>a {
        padding: 10px 30px;
    }
}

/* Desktop Hover Behavior */
@media (min-width: 992px) {

    /* Ensure hover works properly on desktop */
    .has-dropdown:hover>.dropdown-level1,
    .dropdown-level1:hover {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .has-submenu:hover>.dropdown-level2,
    .dropdown-level2:hover {
        opacity: 1;
        visibility: visible;
        transform: translateX(0) scale(1);
        pointer-events: auto;
    }
}


/* Print Styles */
@media print {

    .dropdown-level1,
    .dropdown-level2,
    .mobile-menu-toggle {
        display: none !important;
    }
}