/* ======================================================
   NAVIGATION BAR
====================================================== */
nav {
    border-bottom: none;
    margin-bottom: 0;
    box-shadow: var(--nav-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary-bg);
}

/* ======================================================
   TOP MENU
====================================================== */
.menu {
    display: flex;
    justify-content: center;
    gap: var(--nav-menu-gap);
    background: var(--nav-glass-bg);
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    backdrop-filter: blur(var(--nav-glass-blur, 10px));
    -webkit-backdrop-filter: blur(var(--nav-glass-blur, 10px));
    border-bottom: var(--nav-glass-border, 1px solid rgba(255, 255, 255, 0.07));
    box-shadow: var(--nav-shadow);
    border-radius: var(--nav-border-radius);
}

.menu a,
.dropdown-toggle {
    color: var(--text-color);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-base);
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
    background: none;
    border: none;
    border-radius: var(--nav-border-radius);
    transition: color 0.2s;
    vertical-align: middle;
}

/* Only show underline for top-level horizontal menu items, not dropdowns */
.menu > li > a.active::after,
.menu > li > a:hover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--highlight);
    border-radius: 1px;
    transition: background 0.18s;
}

.menu > li > .dropdown-toggle.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--highlight);
    border-radius: 1px;
    transition: background 0.18s;
}

/* Prevent underline on dropdown menu links */
.dropdown-menu li a::after {
    display: none !important;
    content: none !important;
}

.dropdown-toggle.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
}

.dropdown-menu li a.active {
    background: var(--primary);
    color: var(--bg);
    font-weight: 600;
    opacity: 1;
    border-left: 3px solid var(--highlight);
}

/* ======================================================
   DROPDOWN WRAPPER
====================================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

/* ======================================================
   DROPDOWN TOGGLE BUTTON
====================================================== */
.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-base);
    padding: 0.5rem 0 0.5rem 0;
    margin-bottom: 0;
    position: relative;
    cursor: pointer;
    border-radius: var(--nav-border-radius);
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

/* ======================================================
   DROPDOWN MENU
====================================================== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -8px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--nav-glass-bg);
    backdrop-filter: blur(var(--nav-glass-blur, 22px)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--nav-glass-blur, 22px)) saturate(180%);
    border: var(--nav-glass-border, 1.5px solid rgba(255, 255, 255, 0.13));
    box-shadow: var(--nav-dropdown-shadow), 0 2px 20px 0 rgba(30, 38, 43, 0.09) inset;
    border-radius: var(--nav-dropdown-radius);
    min-width: 10rem;
    overflow: hidden;
    z-index: 100;
    width: 12rem;
    transition: opacity 150ms ease-in, transform 200ms ease-out;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
    width: 14rem;
}

.dropdown-menu li {
    margin: 0;
}

/* ======================================================
   DROPDOWN MENU ITEMS
====================================================== */
.dropdown-menu li a {
    white-space: nowrap;
    display: block;
    padding: var(--nav-dropdown-item-padding);
    background: var(--nav-glass-bg);
    color: var(--fg);
    text-decoration: none;
    transform: translateX(0);
    opacity: 0.95;
    border-radius: var(--nav-dropdown-item-radius);
    transition: background 150ms ease, color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.dropdown-menu li a:hover {
    background: var(--primary);
    color: var(--bg);
    transform: translateX(2px);
    opacity: 1;
    border-left: 3px solid var(--highlight);
}

.dropdown-menu li:first-child a,
.dropdown-menu li:last-child a {
    border-radius: var(--nav-dropdown-item-radius);
}

/* ======================================================
   SETTINGS PANEL
====================================================== */
.settings-panel {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--border-radius-default);
    box-shadow: 0 6px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 14rem;
}

/* ======================================================
   SETTINGS PANEL TITLE
====================================================== */
.settings-panel .panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    /* border-bottom: 1px solid var(--shadow); */
    text-align: center;
}

/* ======================================================
   SETTINGS PANEL ITEMS
====================================================== */
.settings-panel li {
    list-style: none;
    margin: 0;
}

.settings-panel li a {
    display: block;
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    color: var(--fg);
    border-radius: var(--border-radius-default);
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: background 200ms, border 200ms, color 200ms;
}

.settings-panel li a:hover,
.settings-panel li a.active {
    color: var(--bg);
}
