/**
 * GV Auth – Header Styles
 *
 * Styles pour le dropdown user desktop et le bloc user mobile.
 * À inclure dans le thème (via critical.css, app.css, ou enqueue séparé).
 */

/* ── Desktop : account trigger ── */

.gv-auth-account {
    position: relative;
}

.gv-auth-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
    font-family: inherit;
    font-size: 14px;
    color: inherit;
    line-height: 1;
}

.gv-auth-trigger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.gv-auth-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* Fallback si pas d'avatar : initiale dans un cercle */
.gv-auth-avatar[src=""],
.gv-auth-avatar:not([src]) {
    display: none;
}

.gv-auth-caret {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.gv-auth-trigger[aria-expanded="true"] .gv-auth-caret {
    transform: rotate(180deg);
}

/* ── Desktop : dropdown ── */

.gv-auth-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 6px 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.gv-auth-dropdown-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gv-auth-dropdown-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100%;
    padding: 10px 16px !important;
    font-size: 14px !important;
    color: #333 !important;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background-color 0.1s ease;
    line-height: 1.2 !important;
    white-space: nowrap;
}

.gv-auth-dropdown-item:hover {
    background-color: #f5f5f5;
}

.gv-auth-dropdown-item svg {
    flex-shrink: 0;
    color: #666;
}

.gv-auth-dropdown-logout {
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 12px;
    color: #c00;
}

.gv-auth-dropdown-logout svg {
    color: #c00;
}

/* ── Mobile : user block in sidebar ── */

.gv-auth-mobile-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 15px;
    font-weight: 500;
}

.gv-auth-mobile-user .gv-auth-avatar {
    width: 30px;
    height: 30px;
}

.gv-auth-mobile-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 4px;
}

.gv-auth-mobile-links a,
.gv-auth-mobile-links button {
    display: block !important;
    padding: 4px 0 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    color: #333 !important;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.gv-auth-mobile-links a:hover,
.gv-auth-mobile-links button:hover {
    color: #69A378 !important;
}

.gv-auth-mobile-links button[data-gv-auth="logout-btn"] {
    color: #c00 !important;
    border-top: 1px solid #eee;
    margin-top: 2px;
    padding-top: 6px;
}

/* ── Responsive : masquer username desktop sur petits écrans ── */

@media (max-width: 768px) {
    .gv-auth-account .account-username {
        display: none;
    }
}
