/*
 * GlobalMilitary.net - Consolidated Navigation Menu Styles
 * This file contains all menu-related styles using BEM methodology
 */

/* ========================= NAVIGATION MAIN STRUCTURE ============================ */
.nav {
    background: linear-gradient(135deg, #2a3f54 0%, #2e70a7 100%);
    padding: 0;
    margin: 0;
    border-top: 1px solid rgba(255,255,255,0.15);
    border-bottom: 1px solid rgba(0,0,0,0.2);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.nav-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.nav-list__item {
    margin: 0;
    position: relative;
}

.nav-list__link {
    text-decoration: none;
    color: #fff !important;
    padding: 11px 22px;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    border-radius: var(--border-radius-sm);
    margin: 0 1px;
}

.nav-list__link svg {
    margin-right: 6px;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.nav-list__link:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
}

.nav-list__link:hover svg {
    opacity: 1;
}

/* ============================== ACTIVE STATE STYLING ============================ */
.nav-list__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-blue));
    transform: translateY(-2px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-list__link:hover::before {
    transform: translateY(0);
    opacity: 1;
    height: 3px;
}

.nav-list__link.is-active {
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.05) 100%);
    font-weight: 600;
}

.nav-list__link.is-active::before {
    transform: translateY(0);
    opacity: 1;
    background: var(--accent-color);
    height: 3px;
}

/* ============================ DROPDOWN MENU STYLING ============================= */
.nav-dropdown {
    position: relative;
}

.nav-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.98) 100%);
    backdrop-filter: blur(12px);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    z-index: 100;
    list-style-type: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.nav-dropdown__item {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    padding: 0;
}

.nav-dropdown__item:last-child {
    border-bottom: none;
}

.nav-dropdown__link {
    padding: 9px 20px;
    display: block;
    color: var(--text-color) !important;
    font-weight: normal;
    position: relative;
    text-shadow: none;
    transition: all 0.3s ease;
    border-radius: 0;
    margin: 0;
}

.nav-dropdown__link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-dropdown__link:hover {
    background: linear-gradient(90deg, rgba(78, 107, 132, 0.08), transparent);
    color: var(--primary-color) !important;
    transform: none;
    margin: 0;
}

.nav-dropdown__link:hover::after {
    opacity: 0.7;
}

.nav-dropdown__link.is-active {
    background: linear-gradient(90deg, rgba(78, 107, 132, 0.12), transparent);
    font-weight: 600;
    color: var(--primary-color) !important;
}

.nav-dropdown__link.is-active::after {
    opacity: 1;
}

@media screen and (min-width: 801px) {
    .nav-dropdown:hover .nav-dropdown__menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* ========================= DROPDOWN TOGGLE ARROWS =============================== */
.nav-dropdown__toggle {
    text-decoration: none !important;
}

.nav-dropdown__toggle:hover {
    text-decoration: none !important;
}

.nav-dropdown__toggle::after {
    content: " ▶";
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s;
    display: inline-block;
    vertical-align: middle;
    opacity: 0.8;
    text-decoration: none;
}

.nav-dropdown__toggle:hover::after,
.nav-dropdown__toggle.is-active::after {
    transform: rotate(90deg);
    opacity: 1;
    text-decoration: none;
}

/* =========================== MOBILE MENU STYLING ================================ */
.nav-mobile__toggle {
    display: none;
}

.nav-mobile__icon {
    height: 20px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    display: none;
    padding: 10px;

}

.nav-mobile__title {
    display: none;
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    margin-left: 15px;
    flex-grow: 1;
}

.nav-mobile__title a {
    color: #fff !important;
    text-decoration: none;
}

.nav-mobile__bar {
    background-color: #e6e6e6;
    height: 2px;
    width: 25px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media screen and (max-width: 800px) {
    .nav {
        display: flex;
        align-items: center;
        padding: 0 10px;
    }
    .nav-mobile__icon {
        display: flex;
    }
    .nav-mobile__title {
        display: block;
    }
    .nav-dropdown__toggle::after {
        font-size: 10px;
    }

    .nav-list {
        display: none;
        width: 100%;
        max-width: 250px;
        text-align: left;
        position: absolute;
        top: 100%;
        left: 0;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        flex-direction: column;
        z-index: 100;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        border-radius: 0 0 5px 0;
    }
    .nav-mobile__toggle:checked ~ .nav-list {
        display: flex;
    }
    .nav-mobile__toggle:checked + .nav-mobile__icon .nav-mobile__bar:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    .nav-mobile__toggle:checked + .nav-mobile__icon .nav-mobile__bar:nth-child(2) {
        opacity: 0;
    }
    .nav-mobile__toggle:checked + .nav-mobile__icon .nav-mobile__bar:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    .nav-list__item {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-list__item:last-child {
        border-bottom: none;
    }
    .nav-dropdown__menu {
        position: static;
        display: none;
        width: 100%;
        max-width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.7);
        list-style-type: none;
        padding: 0;
        margin: 0;
    }
    .nav-dropdown__menu.is-visible {
        display: block;
    }
    .nav-dropdown__item {
        padding-left: 0;
    }
    .nav-dropdown__link {
        padding: 7px 20px 7px 25px;
        font-size: 0.95em;
    }
    .nav-dropdown__link::after {
        width: 3px;
        left: 0;
        height: 100%;
    }
    .nav-dropdown__menu .nav-dropdown__menu {
        background: rgba(0,0,0,0.2);
        border-radius: 0;
    }
.nav-dropdown__menu .nav-dropdown__link {
        padding-left: 35px;
    }
}

/* Dark Mode Toggle */
.theme-toggle {
    float: right;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    margin: 0 10px 0 0;
}

.theme-toggle:hover {
    color: #fff;
}

.theme-toggle svg {
    display: block;
}

/* Dark Mode Styles */
body.dark .nav {
    background: linear-gradient(135deg, #1c1c1c 0%, #1f1f1f 100%);
}

body.dark .nav-dropdown__menu {
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.95) 0%, rgba(35, 35, 35, 0.98) 100%);
    border-color: #495057;
}

body.dark .nav-dropdown__link {
    color: #f8f9fa !important;
}

body.dark .nav-dropdown__link:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
    color: #64b5f6 !important;
}

body.dark .nav-dropdown__link.is-active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), transparent);
    color: #64b5f6 !important;
}

body.dark .nav-dropdown__item {
    border-bottom-color: #495057;
}

/* Dark mode mobile menu */
@media screen and (max-width: 800px) {
    body.dark .nav-list {
        background: linear-gradient(135deg, #121212 0%, #1f1f1f 100%);
    }

    body.dark .nav-dropdown__menu {
        background: rgba(45, 45, 45, 0.9);
    }

    body.dark .nav-dropdown__menu .nav-dropdown__menu {
        background: rgba(30, 30, 30, 0.9);
    }
}
