/**
 * Navigation bar styles
 */

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-red);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    list-style: none;
}

/* Language switcher */
.language-form {
    display: flex;
}

.lang-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 2px;
    gap: 2px;
}

.lang-option {
    border: none;
    background: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-option:hover {
    color: var(--text-primary);
}

.lang-option.active {
    background: var(--accent-red);
    color: #fff;
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    background: var(--border-color);
}

.theme-icon-sun {
    display: none;
}

[data-theme="light"] .theme-icon-sun {
    display: inline;
}

[data-theme="light"] .theme-icon-moon {
    display: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

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

.nav-link.btn-primary {
    background: var(--accent-red);
    color: white;
}

.nav-link.btn-primary:hover {
    background: var(--accent-red-hover);
}

.nav-link.btn-outline {
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.nav-link.btn-outline:hover {
    background: var(--accent-red);
    color: white;
}

.btn-upload {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.btn-upload:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.logout-form {
    display: inline;
}

.logout-btn {
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.nav-username {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 12px;
}

/* Hamburger button (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--text-primary);
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile / small tablet: collapse the actions into a dropdown panel */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .nav-toggle {
        display: flex;
    }

    .navbar-actions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    .navbar-actions.open {
        display: flex;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    .navbar-nav li {
        width: 100%;
    }

    .nav-link,
    .nav-username {
        display: block;
        text-align: center;
        padding: 12px 16px;
    }

    .nav-username {
        background: var(--bg-tertiary);
        border-radius: var(--radius-md);
    }

    .logout-form {
        display: block;
        width: 100%;
    }

    .logout-btn {
        width: 100%;
    }

    .lang-toggle {
        align-self: center;
    }

    .language-form {
        justify-content: center;
    }

    .theme-toggle {
        align-self: center;
    }
}
