/* ============================================================
   auth.css — CodeByTushu LeetCode Auth Modal & Nav User Widget
   Gold: #ffc400 | Black + White design system
   ============================================================ */

/* ─── Page lock when not logged in ─────────────────────────── */
.cbt-content-locked {
    pointer-events: none;
    user-select: none;
}

/* ─── Backdrop ──────────────────────────────────────────────── */
#cbt-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cbt-fade-in 0.35s ease;
}

@keyframes cbt-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Modal Card ────────────────────────────────────────────── */
.cbt-auth-modal {
    background: linear-gradient(145deg, #16161c, #0d0d10);
    border: 1px solid rgba(255, 196, 0, 0.25);
    border-radius: 24px;
    padding: 48px 44px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    position: relative;
    box-shadow:
        0 0 0 1px rgba(255,196,0,0.08),
        0 30px 80px rgba(0,0,0,0.6),
        0 0 60px rgba(255,196,0,0.05);
    animation: cbt-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cbt-slide-up {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ─── Lock Icon Ring ────────────────────────────────────────── */
.cbt-lock-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 196, 0, 0.1);
    border: 2px solid rgba(255, 196, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    animation: cbt-pulse-ring 2.5s ease-in-out infinite;
}

@keyframes cbt-pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,196,0,0.3); }
    50%       { box-shadow: 0 0 0 12px rgba(255,196,0,0); }
}

/* ─── Headings ──────────────────────────────────────────────── */
.cbt-auth-modal h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 10px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.cbt-auth-modal h2 span {
    color: #ffc400;
    text-shadow: 0 0 20px rgba(255,196,0,0.35);
}

.cbt-auth-modal .cbt-subtext {
    font-size: 14px;
    color: #888;
    line-height: 1.75;
    margin: 0 0 32px;
    font-family: 'Poppins', sans-serif;
}

.cbt-auth-modal .cbt-subtext strong {
    color: #ccc;
}

/* ─── Divider ───────────────────────────────────────────────── */
.cbt-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: #444;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
}
.cbt-divider::before,
.cbt-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #222;
}

/* ─── Google Sign-In Button ─────────────────────────────────── */
#cbt-google-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #fff;
    color: #111;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#cbt-google-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    background: #f5f5f5;
}

#cbt-google-btn:active { transform: translateY(0); }

#cbt-google-btn .google-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

#cbt-google-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ─── Email/Password Toggle ─────────────────────────────────── */
.cbt-email-toggle {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 6px;
    transition: color 0.2s;
}
.cbt-email-toggle:hover { color: #ffc400; }

/* ─── Email Form ────────────────────────────────────────────── */
#cbt-email-form {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    text-align: left;
}

#cbt-email-form.visible { display: flex; }

#cbt-email-form input {
    width: 100%;
    padding: 13px 16px;
    background: #1a1a20;
    border: 1px solid #2a2a32;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

#cbt-email-form input:focus {
    border-color: rgba(255,196,0,0.5);
}

#cbt-email-form input::placeholder { color: #555; }

/* ─── Email Auth Buttons ────────────────────────────────────── */
.cbt-email-btns {
    display: flex;
    gap: 10px;
}

.cbt-email-btns button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

#cbt-signin-btn {
    background: #ffc400;
    color: #000;
}
#cbt-signin-btn:hover {
    background: #ffd04a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,196,0,0.4);
}

#cbt-signup-btn {
    background: transparent;
    color: #ffc400;
    border: 1.5px solid rgba(255,196,0,0.4) !important;
}
#cbt-signup-btn:hover {
    background: rgba(255,196,0,0.08);
    border-color: rgba(255,196,0,0.7) !important;
    transform: translateY(-2px);
}

/* ─── Error / Info Message ──────────────────────────────────── */
#cbt-auth-msg {
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    min-height: 20px;
    margin-top: 4px;
    transition: all 0.2s;
}
#cbt-auth-msg.error { color: #ff6b6b; }
#cbt-auth-msg.success { color: #69db7c; }

/* ─── Footer Note ───────────────────────────────────────────── */
.cbt-auth-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #1e1e26;
    font-size: 12px;
    color: #444;
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   NAVBAR AUTH WIDGET — Login button & Username dropdown
   ══════════════════════════════════════════════════════════════ */

/* ─── LOGIN CTA BUTTON (guest state) ────────────────────────── */
#cbt-nav-login-btn {
    background: #ffc400;
    color: #000;
    border: none;
    padding: 9px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 14px rgba(255,196,0,0.3);
    white-space: nowrap;
}

#cbt-nav-login-btn:hover {
    background: #ffd04a;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255,196,0,0.5);
}

/* ─── LOGGED-IN USER WIDGET ──────────────────────────────────── */
.cbt-nav-user {
    position: relative;
    display: flex;
    align-items: center;
}

/* Username button */
.cbt-username-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 196, 0, 0.08);
    border: 1.5px solid rgba(255, 196, 0, 0.3);
    border-radius: 10px;
    padding: 7px 14px 7px 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.cbt-username-btn:hover {
    background: rgba(255, 196, 0, 0.15);
    border-color: rgba(255, 196, 0, 0.55);
    box-shadow: 0 4px 18px rgba(255,196,0,0.18);
}

/* User avatar photo */
.cbt-nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 196, 0, 0.6);
    flex-shrink: 0;
}

/* Placeholder initial when no photo */
.cbt-nav-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,196,0,0.15);
    border: 2px solid rgba(255,196,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffc400;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}

/* Chevron down arrow */
.cbt-chevron {
    font-size: 11px;
    color: rgba(255,196,0,0.7);
    transition: transform 0.25s ease;
    margin-left: 2px;
}

.cbt-nav-user.open .cbt-chevron {
    transform: rotate(180deg);
}

/* ─── DROPDOWN PANEL ────────────────────────────────────────── */
.cbt-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 170px;
    background: linear-gradient(145deg, #111116, #0c0c10);
    border: 1px solid rgba(255, 196, 0, 0.2);
    border-radius: 14px;
    padding: 6px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.7),
        0 0 30px rgba(255,196,0,0.06);
    z-index: 99999;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

/* Show dropdown */
.cbt-nav-user.open .cbt-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ─── DROPDOWN ITEMS ────────────────────────────────────────── */
.cbt-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #cccccc;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
    text-align: left;
}

.cbt-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

/* Logout — red tint on hover */
.cbt-dropdown-logout {
    color: #ff7c7c;
    margin-top: 2px;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-radius: 0 0 10px 10px;
    padding-top: 12px;
}

.cbt-dropdown-logout:hover {
    background: rgba(255, 80, 80, 0.1);
    color: #ff6b6b;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .cbt-auth-modal {
        padding: 36px 24px;
        border-radius: 18px;
    }
    .cbt-auth-modal h2 { font-size: 20px; }
    .cbt-email-btns { flex-direction: column; }

    .cbt-username-btn .cbt-username-text {
        display: none; /* on tiny screens show only avatar */
    }
}
