/* account.css -- MyBest24 User Account UI
   Matches existing design tokens from styles.css
   Load after styles.css and auth.css
*/

/* ── WIDGET CONTAINER ────────────────────────────────────────────────────── */

#account-widget {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 12px;
}

/* ── AVATAR TRIGGER BUTTON ───────────────────────────────────────────────── */

.account-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.account-trigger:hover {
    opacity: 0.85;
    box-shadow: 0 0 0 2px var(--accent-color);
    border-radius: 50%;
}

.account-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* ── AVATAR VARIANTS ─────────────────────────────────────────────────────── */

.account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

/* Google profile photo */
.account-avatar-img {
    object-fit: cover;
    border: 1px solid var(--box-border);
}

/* Initials fallback — matches accent color scheme */
.account-avatar-initials {
    background: var(--accent-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* ── DROPDOWN ────────────────────────────────────────────────────────────── */

.account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--bg-panel);
    border: 1px solid var(--box-border);
    border-radius: 10px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(70, 165, 206, 0.06);
    z-index: 500;
    overflow: hidden;

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

.account-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ── DROPDOWN USER INFO ──────────────────────────────────────────────────── */

.account-dropdown-user {
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.account-dropdown-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-dropdown-email {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── DIVIDER ─────────────────────────────────────────────────────────────── */

.account-dropdown-divider {
    height: 1px;
    background: var(--box-border);
    margin: 0;
}

/* ── DROPDOWN ITEMS ──────────────────────────────────────────────────────── */

.account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.account-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Sign out gets a subtle red tint on hover */
.account-dropdown-item:last-child:hover {
    color: #ff6b6b;
}

.account-dropdown-icon {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* ── MOBILE ──────────────────────────────────────────────────────────────── */

@media (max-width: 800px) {
    .account-avatar {
        width: 28px;
        height: 28px;
    }

    .account-dropdown {
        width: 200px;
    }
}