/* Modern Navigation Styles */
:root {
    --nav-height: 70px;
    --primary-color: #2a5298;
    --secondary-color: #3a6bc7;
    --text-color: #333;
    --light-text: #666;
    --bg-color: #fff;
    --hover-bg: #f5f8fa;
    --hover-bg-darker: #e8edf5;
    --border-color: #eaeaea;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Fix for horizontal scroll on small screens */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

.modern-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--bg-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 9999;
}

.nav-wrapper {
    max-width: 1200px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.brand-logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 10px 0;
}

.brand-logo img {
    height: 40px;
    width: auto;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 10001;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background: var(--text-color);
    transition: var(--transition);
}

.menu-container {
    display: flex;
    align-items: center;
    height: 100%;
    z-index: 10000;
}

.main-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.main-menu > li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    height: 100%;
    white-space: normal;
    line-height: 1.4;
    word-wrap: break-word;
}

.menu-link i {
    margin-left: 5px;
    font-size: 0.8rem;
}

.menu-link:hover,
.menu-link.active {
    color: var(--primary-color);
}

.has-submenu {
    position: relative;
}

/* Vertical Dropdown Styles */
.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-color);
    min-width: 220px;
    max-width: 300px;
    padding: 8px 0;
    border-radius: 4px;
    box-shadow: 0 2px 15px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    list-style: none;
    z-index: 10002;
    display: flex;
    flex-direction: column;
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.submenu a {
    display: flex;
    align-items: flex-start;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: normal;
    line-height: 1.4;
    word-wrap: break-word;
}

.submenu a i {
    margin-right: 10px;
    min-width: 20px;
    margin-top: 3px;
}

.submenu a:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    padding-left: 25px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    margin-left: 20px;
    gap: 5px;
}

.lang-btn {
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: var(--transition);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
}

.lang-btn:not(.active):hover {
    background: var(--hover-bg);
}

/* Mobile Styles */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .menu-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 100%;
        height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        padding: 80px 15px 30px;
        transition: var(--transition);
        z-index: 10000;
        overflow-y: auto;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .main-menu {
        flex-direction: column;
        width: 100%;
        height: auto;
    }
    
    .main-menu > li {
        width: 100%;
        height: auto;
        display: block;
    }

    .menu-link {
        padding: 12px 15px;
        height: auto;
        min-height: 44px;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        box-sizing: border-box;
    }

    .menu-link i {
        margin-left: 10px;
        min-width: 20px;
        margin-top: 3px;
    }

    .submenu {
        position: static;
        width: 100%;
        max-width: none;
        transform: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        background: var(--hover-bg);
        box-sizing: border-box;
        display: none;
        opacity: 1;
        visibility: visible;
    }

    .has-submenu:hover .submenu {
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
    }

    .has-submenu.active .submenu {
        display: block;
    }

    .menu-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
        height: auto;
        min-height: 44px;
    }

    .submenu a {
        padding-left: 15px;
        background: var(--hover-bg);
        border-bottom: 1px solid var(--border-color);
    }

    .submenu a i {
        margin-right: 8px;
        min-width: 16px;
        margin-top: 3px;
    }

    .submenu a:hover {
        padding-left: 20px;
        background: var(--hover-bg-darker, #e8edf5);
    }

    .direct-link {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        color: var(--primary-color);
        text-decoration: none;
        font-size: 0.9rem;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-color);
    }

    .direct-link i {
        margin-right: 10px;
    }

    .direct-link:hover {
        background: var(--hover-bg);
    }

    .menu-container.active {
        right: 0;
        box-shadow: -2px 0 10px var(--shadow-color);
    }

    .lang-switcher {
        margin: 20px 0 0;
        padding-top: 20px;
        border-top: 1px solid var(--border-color);
        width: 100%;
        justify-content: center;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        display: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

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

/* Additional responsive adjustments for very small screens */
@media (max-width: 360px) {
    .menu-container {
        width: 100%;
        padding: 80px 10px 30px;
    }

    .nav-wrapper {
        padding: 0 10px;
    }

    .menu-link {
        font-size: 0.9rem;
        padding: 10px 8px;
    }

    .submenu a {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}

/* Ensure dropdown items are visible on dark backgrounds */
.submenu a {
    color: var(--text-color);
}

/* Core Navigation Styles */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 99999;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #333;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-menu {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-item {
    position: relative;
    margin: 0 0.3rem;
    white-space: nowrap;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
    display: block;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #4a90e2;
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 1001;
    list-style: none;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
}

.nav-dropdown li {
    width: 100%;
}

.nav-item:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: #4a90e2;
}

.language-switcher {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
}

.lang-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    margin: 0 0.15rem;
}

.lang-btn.active {
    background: #4a90e2;
    color: #fff;
}

/* Parent links in mobile version */
.nav-parent-item {
    border-bottom: 1px solid #ddd;
    margin-bottom: 5px;
    background-color: #f0f0f0;
    width: 100%;
}

.nav-parent-link {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    width: 100%;
    text-align: left;
}

.nav-parent-link:hover {
    background-color: #e6e6e6;
}

/* Main content spacing */
main {
    margin-top: 70px; /* Equal to nav height */
}

/* Responsive styles */
@media (min-width: 993px) and (max-width: 1200px) {
    .nav-link {
        padding: 0.5rem 0.3rem;
        font-size: 0.85rem;
    }
    
    .nav-item {
        margin: 0 0.15rem;
    }
    
    .lang-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .nav-toggle {
        display: block;
        z-index: 99999;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -320px; /* Start offscreen */
        width: 300px;
        height: 100vh;
        background: #fff;
        padding: 80px 20px 30px;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 99990;
        overflow-y: auto;
        margin-left: 0;
        justify-content: flex-start;
    }
    
    .nav-menu.active {
        right: 0; /* Slide in from right */
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
        align-items: flex-start;
    }
    
    .nav-item {
        width: 100%;
        margin: 0;
    }
    
    .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid #eee;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-link[data-has-dropdown]:after {
        content: '+';
        font-size: 1.2rem;
        font-weight: 300;
    }
    
    .nav-link.active[data-has-dropdown]:after {
        content: '-';
    }
    
    /* Fix dropdown styles for mobile */
    .nav-dropdown {
        position: static;
        box-shadow: none;
        width: 100%;
        padding: 0;
        margin-top: 0;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: #f9f9f9;
        border-radius: 0;
    }
    
    .nav-dropdown.show {
        display: block;
        padding: 0;
    }
    
    .dropdown-item {
        padding: 10px 15px 10px 25px;
        border-bottom: 1px solid #eee;
    }
    
    /* Language switcher */
    .language-switcher {
        margin-top: 20px;
        display: flex;
        justify-content: flex-start;
        gap: 10px;
        border-top: 1px solid #eee;
        padding-top: 15px;
        width: 100%;
    }
}

/* Animation for nav hide/show on scroll */
.main-nav.hide {
    transform: translateY(-100%);
}

/* Transition for scrolled state */
.nav-link.scrolled {
    color: var(--text-dark, #333);
}

/* Ensure dropdown items are visible on dark backgrounds */
.nav-dropdown .dropdown-item {
    color: #333;
} 