:root {
    --platea-bg: #0e0e0e;
    --platea-primary: #ba9eff;
    --platea-primary-dim: #8455ef;
    --platea-secondary: #f8a010;
    --platea-secondary-dim: #e79400;
    --platea-surface-container-low: rgba(255, 255, 255, 0.04);
    --platea-surface-container: rgba(255, 255, 255, 0.06);
    --platea-surface-container-high: rgba(255, 255, 255, 0.09);
    --platea-surface-container-highest: rgba(255, 255, 255, 0.13);
    --platea-ghost-border: rgba(255, 255, 255, 0.09);
    --platea-glass-stroke: rgba(255, 255, 255, 0.12);
    --platea-shadow-violet: rgba(132, 85, 239, 0.26);
    --platea-shadow-gold: rgba(248, 160, 16, 0.16);
    --platea-text-primary: #f7f2ff;
    --platea-text-muted: rgba(247, 242, 255, 0.68);
    --platea-text-soft: rgba(247, 242, 255, 0.44);
    --platea-font-ui: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --platea-font-editorial: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --platea-navbar-height: 5.5rem;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 420;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "logo nav search actions";
    align-items: center;
    column-gap: 1.1rem;
    row-gap: 1rem;
    min-height: var(--platea-navbar-height);
    padding: 1rem 2rem;
    overflow: visible;
    background: #141414;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.navbar::after {
    content: "";
    position: absolute;
    right: 1.5rem;
    bottom: 0;
    left: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(186, 158, 255, 0.3), rgba(255, 255, 255, 0));
    opacity: 0.7;
    pointer-events: none;
}

.navbar-logo {
    grid-area: logo;
    color: var(--platea-primary);
    text-decoration: none;
    font-family: var(--platea-font-ui);
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    transition: color 0.18s ease, transform 0.18s ease;
}

.navbar-logo:hover {
    color: #9155ff;
    transform: translateY(-1px);
}

.navbar-nav {
    grid-area: nav;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1.35rem;
    min-width: auto;
    margin: 0 0 0 1.1rem;
    padding: 0;
    list-style: none;
    justify-self: start;
}

.navbar-link {
    position: relative;
    color: var(--platea-text-muted);
    text-decoration: none;
    font-family: var(--platea-font-ui);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: color 0.18s ease;
}

.navbar-link::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -0.45rem;
    left: 0;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(186, 158, 255, 0), rgba(186, 158, 255, 0.95), rgba(186, 158, 255, 0));
    opacity: 0;
    transform: scaleX(0.6);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.navbar-link:hover,
.navbar-link-active {
    color: var(--platea-text-primary);
}

.navbar-link-active {
    text-shadow: 0 0 14px rgba(186, 158, 255, 0.18);
}

.navbar-link:hover::after,
.navbar-link-active::after {
    opacity: 1;
    transform: scaleX(1);
}

.navbar-link-active::after {
    background: linear-gradient(90deg, rgba(186, 158, 255, 0), rgba(186, 158, 255, 1), rgba(186, 158, 255, 0));
    box-shadow: 0 0 16px rgba(186, 158, 255, 0.22);
}

.navbar-link-disabled {
    color: var(--platea-text-soft);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.55;
    user-select: none;
}

.navbar-link-disabled::after {
    display: none;
}

.navbar-search {
    grid-area: search;
    justify-self: center;
    width: min(100%, 30rem);
    min-width: 0;
}

.navbar-actions {
    grid-area: actions;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    min-width: 0;
}

