/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                        CONTAINER PRINCIPAL
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
.profile-container-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    background-color: #ffffff;
    font-family: 'Segoe UI', sans-serif;
    padding: 20px;
}

.profile-card-hero {
    background: #fff;
    width: 100%;
    max-width: 1200px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    display: flex;
    overflow: hidden;
    border: 1px solid #fff;
}

@media (max-width: 768px) {
    .profile-card-hero { flex-direction: column; }
    .profile-mascot-area { width: 100% !important; border-right: none; border-bottom: 1px solid #eee; }
    .mascot-full-render { width: min(280px, 80vw); height: min(280px, 80vw); }
    .profile-data-area { padding: 20px; }
    .user-text-info h1 { font-size: 1.5rem; }
    .actions-area { flex-direction: column; }
    .custom-select-wrapper { width: 100%; }
}

/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     COLUNA ESQUERDA (MASCOTE E LAYERS)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
.profile-mascot-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    width: 350px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #eee;
    position: relative;
}

@media (max-width: 768px) {
    .profile-mascot-area { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid #eee; 
    }
}

.mascot-full-render {
    width: 350px;
    height: 350px;
    position: relative;
    z-index: 10;
}

/* Sistema de Layers e Z-Index */
.layer {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.layer.base { z-index: 5; }
#prof-layer-corpo { z-index: 6; }
#prof-layer-acessorios { z-index: 7; }
#prof-layer-exoticos { z-index: 4; }
#prof-layer-cabeca { z-index: 11; }
#prof-container-efeitos { z-index: 3; }

.level-pill {
    background: #2d3436;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: -10px;
    z-index: 20;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 2px solid #fff;
}

/* Botões da Aura */
.aura-controls {
    display: flex; 
    gap: 8px; 
    margin-top: 20px;
    background: #fff; 
    padding: 8px; 
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.aura-btn {
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    border: none; 
    cursor: pointer;
    transition: transform 0.2s;
}

.aura-btn:hover { transform: scale(1.2); }
.aura-btn.purple { background: #8B5CF6; }
.aura-btn.gold { background: #FFD700; }
.aura-btn.red { background: #EF4444; }
.aura-btn.none { 
    background: #f1f2f6; 
    color: #666; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 10px;
}

/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        COLUNA DIREITA (DADOS DO USUÁRIO)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
.profile-data-area {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Header e Foto de Perfil */
.user-header-flex {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 35px;
}

.profile-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.profile-avatar-wrapper:hover {
    transform: scale(1.05);
}

.profile-avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.user-text-info h1 {
    font-size: 2rem;
    color: #2d3436;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.user-header h1 { 
    font-size: 2.2rem; 
    color: #2d3436; 
    margin: 0; 
}

.title-selector-wrapper {
    display: flex; 
    align-items: center; 
    gap: 8px; 
    margin-top: 8px; 
    margin-bottom: 30px;
    background: #fff3cd; 
    color: #856404; 
    padding: 5px 12px; 
    border-radius: 8px;
    width: fit-content;
}

.title-select-clean {
    background: transparent; 
    border: none; 
    font-weight: bold; 
    color: #856404; 
    cursor: pointer; 
    outline: none;
}

.stats-grid-clean {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 600px) { 
    .stats-grid-clean { grid-template-columns: 1fr; } 
}

.stat-box {
    background: #fff; 
    border: 1px solid #f0f0f0;
    padding: 15px; 
    border-radius: 12px;
    display: flex; 
    align-items: center; 
    gap: 15px;
    min-width: 0; 
    transition: transform 0.2s, box-shadow 0.2s;
    height: auto; 
}

.stat-box:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
}

.icon-box {
    width: 45px; 
    height: 45px; 
    border-radius: 10px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.2rem;
}

.icon-box.purple { background: #f3e8ff; color: #8B5CF6; }
.icon-box.green { background: #dcfce7; color: #22c55e; }
.icon-box.red { background: #fee2e2; color: #ef4444; }

.stat-info { 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
    overflow: hidden; 
}

.stat-info .label { 
    font-size: 0.8rem; 
    color: #64748b; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

.stat-info .value { 
    font-size: 1.2rem; 
    color: #0f172a; 
    font-weight: bold;
    white-space: normal; 
    word-break: break-word; 
    line-height: 1.1;
}

.divider { 
    height: 1px; 
    background: #f0f0f0; 
    margin: 20px 0; 
    width: 100%; 
}

/* Ações e Botões */
.actions-area { 
    display: flex; 
    gap: 15px; 
}

.btn-action {
    padding: 12px 24px; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    border: none;
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: all 0.2s;
}

.btn-action.primary { background: #0f172a; color: white; }
.btn-action.primary:hover { background: #334155; }
.btn-action.secondary { background: #f1f5f9; color: #475569; }
.btn-action.secondary:hover { background: #e2e8f0; }

/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   MODAIS DO PERFIL
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
.profile-modal-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 10000; 
}

.profile-modal-card {
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: slideUpProfile 0.3s ease-out;
    text-align: center;
}

.profile-modal-card.error-mode {
    border-top: 5px solid #ef4444;
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.profile-modal-header h2 { 
    margin: 0; 
    font-size: 1.4rem; 
    color: #2d3436; 
}

.profile-close-btn { 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    cursor: pointer; 
    color: #999; 
}

.profile-modal-body input {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    outline: none;
    transition: border 0.2s;
}

.profile-modal-body input:focus { 
    border-color: #0f172a; 
}

.profile-price-tag {
    background: #f0fdf4;
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid #dcfce7;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #166534;
}

.profile-modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.profile-btn-cancel, .profile-btn-confirm {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

.profile-btn-cancel { background: #f1f5f9; color: #64748b; }
.profile-btn-confirm { background: #0f172a; color: white; }
.profile-btn-confirm:hover { background: #334155; }

/* Modal de Erro */
.profile-icon-error { 
    font-size: 3rem; 
    color: #ef4444; 
    margin-bottom: 15px; 
}

.profile-btn-error-close {
    background: #ef4444; 
    color: white;
    border: none; 
    padding: 10px 30px;
    border-radius: 20px; 
    font-weight: bold;
    cursor: pointer; 
    margin-top: 15px;
}

/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        CORREÇÕES ESPECÍFICAS DE ITENS
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
.fix-dark-wings {
    z-index: 9 !important; 
    transform: scale(1.0) translate(-5px, -15px) !important;
    transform-origin: center center !important;
}

.fix-angel-wings {
    z-index: 4 !important;
    transform: scale(1.1) !important;
    transform-origin: center center !important;
}

/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                     ANIMAÇÕES
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
@keyframes pulse-glow { 
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); } 
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 
}

@keyframes spin-slow { 
    0% { transform: translate(-50%, -50%) rotate(0deg); } 
    100% { transform: translate(-50%, -50%) rotate(360deg); } 
}

@keyframes shake-glow { 
    0% { transform: translate(-51%, -51%); } 
    25% { transform: translate(-49%, -49%); } 
    50% { transform: translate(-50%, -50%); } 
    75% { transform: translate(-51%, -49%); } 
    100% { transform: translate(-50%, -50%); } 
}
@keyframes slideUpProfile {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                            (TELA DE CARREGAMENTO)
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */

.profile-card-hero {
    position: relative; 
    overflow: hidden; 
}

.profile-loader-overlay {
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100vw; 
    height: 100vh; 
    background: #ffffff;
    z-index: 99999; 
    display: flex;
    justify-content: center;
    align-items: center;  
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.profile-loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loader-content .spinner {
    width: 50px; 
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3b82f6;
    border-radius: 50%;
    animation: spinProfile 1s linear infinite;
}

.loader-content p {
    font-family: 'Poppins', sans-serif; 
    color: #64748b;
    font-weight: 600;
    font-size: 1rem;
    animation: pulseProfile 1.5s infinite ease-in-out;
    margin: 0;
}

@keyframes spinProfile {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseProfile {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            CUSTOM SELECT (TÍTULOS DO PERFIL)
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 280px; /* Largura do botão */
    margin-top: 8px;
    font-family: inherit;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.custom-select-trigger:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.selected-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.custom-select-trigger .arrow {
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

/* Quando o menu está aberto */
.custom-select-wrapper.open .custom-select-trigger {
    border-color: #6366f1; /* Cor primária do Codin */
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-select-wrapper.open .arrow {
    transform: rotate(180deg);
}

/* A Caixinha com a lista */
.custom-options-container {
    position: absolute;
    top: 115%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    overflow: hidden;
}

.custom-select-wrapper.open .custom-options-container {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Os itens da lista */
.custom-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    color: #475569;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover, .custom-option.selected {
    background: #f8fafc;
    color: #1e293b;
}

.custom-option i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}