/* ═══════════════════════════════════════════════════════════
   perfil-menu.css
   Menu de perfil no header da home: foto + primeiro nome,
   que abre um dropdown com Meu perfil / Alterar foto /
   Alterar senha / Sair. Em telas pequenas, vira lista dentro
   do menu hambúrguer (ver .profile-mobile).
   ═══════════════════════════════════════════════════════════ */
.profile-menu {
    position: relative;
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.3rem 0.9rem 0.3rem 0.3rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.profile-trigger-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-chevron {
    transition: transform 0.25s ease;
}

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

/* ── Dropdown ── */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 270px;
    background: #fff;
    color: #1f2937;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(30, 10, 60, 0.28);
    padding: 0.5rem;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1100;
}

.profile-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.profile-dropdown-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.7rem 0.9rem;
    border-bottom: 1px solid #ede9fe;
    margin-bottom: 0.4rem;
}

.profile-dropdown-info {
    min-width: 0;
}

.profile-dropdown-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-email {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.profile-dropdown a svg {
    flex-shrink: 0;
    color: #6a3ea7;
}

.profile-dropdown a:hover,
.profile-dropdown a:focus-visible {
    background: #f3e8ff;
    color: #4B2E83;
    outline: none;
}

.profile-dropdown-sep {
    height: 1px;
    background: #ede9fe;
    margin: 0.4rem 0.4rem;
}

.profile-dropdown a.profile-logout,
.profile-dropdown a.profile-logout svg {
    color: #dc2626;
}

.profile-dropdown a.profile-logout:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* ── Mobile (dentro do menu hambúrguer) ── */
.auth-area--mobile .profile-mobile-link {
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.4rem 0.9rem 0.4rem 0.4rem;
}

/* ── Modo escuro ── */
[data-theme="dark"] .profile-dropdown {
    background: #3a2550;
    color: #e8e8f0;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .profile-dropdown-head,
[data-theme="dark"] .profile-dropdown-sep {
    border-color: rgba(255, 255, 255, 0.12);
    background-color: transparent;
}

[data-theme="dark"] .profile-dropdown-sep {
    background-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .profile-dropdown-name { color: #e8e8f0; }
[data-theme="dark"] .profile-dropdown-email { color: #b0a8c0; }
[data-theme="dark"] .profile-dropdown a { color: #e8e8f0; }
[data-theme="dark"] .profile-dropdown a svg { color: #c4a5f5; }

[data-theme="dark"] .profile-dropdown a:hover,
[data-theme="dark"] .profile-dropdown a:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

[data-theme="dark"] .profile-dropdown a.profile-logout,
[data-theme="dark"] .profile-dropdown a.profile-logout svg { color: #fca5a5; }

[data-theme="dark"] .profile-dropdown a.profile-logout:hover {
    background: rgba(220, 38, 38, 0.25);
    color: #fff;
}

[data-theme="dark"] .avatar--lg { border-color: rgba(255, 255, 255, 0.2); }
