/* ================================================================
   organization-switcher.css
   Auth buttons / user menu state management
   Pure CSS — no inline styles needed.
   ================================================================ */

/* ── Visibility classes ──────────────────────────────────────── */
.nb-hidden {
    display: none !important;
}

/* ── Skeleton loader ─────────────────────────────────────────── */
.nb-skeleton {
    display: block;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #e8e8e8 25%,
        #f5f5f5 50%,
        #e8e8e8 75%
    );
    background-size: 200% 100%;
    animation: nb-shimmer 1.5s ease-in-out infinite;
}

/* ── Skeleton dimension variants (match button sizes) ────────── */
.nb-skeleton--login {
    width: 80px;
    height: 40px;
}
.nb-skeleton--cta {
    width: 130px;
    height: 40px;
}

/* ── Skeleton shimmer keyframes ──────────────────────────────── */
@keyframes nb-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}



/* ── User avatar skeleton (circular, matches profile pic) ───── */
.nb-skeleton--avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* ── Mobile skeleton (full-width, taller) ────────────────────── */
.nb-skeleton--mobile-login {
    width: 100%;
    height: 45px;
    border-radius: 10px;
}
.nb-skeleton--mobile-cta {
    width: 100%;
    height: 48px;
    border-radius: 10px;
}

/* ── Error message ───────────────────────────────────────────── */
#nb-auth-buttons {
    position: relative;
}
.nb-auth-error {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 13px;
    color: #d32f2f;
    white-space: nowrap;
    background: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 10;
}
.nb-auth-error.nb-hidden {
    display: none;
}

/* ── User profile avatar ─────────────────────────────────────── */
#pr-org-user-profile-image {
    border-radius: 50%;
    overflow: hidden;
    width: 40px;
    height: 40px;
    border: 2px solid #2C67FF;
}
#pr-org-user-profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Fade-in for user buttons on success ─────────────────────── */
#nb-user-buttons.nb-visible {
    animation: nb-fade-in 0.3s ease-out;
}

@keyframes nb-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Mobile skeletons are hidden on desktop and vice versa ───── */
@media (min-width: 981px) {
    .nb-skeleton--mobile-login,
    .nb-skeleton--mobile-cta {
        display: none;
    }
}

/* ── User skeleton visible on mobile only ───────────────────── */
@media (max-width: 980px) {
    #nb-user-skeleton {
        display: flex;
        align-items: center;
        margin-left: auto;
    }
}

@media (min-width: 981px) {
    #nb-user-skeleton {
        display: none;
    }
}
