/* ============================================
   Profilsida – stilar
   ============================================ */

/* Outer wrapper */
.profile-container {
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* Gold-frame cards within the profile get bottom spacing */
.profile-container > .gold-frame {
    margin-bottom: 2rem;
}

/* ---- Profile header ---- */
.profile-header-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Change-picture button */
.profile-picture-container .btn {
    margin-top: 0.5rem;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
}

/* Avatar with progress ring */
.profile-avatar-ring-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
}

.profile-avatar-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 130px;
    height: 130px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
    display: block;
    position: absolute;
    top: 5px;
    left: 5px;
}

/* Name row with level badge */
.profile-name-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 12px;
    padding: 0.2rem 0.65rem;
    white-space: nowrap;
}

.profile-level-badge:empty {
    display: none;
}

/* Info column (right of avatar) */
.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.profile-email {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
}

/* ---- Profile form ---- */
.profile-form {
    margin-top: 1.5rem;
}

.profile-form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: 'Cinzel', serif;
}

/* Make inputs fill the form column */
#profileDisplayNameInput,
#profileBioInput {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    font-family: 'Crimson Text';
}

/* ---- Newsletter consent ---- */
.profile-newsletter-box {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
}

/* Override auth-form input styles for the newsletter checkbox */
.auth-form .profile-newsletter-checkbox {
    width: 18px;
    height: 18px;
    padding: 0;
    margin-bottom: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.profile-newsletter-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.profile-newsletter-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--accent-gold);
}

.profile-newsletter-text {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.profile-newsletter-benefits {
    margin: 0.5rem 0 0.25rem 2rem;
    padding-left: 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.6;
}

.profile-newsletter-hint {
    margin-top: 0.25rem;
    margin-left: 2rem; /* align under text, past checkbox */
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0;
}

/* ---- Game interests ---- */
.profile-game-interests-section {
    margin-top: 1.5rem;
}

.profile-game-interests-title {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: 'Cinzel';
}

.profile-game-interests-hint {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'Crimson Text';
}

/* Chip container */
.game-interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Game interest chip (rendered by JS) */
.game-interest-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-family: 'Crimson Text', serif;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}

.game-interest-label:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.6);
}

.game-interest-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent-gold);
}

/* Save button */
.profile-save-btn {
    margin-top: 1.5rem;
}

/* ---- Stats section ---- */
.profile-stats-section h2 {
    margin-bottom: 1rem;
    font-family: Cinzel;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* ---- Characters & Groups blocks ---- */
.profile-section-block {
    margin-bottom: 2rem;
}

.profile-section-block .section-header {
    margin-bottom: 1rem;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .profile-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-picture-container {
        margin-bottom: 1rem;
    }

    .profile-newsletter-hint {
        margin-left: 0;
    }

    .profile-name {
        font-size: 1.4rem;
    }
}
