/* ============================================
   THEME VARIABLES & USER HEADER STYLES
   ============================================ */

/* Theme Variables */
:root {
    /* Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --accent: #667eea;
    --accent-hover: #5568d3;
}


/* User Info in Header */
.nav__user {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding: 8px 12px;
    border-radius: 50px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav__user:hover {
    background: var(--bg-tertiary);
    box-shadow: 0 2px 8px var(--shadow);
}

.nav__user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.avatar__icon {
    font-size: 20px;
}

.nav__user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav__user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.nav__user-email {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.nav__user-menu-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.nav__user-menu-btn:hover {
    color: var(--text-primary);
}

.nav__user-menu-btn svg {
    transition: transform 0.3s ease;
}

.nav__user.active .nav__user-menu-btn svg {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.nav__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.nav__dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav__dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav__dropdown-item:hover {
    background: var(--bg-secondary);
}

.nav__dropdown-item span:first-child {
    font-size: 18px;
}

.nav__dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.nav__dropdown-item--danger {
    color: #ef4444;
}

.nav__dropdown-item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Avatar Selector Grid */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.avatar-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.avatar-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-md);
}

.avatar-option.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

/* Goals System Styles */
.goal-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.goal-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
}

.goal-card__header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.goal-card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.goal-card__type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    color: var(--accent);
}

.goal-card__progress {
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.goal-card__stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.goal-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.goal-card__actions .btn {
    font-size: 12px;
    padding: 6px 12px;
}

/* Melhorar botão Salvar Avatar */
#save-avatar-btn,
.modal .btn-large {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, hsl(240, 60%, 60%) 0%, hsl(250, 55%, 65%) 100%) !important;
    color: white !important;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px hsla(240, 60%, 60%, 0.3);
    margin: 1.5rem 0;
}

#save-avatar-btn:hover,
.modal .btn-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px hsla(240, 60%, 60%, 0.5);
}

/* Melhorar seção de informações do perfil */
.profile__info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px solid #e5e7eb;
    margin-top: 2rem;
}

.profile__info h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: hsl(240, 60%, 60%);
    font-weight: 700;
}

.profile__field {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.profile__field:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.profile__field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.profile__field p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Título "Escolha seu Avatar" */
.profile__current-avatar h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5rem 0 1rem 0;
    text-align: center;
}

/* Avatar central (display atual do usuário) */
#profile-avatar-display.avatar-display {
    width: 120px;
    height: 120px;
    font-size: 5rem;
    border: 5px solid hsl(240, 60%, 60%);
    margin: 1rem auto;
    box-shadow: 0 10px 30px hsla(240, 60%, 60%, 0.25);
}


/* Theme Transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .nav__user-info {
        display: none;
    }

    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .avatar-option {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
}