/* =====================================================
   GLOBAL NAVBAR

   Purpose:
   - Provide one visual system for every SCL Platform navbar.
   - Support home, service and detail page navigation contexts.
   - Keep page-specific dropdown behavior in service CSS files.

   Dependencies:
   - root.css for shared variables.
   - Font Awesome for navigation icons.
   - responsive.css for responsive overrides.
   - animations.css for brand animation keyframes.
===================================================== */

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 78px;
    padding: 18px 6%;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;

    z-index: 1000;

    background: rgba(9, 11, 20, .45);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    border-bottom: 1px solid rgba(255, 255, 255, .06);

    box-shadow:
        0 6px 20px rgba(0, 0, 0, .18),
        0 1px 8px rgba(0, 229, 255, .06);

    transition:
        background .35s ease,
        backdrop-filter .35s ease,
        border-color .35s ease,
        box-shadow .35s ease;
}

#navbar.scrolled {
    background: var(--navbar-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom-color: rgba(255, 255, 255, .06);
    box-shadow:
        0 8px 30px rgba(0, 0, 0, .20),
        var(--shadow);
}

body.light #navbar {
    background: rgba(245, 247, 255, .58);
    border-bottom-color: rgba(0, 0, 0, .06);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}

body.light #navbar.scrolled {
    background: rgba(245, 247, 255, .80);
}

.navbar-left {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
}

.logo,
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    color: var(--text-soft);
    text-decoration: none;
    font-family: var(--navbar-font);
    font-size: var(--navbar-font-size);
    font-weight: var(--navbar-font-weight);
    letter-spacing: var(--navbar-letter-spacing);
    transition:
        color .3s ease,
        opacity .3s ease;
}

.logo {
    color: var(--text);
}

.logo:hover,
.back-home:hover {
    color: var(--text);
}

.back-home i {
    font-size: .85rem;
    transition: transform .3s ease;
}

.back-home:hover i {
    transform: translateX(-2px);
}

.logo .brand-wave {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -.04em;
}

.brand-wave {
    display: inline-block;
    background: linear-gradient(
        90deg,
        #00e5ff 0%,
        #38bdf8 20%,
        #7c4dff 50%,
        #38bdf8 80%,
        #00e5ff 100%
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brandWave 10s linear infinite;
}

#navbar nav {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#navLinks {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#navLinks > li {
    position: relative;
    display: flex;
    align-items: center;
}

#navLinks a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: var(--text-soft);
    text-decoration: none;
    font-family: var(--navbar-font);
    font-size: var(--navbar-font-size);
    font-weight: var(--navbar-font-weight);
    letter-spacing: var(--navbar-letter-spacing);
    transition: color .3s ease;
}

#navLinks a:hover,
#navLinks a:focus-visible {
    color: var(--text);
}

#navLinks a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
    transition: width .3s ease;
}

#navLinks a:hover::after,
#navLinks a:focus-visible::after {
    width: 100%;
}

#themeToggle {
    flex: 1 1 0;
    display: flex;
    justify-content: flex-end;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.toggle-track {
    width: 64px;
    height: 34px;
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid var(--border);
    backdrop-filter: blur(15px);
    transition: .35s;
}

.toggle-thumb {
    position: absolute;
    left: 3px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transition: .35s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 15px rgba(0, 229, 255, .35);
}

body.light .toggle-track {
    background: rgba(0, 0, 0, .08);
}

body.light .toggle-thumb {
    transform: translateX(30px);
}

#menuToggle {
    display: none;
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
}
