/* Shared top navigation styles (index, tools, games, services, kontakt + tool/game subpages) */

[data-legacy-nav="true"],
.menu,
.services_page_topbar,
.contact_page_topbar,
.desktop_quick_nav,
.mobile_quick_nav,
.top_links,
.index_top_links,
.game_reaction .game_home_btn,
.home-button {
    display: none !important;
}

body[data-graph-background="off"] .desktop_quick_nav.graph-top-nav {
    display: none !important;
}

#quick_nav {
    position: fixed;
    top: 18px;
    left: clamp(4px, 2.2vw, 28px);
    z-index: 32;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.42rem;
    margin: 0;
}

#quick_nav,
#quick_nav .quick_nav_toggle,
#quick_nav .quick_nav_menu,
#quick_nav .quick_nav_item {
    box-sizing: border-box;
}

/* Auto-hide top navigation on scroll down, show on scroll up */
.menu,
.services_page_topbar,
.contact_page_topbar,
.desktop_quick_nav,
.top_links,
.index_top_links,
.mobile_quick_nav,
#quick_nav {
    transition: transform 0.22s ease, opacity 0.22s ease;
    will-change: transform, opacity;
}

body.nav-hidden .menu,
body.nav-hidden .services_page_topbar,
body.nav-hidden .contact_page_topbar,
body.nav-hidden .desktop_quick_nav,
body.nav-hidden .top_links,
body.nav-hidden .index_top_links,
body.nav-hidden .mobile_quick_nav,
body.nav-hidden #quick_nav,
body.nav-hidden .site_lang_toggle {
    transform: translateY(calc(-100% - 16px));
    opacity: 0;
    pointer-events: none;
}

.site_lang_toggle {
    position: fixed;
    top: 18px;
    right: clamp(4px, 2.2vw, 28px);
    z-index: 34;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.08rem;
    min-width: 132px;
    padding: 0.42rem 0.72rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: rgba(229, 231, 235, 0.95);
    font-family: var(--font-heading, "Outfit", Arial, Helvetica, sans-serif);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    font-weight: 560;
    line-height: 1.08;
    text-align: left;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.site_lang_toggle_title {
    opacity: 0.82;
    text-transform: uppercase;
}

.site_lang_toggle_values {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    text-transform: none;
}

.site_lang_toggle_option {
    opacity: 0.6;
}

.site_lang_toggle_option.is-active {
    opacity: 1;
}

.site_lang_toggle:hover {
    transform: translateY(-1px) scale(1.04);
    border-color: rgba(255, 255, 255, 0.26);
    color: #ffffff;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.09));
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.menu a,
.services_page_link,
.contact_page_link,
.desktop_quick_nav a,
.top_links > .top_link,
.index_top_link,
.game_reaction .game_home_btn,
.home-button {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: rgba(229, 231, 235, 0.95);
    text-decoration: none;
    font-family: var(--font-heading, "Outfit", Arial, Helvetica, sans-serif);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    font-weight: 560;
    text-transform: uppercase;
    line-height: 1;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.game_reaction .game_home_btn {
    position: fixed;
    top: 18px;
    left: clamp(4px, 2.2vw, 28px);
    z-index: 30;
    margin: 0;
    min-width: 0;
    width: auto;
}

.menu a .material-symbols-outlined,
.services_page_link .material-symbols-outlined,
.contact_page_link .material-symbols-outlined,
.desktop_quick_nav a .material-symbols-outlined,
.top_links > .top_link .material-symbols-outlined,
.index_top_link .material-symbols-outlined,
.game_reaction .game_home_btn .material-symbols-outlined,
.home-button .material-symbols-outlined {
    font-size: 1em;
    line-height: 1;
    color: currentColor;
    opacity: 0.72;
    transition: opacity 0.2s ease;
}

.menu a:hover,
.services_page_link:hover,
.contact_page_link:hover,
.desktop_quick_nav a:hover,
.top_links > .top_link:hover,
.index_top_link:hover,
.game_reaction .game_home_btn:hover,
.home-button:hover {
    transform: translateY(-1px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.26);
    color: #ffffff;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.09));
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.menu a:hover .material-symbols-outlined,
.services_page_link:hover .material-symbols-outlined,
.contact_page_link:hover .material-symbols-outlined,
.desktop_quick_nav a:hover .material-symbols-outlined,
.top_links > .top_link:hover .material-symbols-outlined,
.index_top_link:hover .material-symbols-outlined,
.game_reaction .game_home_btn:hover .material-symbols-outlined,
.home-button:hover .material-symbols-outlined {
    opacity: 1;
}

/* Active navigation item */
.desktop_quick_nav a[aria-current="page"],
.menu a[aria-current="page"],
.services_page_link[aria-current="page"],
.contact_page_link[aria-current="page"],
body.services_page .desktop_quick_nav a[href$="services.html"],
body.tools-page .desktop_quick_nav a[href$="tools.html"],
body.tool-subpage .desktop_quick_nav a[href$="tools.html"],
body.games-page .desktop_quick_nav a[href$="games.html"],
body.contact_page .desktop_quick_nav a[href$="kontakt.html"],
body.services_page .services_page_link[href$="services.html"],
body.tools-page .menu a[href$="tools.html"],
body.games-page .menu a[href$="games.html"],
body.contact_page .contact_page_link[href$="kontakt.html"] {
    border-color: rgba(147, 197, 253, 0.52);
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.34), rgba(59, 130, 246, 0.18));
    color: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 8px 20px rgba(16, 24, 40, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.desktop_quick_nav a[aria-current="page"] .material-symbols-outlined,
.menu a[aria-current="page"] .material-symbols-outlined,
.services_page_link[aria-current="page"] .material-symbols-outlined,
.contact_page_link[aria-current="page"] .material-symbols-outlined,
body.services_page .desktop_quick_nav a[href$="services.html"] .material-symbols-outlined,
body.tools-page .desktop_quick_nav a[href$="tools.html"] .material-symbols-outlined,
body.tool-subpage .desktop_quick_nav a[href$="tools.html"] .material-symbols-outlined,
body.games-page .desktop_quick_nav a[href$="games.html"] .material-symbols-outlined,
body.contact_page .desktop_quick_nav a[href$="kontakt.html"] .material-symbols-outlined,
body.services_page .services_page_link[href$="services.html"] .material-symbols-outlined,
body.tools-page .menu a[href$="tools.html"] .material-symbols-outlined,
body.games-page .menu a[href$="games.html"] .material-symbols-outlined,
body.contact_page .contact_page_link[href$="kontakt.html"] .material-symbols-outlined {
    opacity: 1;
}

/* Startpage quick nav buttons (visual sync only; behavior stays in page CSS/JS) */
#quick_nav .quick_nav_toggle,
#quick_nav .quick_nav_item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.36rem;
    min-width: 0;
    min-height: 0;
    width: auto;
    padding: 0.4rem 0.66rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: rgba(236, 240, 246, 0.98);
    font-family: var(--font-heading, "Outfit", Arial, Helvetica, sans-serif);
    font-size: 0.7rem;
    letter-spacing: 0.028em;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.06;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#quick_nav .quick_nav_menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.42rem;
    width: max-content;
    min-width: 162px;
    max-width: min(208px, calc(100vw - 40px));
    margin: 0;
    padding: 0.38rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(8, 12, 18, 0.9), rgba(14, 20, 28, 0.84));
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    overflow: hidden;
}

#quick_nav.open .quick_nav_menu {
    display: flex;
}

#quick_nav .quick_nav_item_icon {
    font-size: 0.96rem !important;
    color: currentColor;
    opacity: 0.84;
    text-shadow: none;
    transition: opacity 0.2s ease;
}

