/* Topbar navigation bar with logo, site links, and language selector */

/* Fixed top navigation bar */
.topbar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-secondary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    height: 45px;
}

.topbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 45px;
    position: relative;
}

/* Logo centered absolutely, independent of surrounding nav content */
.topbar-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    z-index: 1;
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: 700;
    font-family: 'Google Sans', system-ui, -apple-system, sans-serif;
    transition: opacity 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.logo-text {
    display: inline;
    font-family: 'Google Sans', system-ui, -apple-system, sans-serif;
}

/* Left navigation link group */
.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    z-index: 2;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    font-family: var(--font-family-lang, var(--font-family));
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.nav-links-text {
    display: inline;
}

.nav-links-text:hover {
    opacity: 0.8;
}

/* Right navigation controls container */
.topbar-right {
    display: flex;
    align-items: center;
    z-index: 2;
}

/* Language selector toggle button and dropdown */
.language-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.language-toggle-button {
    background-color: transparent;
    border: 0px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    font-family: var(--font-family-lang, var(--font-family));
}

.language-toggle-button:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
    border-color: var(--border-primary);
}

.language-toggle-button:focus {
    outline: 2px solid var(--text-link);
    outline-offset: 2px;
}

.language-current {
    display: inline-block;
    min-width: 60px;
}

.language-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: transform 0.2s ease;
}

.language-toggle-button:hover .language-icon {
    transform: scale(1.1);
}

/* Responsive: hide nav links on narrow viewports */
@media (max-width: 640px) {
    .nav-link { display: none; }
}