/* nav-style.css - Top Navigation Bar Styling */
/* Updated to match primary toolbar style (toolbar-btn / var(--toolbar-bg) system) */

/* ─────────────────────────────────────────────
   CSS Custom Properties — Light & Dark themes
   Mapped to match the primary toolbar variables
───────────────────────────────────────────── */
:root {
    --toolbar-bg:       #1a1a2e;
    --border-color:     #2e2e4a;
    --shadow-toolbar:   0 2px 8px rgba(0,0,0,0.3);
    --btn-bg:           #2a2a3e;
    --btn-color:        #c0c0cc;
    --btn-border:       #3a3a5a;
    --btn-hover-bg:     #3a3a5a;
    --btn-hover-color:  #ffffff;
    --btn-hover-border: #606078;
    --drop-bg:          #1e1e32;
}

[data-theme="dark"] {
    --toolbar-bg:       #0d0d0f;
    --border-color:     #404048;
    --shadow-toolbar:   0 2px 14px rgba(0,0,0,0.6);
    --btn-bg:           #0d0d0f;
    --btn-color:        #a0a0a8;
    --btn-border:       #404048;
    --btn-hover-bg:     #2a2a32;
    --btn-hover-color:  #d0d0d5;
    --btn-hover-border: #606068;
    --drop-bg:          #16161a;
}

/* ─────────────────────────────────────────────
   Nav bar — matches primary toolbar layout
───────────────────────────────────────────── */
.top-nav {
    background: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 20px;
    box-shadow: var(--shadow-toolbar);
    margin-bottom: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.nav-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────
   Base button style — matches .toolbar-btn
───────────────────────────────────────────── */
.nav-btn {
    padding: 4px 10px;
    background: var(--btn-bg);
    color: var(--btn-color);
    border: 1px solid var(--btn-border);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    line-height: 1.5;
}

/* Hover state */
.nav-btn:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-color);
    border-color: var(--btn-hover-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transform: translateY(-1px);
}

/* Active (current page) button */
.nav-btn.active {
    background: #17a2b8 !important;
    color: #ffffff !important;
    border-color: #17a2b8 !important;
    box-shadow: 0 2px 8px rgba(23,162,184,0.3) !important;
    transform: translateY(-1px) !important;
    font-weight: 500;
}

/* ─────────────────────────────────────────────
   Dropdown wrapper
───────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    flex-direction: column;
}

.nav-dropdown > .nav-btn,
.nav-dropdown > .nav-btn.nav-btn-tools {
    width: 100%;
}

/* Dropdown panel: hidden by default */
.nav-dropdown-content {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--drop-bg);
    min-width: 160px;
    z-index: 1100;
    border: 1px solid var(--btn-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    transition: background 0.3s ease, border-color 0.3s ease;
    margin-top: 2px;
}

/* Child links in dropdown */
.nav-dropdown-content .nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    box-shadow: none;
    border-radius: 0;
    border: none;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border-color);
}

.nav-dropdown-content .nav-btn:last-child {
    border-bottom: none;
}

.nav-dropdown-content .nav-btn:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.nav-dropdown-content .nav-btn:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Show dropdown on hover */
.nav-dropdown:hover > .nav-dropdown-content {
    display: block !important;
}

/* Tools trigger button */
.nav-btn.nav-btn-tools {
    cursor: pointer;
    padding: 4px 10px;
}

/* ─────────────────────────────────────────────
   Light / Dark Mode toggle button
───────────────────────────────────────────── */
.nav-theme-toggle {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-theme-icon {
    font-size: 14px;
    line-height: 1;
}

/* ─────────────────────────────────────────────
   Mobile responsive
───────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-container {
        justify-content: center;
    }

    .nav-btn {
        font-size: 13px;
        padding: 8px 14px;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-content {
        position: relative;
        display: inline-flex;
        flex-direction: column;
        margin: 0 6px;
    }

    .nav-theme-toggle {
        width: 100%;
        justify-content: center;
    }
}