#quick_nav .quick_nav_item_label {
    font-size: 0.67rem;
    letter-spacing: 0.012em;
    text-transform: uppercase;
    font-family: var(--font-heading, "Outfit", Arial, Helvetica, sans-serif);
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}

#quick_nav .quick_nav_item {
    width: 100%;
    max-width: 100%;
    min-width: 148px;
    justify-content: flex-start;
    gap: 0.16rem;
    padding: 0.33rem 0.38rem;
}

#quick_nav .quick_nav_item[aria-current="page"] {
    border-color: rgba(147, 197, 253, 0.52);
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.34), rgba(59, 130, 246, 0.18));
    color: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 8px 20px rgba(16, 24, 40, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

#quick_nav .quick_nav_item[aria-current="page"] .quick_nav_item_icon {
    opacity: 1;
}

#quick_nav .quick_nav_toggle:hover,
#quick_nav .quick_nav_item:hover {
    transform: translateY(-1px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.26);
    color: #ffffff;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.09));
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

#quick_nav .quick_nav_toggle:hover .quick_nav_item_icon,
#quick_nav .quick_nav_item:hover .quick_nav_item_icon {
    opacity: 1;
}

@media (max-width: 1024px) {
    .game_reaction .game_home_btn,
    .home-button,
    #quick_nav .quick_nav_toggle,
    #quick_nav .quick_nav_item {
        flex: 0 0 auto;
        gap: 0.24rem;
        padding: 0.34rem 0.5rem;
        border-radius: 10px;
        font-size: 0.61rem;
        letter-spacing: 0.03em;
        white-space: nowrap;
    }

    #quick_nav .quick_nav_toggle {
        gap: 0.28rem;
        padding: 0.42rem 0.66rem;
        border-radius: 11px;
        font-size: 0.64rem;
        letter-spacing: 0.04em;
    }

    .game_reaction .game_home_btn {
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + 8px);
        left: calc(env(safe-area-inset-left, 0px) + 8px);
        z-index: 70;
        margin: 0;
    }

    .site_lang_toggle {
        top: calc(env(safe-area-inset-top, 0px) + 8px);
        right: calc(env(safe-area-inset-right, 0px) + 8px);
        min-width: 118px;
        padding: 0.36rem 0.62rem;
        border-radius: 10px;
        font-size: 0.56rem;
    }

    .site_lang_toggle_values {
        font-size: 0.72rem;
    }

    #quick_nav {
        top: calc(env(safe-area-inset-top, 0px) + 8px);
        left: calc(env(safe-area-inset-left, 0px) + 8px);
        z-index: 71;
    }

    #quick_nav .quick_nav_menu {
        top: calc(100% + 6px);
        left: 0;
        gap: 0.34rem;
        width: max-content;
        min-width: 0;
        max-width: min(260px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 20px));
        padding: 0.3rem;
        align-items: center;
    }

    #quick_nav .quick_nav_item_label {
        font-size: 0.64rem;
        letter-spacing: 0.014em;
    }

    #quick_nav .quick_nav_item_icon {
        font-size: 0.88rem !important;
    }

    #quick_nav .quick_nav_item {
        width: 190px;
        min-width: 190px;
        max-width: 100%;
        align-self: center;
    }

}
