/* ===================================
   MASTER NAVIGATION - CONSISTENT ACROSS ALL PAGES
   Use this CSS on every page!
=================================== */

/* Header Styling */
.header {
    position: sticky;
    top: 0;
    z-index: 10000;
    background: var(--bg-primary, #ffffff);
    border-bottom: 1px solid var(--border-color, #dee2e6);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo a {
    font-size: 26px;
    font-weight: 700;
    color: #326fa8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: #d11f66;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    margin: 0;
    padding: 0;
    align-items: center;
}

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

.nav-menu a {
    color: var(--text-primary, #212529);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #326fa8;
}

/* Dropdown Container */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle i.fa-chevron-down {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown Menu - FIXED & CONSISTENT */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 30px;
    min-width: 880px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    margin-top: 10px;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    margin-top: 0;
}

/* Dropdown Sections */
.dropdown-section {
    display: flex;
    flex-direction: column;
}

.dropdown-section h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #326fa8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.dropdown-section a {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary, #6c757d);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.dropdown-section a:hover {
    background: #f8f9fa;
    color: #326fa8;
    transform: translateX(5px);
}

.dropdown-section a.active {
    background: #e7f3ff;
    color: #326fa8;
    font-weight: 600;
}

.dropdown-section a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #326fa8;
}

/* Nav Right Side */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Theme Toggle */
.theme-toggle {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-primary, #212529);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: #326fa8;
    color: white;
    transform: rotate(20deg) scale(1.1);
}

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

.mobile-menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--text-primary, #212529);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Dark Mode Support */
[data-theme="dark"] .header {
    background: #1a1d23;
    border-bottom-color: #404654;
}

[data-theme="dark"] .dropdown-menu {
    background: #252932;
    border-color: #404654;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .dropdown-section a:hover {
    background: #2f3542;
}

[data-theme="dark"] .dropdown-section a.active {
    background: #2a3f5f;
}

[data-theme="dark"] .theme-toggle {
    background: #2f3542;
    border-color: #404654;
}

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-secondary, #f8f9fa);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary, #6c757d);
}

.breadcrumb a {
    color: #326fa8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #d11f66;
    text-decoration: underline;
}

.breadcrumb span:not(:last-child) {
    color: var(--text-tertiary, #adb5bd);
}

/* ===================================
   RESPONSIVE - MOBILE
=================================== */
@media (max-width: 1024px) {
    .dropdown-menu {
        min-width: 750px;
        grid-template-columns: repeat(3, 1fr);
        left: auto;
        right: 0;
        transform: none;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 15px 20px;
    }
    
    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-primary, #ffffff);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        z-index: 9999;
        display: none;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid var(--border-color, #dee2e6);
        padding: 15px 0;
    }
    
    .nav-menu > li:last-child {
        border-bottom: none;
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        display: none;
        grid-template-columns: 1fr;
        min-width: 100%;
        margin-top: 15px;
        padding: 20px;
        box-shadow: none;
        background: #f8f9fa;
        border: none;
        border-radius: 8px;
    }
    
    .dropdown.active .dropdown-menu {
        display: grid;
    }
    
    .dropdown-toggle {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 10px 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .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);
    }
    
    [data-theme="dark"] .nav-menu {
        background: #1a1d23;
    }
    
    [data-theme="dark"] .dropdown-menu {
        background: #2f3542;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #326fa8;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(50, 111, 168, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
}

.back-to-top:hover {
    background: #d11f66;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(209, 31, 102, 0.5);
}

.back-to-top.show {
    display: flex;
}