.navbar-auth {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.navbar-auth-link {
    color: var(--platea-text-muted);
    text-decoration: none;
    font-family: var(--platea-font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.18s ease;
}

.navbar-auth-link:hover,
.navbar-logout-button:hover {
    color: var(--platea-text-primary);
}


.navbar .search-form-navbar,
.navbar .search-form-navbar.search-form-expanded {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/*
 * Notification bell styles.
 * Kept here (instead of a separate stylesheet) to avoid late-loading <link>
 * tags inside the <body>, which can cause visible repaints/flicker in Chrome.
 */
.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
}

.notif-bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.notif-bell-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.notif-bell-icon {
    width: 1.35rem;
    height: 1.35rem;
    pointer-events: none;
}

.notif-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e50914;
    border: 2px solid #000;
    display: none;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 320px;
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 500;
    overflow: hidden;
    display: none;
}

.notif-dropdown.is-open {
    display: block;
}

.notif-dropdown-header {
    padding: 0.9rem 1rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.8);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item-unseen {
    background: rgba(186, 158, 255, 0.07);
    color: #fff;
}

.notif-item-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.notif-item-link:hover {
    color: #7c3aed;
}

.notif-empty,
.notif-loading {
    padding: 1.2rem 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.notif-view-all {
    display: none;
    text-align: center;
    padding: 0.6rem 1rem 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.notif-view-all a {
    font-size: 0.8rem;
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.notif-view-all a:hover {
    text-decoration: underline;
}

.btn.navbar-submit-button {
    margin-left: auto;
}

.btn.navbar-register-button {
    min-width: 7.2rem;
    margin-left: 0;
}

/* ── Avatar + Dropdown ─────────────────────────────────── */

.navbar-user-menu {
    position: relative;
}

.navbar-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--platea-surface-container-low);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    flex-shrink: 0;
}

.navbar-user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.navbar-user-btn:hover {
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 0 0 3px rgba(186,158,255,0.18);
    transform: scale(1.05);
}

.navbar-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    min-width: 200px;
    background: #1a1a24;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.55);
    overflow: hidden;
    z-index: 500;
}

.navbar-user-dropdown.is-open {
    display: block;
}

.navbar-dropdown-header {
    padding: 0.9rem 1.1rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.navbar-dropdown-username {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--platea-text-primary);
}

.navbar-dropdown-email {
    display: block;
    font-size: 0.72rem;
    color: var(--platea-text-soft);
    margin-top: 0.15rem;
    word-break: break-all;
}

.navbar-dropdown-list {
    padding: 0.4rem 0;
}

.navbar-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.65rem 1.1rem;
    background: transparent;
    border: none;
    color: var(--platea-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    letter-spacing: 0;
}

.navbar-dropdown-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--platea-text-primary);
}

.navbar-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0.35rem 0;
}

.navbar-dropdown-item-danger {
    color: #f87171;
}

.navbar-dropdown-item-danger:hover {
    background: rgba(248,113,113,0.08);
    color: #fca5a5;
}

@media (max-width: 1120px) {
    .navbar {
        grid-template-columns: auto auto 1fr;
        grid-template-areas:
            "logo nav actions"
            "search search search";
        row-gap: 1rem;
        min-height: auto;
    }

    .navbar-nav {
        justify-content: flex-start;
        gap: 1.35rem;
        margin-left: 1.1rem;
    }

    .navbar-actions {
        justify-content: flex-end;
    }

    .navbar-search {
        width: min(100%, 32rem);
    }
}

@media (max-width: 768px) {
    .navbar {
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "nav"
            "search"
            "actions";
        gap: 0.9rem;
        padding: 0.95rem 1rem 1rem;
    }

    .navbar::after {
        right: 1rem;
        left: 1rem;
    }

    .navbar-logo {
        font-size: 1.45rem;
    }

    .navbar-nav {
        justify-content: space-between;
        gap: 0.85rem;
        flex-wrap: wrap;
        margin-left: 0;
    }

    .navbar-link {
        font-size: 0.68rem;
        letter-spacing: 0.14em;
    }

    .navbar-search {
        width: 100%;
    }

    .navbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .navbar-submit-button {
        width: 100%;
    }

    .btn.navbar-submit-button {
        min-height: 2.9rem;
        margin-left: 0;
    }

    .btn.navbar-register-button {
        width: 100%;
    }

    .navbar-auth {
        width: 100%;
        justify-content: stretch;
    }

    .navbar-auth-link {
        width: 100%;
        display: inline-flex;
        justify-content: center;
    }
}

/* ── Language switcher (top-right pill in navbar-auth) ─────────────── */

.navbar-locale {
    position: relative;
    display: inline-flex;
}

.navbar-locale-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--platea-text-muted, rgba(247, 242, 255, 0.78));
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.navbar-locale-btn:hover,
.navbar-locale-btn:focus-visible {
    background: rgba(186, 158, 255, 0.12);
    border-color: rgba(186, 158, 255, 0.32);
    color: #fff;
    outline: none;
}

.navbar-locale-icon {
    width: 16px;
    height: 16px;
    color: rgba(186, 158, 255, 0.88);
    flex-shrink: 0;
}

.navbar-locale-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
}

.navbar-locale-chevron {
    width: 12px;
    height: 12px;
    color: rgba(247, 242, 255, 0.62);
    transition: transform 0.18s ease;
    flex-shrink: 0;
}

.navbar-locale-btn[aria-expanded="true"] .navbar-locale-chevron {
    transform: rotate(180deg);
}

.navbar-locale-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 9rem;
    padding: 0.35rem;
    background: #1a1620;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    z-index: 500;
}

.navbar-locale-dropdown.is-open {
    display: flex;
}

.navbar-locale-option {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: rgba(247, 242, 255, 0.82);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.13s ease, color 0.13s ease;
}

.navbar-locale-option:hover,
.navbar-locale-option:focus-visible {
    background: rgba(186, 158, 255, 0.12);
    color: #fff;
    outline: none;
}

.navbar-locale-option.is-active {
    background: rgba(186, 158, 255, 0.18);
    color: var(--platea-primary, #ba9eff);
}
