/* ============================================================
   profile.css — Profile dialog, avatar, stats, referral system
   ============================================================ */

/* PERFIL */
.profile-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(240, 192, 64, 0.2);
}

.profile-avatar {
    font-size: 48px;
    margin-bottom: 8px;
}

.profile-avatar-name-container {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.profile-avatar-name {
    color: #f0c040;
    font-size: 20px;
    font-weight: bold;
}

.edit-avatar-btn {
    background: rgba(240, 192, 64, 0.15);
    border: 1px solid rgba(240, 192, 64, 0.3);
    color: #f0c040;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.edit-avatar-btn:hover {
    background: rgba(240, 192, 64, 0.25);
    border-color: #f0c040;
    transform: scale(1.1);
}

.profile-uid {
    color: #555;
    font-size: 10px;
    margin-top: 4px;
    font-family: monospace;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.profile-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.profile-stat-card .stat-icon {
    font-size: 22px;
    display: block;
    margin-bottom: 4px;
}

.profile-stat-card .stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #f0c040;
}

.profile-stat-card .stat-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.profile-section-title {
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.profile-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-row-label {
    color: #888;
    font-size: 12px;
}

.profile-row-value {
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 500;
}

/* SISTEMA DE INDICACAO */
.referral-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(240, 192, 64, 0.3);
    border-radius: 8px;
}

.referral-section h4 {
    color: #F0C040;
    margin-bottom: 10px;
    font-size: 16px;
}

.referral-description {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 15px;
}

.referral-code-box,
.referral-link-box {
    margin-bottom: 15px;
}

.referral-code-box label,
.referral-link-box label {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 5px;
}

.referral-code-display,
.referral-link-display {
    display: flex;
    gap: 10px;
    align-items: center;
}

#referral-code-text {
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    color: #F0C040;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    flex: 1;
    text-align: center;
}

#referral-link-input {
    width: 100%;
    flex: 1;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(240, 192, 64, 0.3);
    border-radius: 4px;
    color: #F0C040;
    font-size: 12px;
}

.copy-btn {
    padding: 8px 12px;
    background: rgba(240, 192, 64, 0.2);
    border: 1px solid rgba(240, 192, 64, 0.4);
    border-radius: 4px;
    color: #F0C040;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.copy-btn:hover {
    background: rgba(240, 192, 64, 0.3);
}

/* Dialog de Stats de Indicacao */
#referral-stats-dialog-overlay {
    background: transparent;
    z-index: 150;
}

#referral-stats-dialog {
    min-width: 350px;
    max-width: 500px;
}


#referral-stats-dialog h4 {
    color: #F0C040;
    margin: 20px 0 10px 0;
    font-size: 14px;
}

.referral-stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
    width: 100%;
}

#referral-stats-inner {
    width: 100%;
}

.stat-box {
    text-align: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(240, 192, 64, 0.2);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #aaa;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.stat-value.gold {
    color: #F0C040;
}

.referral-user-list {
    margin-top: 15px;
}

.referral-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(240, 192, 64, 0.2);
}

.referral-user-name {
    font-weight: bold;
    color: #fff;
}

.referral-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-eligible {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-pending {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.empty-state {
    text-align: center;
    color: #aaa;
    margin: 30px 0;
}

/* Dialog de Ranking de Indicacao */
#referral-ranking-dialog-overlay {
    z-index: 150;
}

#referral-ranking-dialog {
    margin: 0;
    min-width: 350px;
    max-width: 500px;
}


.ranking-list {
    margin-top: 15px;
}

.ranking-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(240, 192, 64, 0.2);
    transition: all 0.3s;
}

.ranking-card:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(240, 192, 64, 0.4);
}

.ranking-card.highlight-user {
    background: rgba(240, 192, 64, 0.1);
    border: 2px solid rgba(240, 192, 64, 0.5);
}

.ranking-position {
    font-size: 18px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.ranking-position.gold {
    color: #FFD700;
}

.ranking-position.silver {
    color: #C0C0C0;
}

.ranking-position.bronze {
    color: #CD7F32;
}

.ranking-name {
    flex: 1;
    color: #fff;
    font-weight: 500;
}

.ranking-count {
    color: #F0C040;
    font-size: 14px;
    font-weight: bold;
}

/* DIALOGO DE EDITAR AVATAR */
#edit-avatar-dialog-overlay {
    background: transparent;
}

#edit-avatar-dialog {
    margin: 0;
    min-width: 100px;
    max-width: 420px;
}

#edit-avatar-dialog h3 {
    text-align: center;
}

.edit-avatar-info {
    background: rgba(240, 192, 64, 0.1);
    border: 1px solid rgba(240, 192, 64, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.edit-avatar-info p {
    margin: 4px 0;
    color: #ccc;
    font-size: 14px;
}

.edit-avatar-form label {
    display: block;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 8px;
}

.edit-avatar-form input {
    width: 100%;
    box-sizing: border-box;
}

.edit-avatar-form input[readonly] {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    cursor: not-allowed;
}

/* Mobile: Profile stats grid */
@media (max-width: 768px) {
    /* Grid de estatisticas do perfil mais compacta */
    .profile-stats-grid {
        gap: 6px;
        margin-bottom: 12px;
    }

    .profile-stat-card {
        padding: 8px;
        border-radius: 8px;
    }

    .profile-stat-card .stat-icon {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .profile-stat-card .stat-value {
        font-size: 16px;
    }

    .profile-stat-card .stat-label {
        font-size: 9px;
    }
}
