/**
 * Styles pour les photos de profil - EcoWeb CenC
 * @version 1.0
 * @date 2025-11-01
 */

/* ===================================
   SECTION UPLOAD DE PHOTO
   =================================== */

.profile-photo-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.profile-photo-upload {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.current-photo {
    flex-shrink: 0;
}

.profile-photo-preview {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-upload-controls {
    flex-grow: 1;
}

.photo-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.photo-actions .btn-primary,
.photo-actions .btn-danger {
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* ===================================
   AFFICHAGE DES PHOTOS
   =================================== */

.profile-photo {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
}

.profile-photo-small {
    width: 50px;
    height: 50px;
}

.profile-photo-medium {
    width: 300px;
    height: 300px;
}

/* ===================================
   AVATARS UTILISATEUR (FORUM)
   =================================== */

.user-avatar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    gap: 8px;
}

.user-avatar .profile-photo {
    flex-shrink: 0;
}

.user-avatar .user-name {
    font-weight: 500;
    color: #333;
}

.user-avatar-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.user-avatar-link:hover {
    opacity: 0.8;
}

/* ===================================
   AVATAR DANS LE FORUM - LISTE DES TOPICS
   =================================== */

.topic-author-avatar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topic-author-avatar .profile-photo {
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

/* ===================================
   AVATAR DANS LE FORUM - MESSAGES
   =================================== */

.post-author {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.post-author-avatar .profile-photo {
    width: 60px;
    height: 60px;
}

.post-author-info {
    flex-grow: 1;
}

.post-author-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.post-author-meta {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .profile-photo-upload {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .current-photo {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .profile-photo-preview {
        width: 150px;
        height: 150px;
    }

    .photo-upload-controls {
        width: 100%;
    }

    .photo-actions {
        justify-content: center;
    }

    .post-author {
        gap: 10px;
    }

    .post-author-avatar .profile-photo {
        width: 40px;
        height: 40px;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

.profile-photo {
    transition: transform 0.2s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
}

/* Image de chargement */
.profile-photo[src*="default"] {
    opacity: 0.8;
}

/* ===================================
   PHOTO DE PROFIL DANS LE HEADER
   =================================== */

.user-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-profile-badge:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-user-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.header-user-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .header-user-name {
        display: none; /* Masquer le nom sur mobile, garder juste la photo */
    }

    .user-profile-badge {
        padding: 6px;
        min-width: 44px; /* Taille minimum pour le touch target */
    }

    .header-user-photo {
        width: 36px;
        height: 36px;
    }
}

/* Adaptation pour différents thèmes de header */
.app-header-adherent .user-profile-badge {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.app-header-adherent .user-profile-badge:hover {
    background: rgba(0, 0, 0, 0.15);
}

.app-header-user .user-profile-badge {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.app-header-user .user-profile-badge:hover {
    background: rgba(255, 255, 255, 0.25);
}
