/* ==========================================
   VARIÁVEIS OFICIAIS E CONFIGURAÇÃO
   ========================================== */
:root {
    --bg-dark-blue: #090e17; /* Azul-escuro petroleum de fundo */
    --orange-primary: #fe8d04; /* Laranja oficial Eilish+ */
    --orange-hover: #e07b03;
    --text-white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(10, 15, 25, 0.7); /* Vidro escuro */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-input: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark-blue);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
}

/* ==========================================
   EFEITOS DE FUNDO (AMBIÊNCIA E DEGRADÊ)
   ========================================== */
.profile-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(9, 14, 23, 1) 0%, rgba(5, 7, 12, 1) 90%);
    z-index: -2;
}

.profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Brilho laranja e azul muito sutil flutuando no fundo */
    background: radial-gradient(circle at 80% 90%, rgba(254, 141, 4, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 20% 10%, rgba(0, 168, 204, 0.03) 0%, transparent 50%);
    z-index: -1;
}

/* ==========================================
   ESTRUTURA E CONTAINER PRINCIPAL
   ========================================== */
.profile-container {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    padding: 30px 16px;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Cabeçalho */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: var(--orange-primary);
}

.btn-back svg {
    transition: transform 0.2s ease;
}

.btn-back:hover svg {
    transform: translateX(-3px);
}

/* Altura Padrão de 90px em todos os dispositivos */
.profile-logo {
    height: 90px;
    width: auto;
    object-fit: contain;
}

/* ==========================================
   NAVEGAÇÃO DE ABAS (TABS) - REESTRUTURADO E MAIS FINO
   ========================================== */
.profile-tabs {
    display: flex;
    gap: 6px; /* Espaço sutil entre abas */
    margin-top: 50px; /* Aumenta a distância para as abas rodarem mais para baixo do cabeçalho */
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px; /* Mais fina: reduzido de 6px para 4px */
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

/* Botões da Aba - Mais Finos e Menos Robustos */
.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px 10px; /* Mais fina: reduzido padding vertical de 12px para 8px */
    color: var(--text-muted);
    font-size: 0.8rem; /* Reduzido levemente para um visual clean e delicado */
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    white-space: nowrap;
}

.tab-btn svg {
    width: 14px; /* Ícones ligeiramente menores para acompanhar a delicadeza */
    height: 14px;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--orange-primary);
    background: rgba(254, 141, 4, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Visibilidade das Abas */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* ==========================================
   CARD DE VIDRO (GLASS CARD)
   ========================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 
                inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* Seção de Avatar */
.avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.profile-avatar-large {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--orange-primary);
    box-shadow: 0 4px 15px rgba(254, 141, 4, 0.25);
}

.avatar-info h2 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

/* Badges de Status da Conta (Email, Google e SMS) */
.badge-status {
    display: inline-block;
    background: rgba(254, 141, 4, 0.15);
    color: var(--orange-primary);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.badge-status.badge-google {
    background: rgba(66, 133, 244, 0.18);
    color: #4285f4;
}

.badge-status.badge-phone {
    background: rgba(254, 141, 4, 0.18);
    color: #fe8d04;
}

/* Títulos das Seções */
.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.sub-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 16px;
}

.card-divider {
    border: none;
    height: 1px;
    background: var(--glass-border);
    margin: 28px 0;
}

/* ==========================================
   INPUTS E FORMULÁRIOS
   ========================================== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.input-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-white);
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--orange-primary);
    box-shadow: 0 0 10px rgba(254, 141, 4, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

/* Inputs desativados */
input:disabled {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

/* Aviso para convidados */
.warning-text {
    font-size: 0.85rem;
    color: #ffcc00;
    background: rgba(255, 204, 0, 0.08);
    border: 1px solid rgba(255, 204, 0, 0.15);
    padding: 14px;
    border-radius: 10px;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* ==========================================
   BOTÕES DE AÇÃO
   ========================================== */
.btn-primary {
    width: 100%;
    background: var(--orange-primary);
    color: var(--text-white);
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: var(--orange-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: rgba(254, 141, 4, 0.5);
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(254, 141, 4, 0.1);
    border-color: var(--orange-primary);
    color: var(--orange-primary);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   ANIMAÇÃO DE ENTRADA
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   ESTILOS SUPORTE PARA SELEÇÃO DE AVATAR
   ========================================== */

/* Interação e hover para abrir o modal de seleção */
.avatar-wrapper {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid var(--orange-primary);
    box-shadow: 0 4px 15px rgba(254, 141, 4, 0.25);
    transition: transform 0.2s ease;
}

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

.avatar-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.avatar-edit-overlay svg {
    color: #ffffff;
}

/* Modal de Seleção de Avatares */
.avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    z-index: 9999;
    padding: 16px;
}

.avatar-modal.active {
    opacity: 1;
    visibility: visible;
}

.avatar-modal-content {
    background: rgba(15, 22, 36, 0.95);
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.avatar-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
}

.avatar-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.avatar-modal-close:hover {
    color: #ff3b30;
}

.avatar-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Barra de rolagem personalizada e limpa */
.avatar-modal-body::-webkit-scrollbar {
    width: 6px;
}
.avatar-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}
.avatar-modal-body::-webkit-scrollbar-thumb {
    background: rgba(254, 141, 4, 0.3);
    border-radius: 4px;
}
.avatar-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--orange-primary);
}

.avatar-category-section {
    margin-bottom: 28px;
}

.avatar-category-section:last-child {
    margin-bottom: 0;
}

.avatar-category-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    border-left: 3px solid var(--orange-primary);
    padding-left: 8px;
}

/* Grid de Exibição com corte automático inteligente */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.avatar-option {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    border: 3.5px solid transparent;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.02);
}

.avatar-option:hover {
    transform: scale(1.05);
    border-color: rgba(254, 141, 4, 0.5);
}

.avatar-option.selected {
    border-color: var(--orange-primary);
    box-shadow: 0 0 15px rgba(254, 141, 4, 0.4);
    transform: scale(1.03);
}

.avatar-img-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Ícone de confirmação da seleção */
.avatar-option.selected::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--orange-primary);
    color: #ffffff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* Força o corte correto da foto exibida no círculo do perfil */
#profile-avatar-display {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}
