/* Styles pour le profil utilisateur */

/* Container principal du profil */
.profile-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(24, 42, 112, 0.8);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    position: relative;
    z-index: 2;
    max-width: 100%;
}

/* En-tête du profil avec avatar et infos principales */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-avatar-wrapper {
    position: relative;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-bg);
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-level {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-bg);
    box-shadow: 0 0 10px rgba(255, 184, 0, 0.6);
    border: 2px solid var(--secondary-bg);
}

.profile-badges {
    display: flex;
    gap: 5px;
}

.profile-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-badge:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.profile-info {
    flex: 1;
}

.profile-username {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.profile-stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-color);
}

.profile-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-country {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-secondary);
}

.profile-country-flag {
    font-size: 20px;
}

/* Section performances */
.profile-performance {
    margin-bottom: 30px;
}

.profile-performance h3,
.profile-social h3,
.profile-sharing h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 15px;
    position: relative;
}

.profile-performance h3::after,
.profile-social h3::after,
.profile-sharing h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

.performance-card {
    background: rgba(13, 20, 60, 0.5);
    border-radius: 15px;
    padding: 20px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
}

.performance-chart {
    width: 100%;
    height: 180px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#performance-chart-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: rgba(13, 20, 60, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.performance-metrics {
    display: flex;
    justify-content: space-between;
}

.performance-metric {
    text-align: center;
    padding: 10px;
}

.metric-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.metric-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-color);
}

/* Section sociale */
.profile-social {
    margin-bottom: 30px;
}

.profile-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.profile-tab {
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.profile-tab.active {
    background: var(--accent-color);
    color: var(--primary-bg);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Onglet Amis */
.friend-list {
    margin-bottom: 20px;
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background: rgba(13, 20, 60, 0.5);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.friend-item:hover {
    background: rgba(13, 20, 60, 0.7);
    transform: translateX(5px);
}

.friend-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--accent-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: var(--primary-bg);
    margin-right: 15px;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.friend-status {
    font-size: 14px;
    color: var(--text-secondary);
}

.friend-status.online {
    color: var(--success-green);
}

.friend-score {
    font-weight: 600;
    color: var(--accent-tertiary);
}

.add-friend-btn {
    width: 100%;
}

/* Onglet Parrainages */
.referral-code-container {
    background: rgba(13, 20, 60, 0.5);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.referral-code-container h4,
.friend-code-container h4,
.qr-scan-container h4,
.friend-suggestions h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.referral-code, .referral-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

#referral-code-value, #referral-link-value {
    font-weight: 600;
    color: var(--accent-tertiary);
    letter-spacing: 1px;
}

.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.qr-code-placeholder {
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    position: relative;
}

.qr-code-placeholder::after {
    content: 'QR Code';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-bg);
    font-weight: 600;
}

.referral-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.referral-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.referral-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Onglet Défis */
.challenge-list {
    margin-bottom: 20px;
}

.challenge-item {
    background: rgba(13, 20, 60, 0.5);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.challenge-item:hover {
    background: rgba(13, 20, 60, 0.7);
}

.challenge-item.active {
    border-left: 3px solid var(--accent-color);
}

.challenge-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.challenge-title {
    font-weight: 600;
    color: var(--text-primary);
}

.challenge-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
}

.status-badge.in-progress {
    background: rgba(0, 200, 255, 0.2);
    color: var(--accent-color);
}

.status-badge.completed {
    background: rgba(77, 255, 180, 0.2);
    color: var(--success-green);
}

.challenge-time-left {
    font-size: 12px;
    color: var(--text-secondary);
}

.challenge-result {
    font-weight: 600;
    font-size: 14px;
}

.challenge-result.win {
    color: var(--success-green);
}

.challenge-progress {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.challenger {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.challenger-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: var(--primary-bg);
}

.challenger-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.challenge-versus {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-tertiary);
}

.challenge-reward {
    margin-top: 15px;
    text-align: right;
    color: var(--accent-tertiary);
    font-weight: 600;
}

.create-challenge-btn {
    width: 100%;
}

/* Section partage */
.profile-sharing {
    margin-bottom: 20px;
}

.sharing-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-5px);
}

.share-btn.instagram {
    background: linear-gradient(45deg, #833AB4, #FD1D1D, #FCAF45);
}

.share-btn.twitter {
    background: #1DA1F2;
}

.share-btn.facebook {
    background: #4267B2;
}

.share-btn.whatsapp {
    background: #25D366;
}

/* Styles pour la modale d'ajout d'ami */
.friend-search-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-with-icon {
    position: relative;
    margin-bottom: 15px;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.input-with-icon input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--primary-bg);
    font-size: 16px;
}

.friend-code-container, .qr-scan-container {
    background: rgba(13, 20, 60, 0.5);
    border-radius: 15px;
    padding: 15px;
    margin-top: 10px;
}

.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    background: rgba(13, 20, 60, 0.5);
}

.suggestion-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: var(--primary-bg);
    margin-right: 15px;
}

.suggestion-info {
    flex: 1;
}

.suggestion-name {
    font-weight: 600;
    color: var(--text-primary);
}

.suggestion-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.suggestion-add {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: var(--primary-bg);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-add:hover {
    transform: scale(1.1);
    background: var(--accent-tertiary);
}

/* Styles pour la modale de création de défi */
.challenge-creation-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--primary-bg);
    font-size: 16px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

textarea.form-control {
    resize: none;
    min-height: 80px;
}

#submit-challenge-btn {
    margin-top: 10px;
}

/* Adaptations mobiles supplémentaires */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-info {
        width: 100%;
    }
    
    .profile-stats-row {
        justify-content: center;
    }
    
    .profile-country {
        justify-content: center;
    }
    
    .profile-performance h3::after,
    .profile-social h3::after,
    .profile-sharing h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .profile-performance h3,
    .profile-social h3,
    .profile-sharing h3 {
        text-align: center;
    }
    
    .challenge-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .challenge-status {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
