/* Variables CSS pour les couleurs personnalisables */
:root {
    --primary-color: #D4AF37;
    --secondary-color: #000000;
    --accent-color: #FFFFFF;
    --background-color: #0A0A0A;
    --card-background: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
}

/* ===== COMMENTAIRES ===== */
.comments-container {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.comments-list {
    margin-top: 20px;
}

.comment {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.comment-reply {
    margin-left: 40px;
    margin-top: 10px;
    border-left: 2px solid var(--primary-color);
    padding-left: 15px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-info {
    flex: 1;
}

.comment-username {
    color: var(--primary-color);
    font-size: 14px;
}

.comment-date {
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: 8px;
}

.comment-edited {
    color: var(--text-secondary);
    font-size: 11px;
    font-style: italic;
    margin-left: 4px;
}

.comment-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

.comment-content {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.comment-footer {
    display: flex;
    gap: 12px;
}

.btn-reply {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    transition: opacity 0.2s;
}

.btn-reply:hover {
    opacity: 0.8;
}

.edit-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 10px;
    resize: vertical;
    min-height: 60px;
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-save, .btn-cancel {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

.btn-save {
    background: var(--success-color);
    color: white;
}

.btn-cancel {
    background: var(--danger-color);
    color: white;
}

.no-comments {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* ===== LIKES ===== */
.like-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.like-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.like-button.liked {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.like-button .like-icon {
    font-size: 20px;
}

.like-button .like-count {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== PROFILS UTILISATEURS ===== */
.user-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-background);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-info {
    flex: 1;
}

.user-name {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 4px;
}

.user-stats, .user-followers {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 2px 0;
}

.btn-view-profile {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-view-profile:hover {
    opacity: 0.9;
}

/* ===== MODAL PROFIL ===== */
.modal-profile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--card-background);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

.profile-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
}

.profile-bio {
    color: var(--text-primary);
    margin: 10px 0;
}

.profile-location, .profile-website {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 5px 0;
}

.profile-website a {
    color: var(--primary-color);
    text-decoration: none;
}

.btn-follow {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.stat {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.stat-value {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 5px;
}

.profile-badges {
    margin: 30px 0;
}

.profile-badges h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.profile-progress h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.progress-themes {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.theme-progress h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

/* Grille de défis dans les profils - Plus petite pour profils */
.progress-themes .challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.progress-themes .challenge-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
}

.progress-themes .challenge-card.completed {
    border: 2px solid var(--success-color);
}

.challenge-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.challenge-points {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 700;
}

.challenge-date {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 8px;
}

/* ===== CLASSEMENT ===== */
.leaderboard {
    background: var(--card-background);
    border-radius: 16px;
    padding: 30px;
}

.leaderboard h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.2s;
}

.leaderboard-item:hover {
    transform: translateX(5px);
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border: 2px solid #FFD700;
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
    border: 2px solid #C0C0C0;
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
    border: 2px solid #CD7F32;
}

.rank {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.user-avatar-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    flex: 1;
}

.username {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.user-info-small {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.user-points {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
}

/* ===== ÉDITEUR DE COULEURS ===== */
.color-editor {
    background: var(--card-background);
    border-radius: 16px;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.color-editor-header {
    text-align: center;
    margin-bottom: 40px;
}

.color-editor-header h2 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 10px;
}

.color-editor-header p {
    color: var(--text-secondary);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.color-input-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
}

.color-input-group label {
    display: block;
    margin-bottom: 12px;
}

.color-input-group strong {
    color: var(--text-primary);
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.color-description {
    color: var(--text-secondary);
    font-size: 13px;
}

.color-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.color-text {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px;
    font-family: monospace;
}

.color-preview {
    height: 40px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.color-editor-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.color-presets {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
}

.color-presets h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.preset-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-preset {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-preset:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
}

/* ===== SUPPORT VIDÉO ===== */
.media-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.media-container video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

.media-container img {
    width: 100%;
    height: auto;
    display: block;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-button {
    background: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ===== ÉDITION DE PROFIL ===== */
.avatar-preview {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--card-background);
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background-size: cover;
    background-position: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-background);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

.profile-info-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.profile-bio {
    color: var(--text-primary);
    line-height: 1.6;
    margin: 10px 0;
}

.profile-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-meta-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.profile-meta-item a:hover {
    text-decoration: underline;
}

/* Badge de complétion */
.completion-badge {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    border-radius: 12px;
    margin-top: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 10px rgba(212, 175, 55, 0);
    }
}

.completion-badge-icon {
    font-size: 48px;
    margin-bottom: 10px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--danger-color);
}

.toast-info {
    background: var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Progression améliorée */
.progress-bar {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 10px;
    transition: width 0.5s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Bonus challenges indicator */
.bonus-challenges {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-top: 5px;
}

/* ===== THÈME CLAIR ===== */
body.light-theme .header {
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-theme .challenge-card,
body.light-theme .photo-card,
body.light-theme .user-card,
body.light-theme .profile-card,
body.light-theme .leaderboard,
body.light-theme .modal-content {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-theme .challenge-card:hover,
body.light-theme .user-card:hover {
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

body.light-theme .nav {
    background: #FFFFFF;
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-theme .comment {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .leaderboard-item {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .theme-toggle-btn {
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .color-grid {
        grid-template-columns: 1fr;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        bottom: 10px;
    }
}
