/**
 * PROFILE PAGE - Styles pour la page de profil utilisateur
 * Inclut : upload de photos, formulaire éditable, affichage responsive
 */

.profile-page {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f5f5f9 0%, #ffffff 100%);
    min-height: 100vh;
}

.profile-page .container {
    max-width: 1200px;
}

/* ======================
   EN-TÊTE DU PROFIL
   ====================== */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9ff 100%);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(255, 70, 150, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 200, 200, 0.3);
    margin-bottom: 2rem;
}

.profile-header-content h1 {
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #FF7F89, #FFD93D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
}

.profile-subtitle {
    margin: 0;
    color: #666;
    font-weight: 500;
    font-size: 1rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
}

.profile-actions .btn {
    min-width: 120px;
}

/* ======================
   SECTIONS DU PROFIL
   ====================== */
.profile-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-section {
    background: linear-gradient(135deg, #ffffff 0%, #f9f9ff 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 
        0 8px 32px rgba(255, 70, 150, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 200, 200, 0.25);
}

.profile-section h2 {
    margin: 0 0 1.5rem 0;
    background: linear-gradient(135deg, #FF7F89, #FFD93D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    font-weight: 700;
}

/* 🔄 DEPRECATED: Overridden by accessibility-fixes.css */
/* Old .section-desc rule moved to accessibility-fixes.css */
.section-desc {
    /* See accessibility-fixes.css for updated rules */
}

/* ======================
   GRILLE DE PHOTOS
   ====================== */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
}

.photo-upload {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.photo-upload:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 100, 150, 0.25);
}

.photo-upload input[type="file"] {
    display: none;
}

.photo-label {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-label:hover {
    transform: scale(1.02);
}

.photo-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF7F89, #E56B75);
    color: white;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.photo-preview:hover {
    border-color: #FFD93D;
    box-shadow: var(--shadow-glow-red);
}

.photo-preview.has-image {
    background: none;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.upload-text {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Indicateur de traitement pour détection de visage */
.processing-indicator {
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.photo-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 59, 48, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.photo-delete:hover {
    background: rgba(255, 59, 48, 1);
    transform: scale(1.1);
}

/* ======================
   INFORMATIONS DE BASE
   ====================== */
.readonly-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.info-item {
    padding: 1.2rem;
    background: #ffe0e6;
    border-radius: 12px;
    border-left: 5px solid #c62828;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease forwards;
    animation-fill-mode: both;
}

.info-item:nth-child(1) { animation-delay: 0.1s; }
.info-item:nth-child(2) { animation-delay: 0.15s; }
.info-item:nth-child(3) { animation-delay: 0.2s; }
.info-item:nth-child(4) { animation-delay: 0.25s; }
.info-item:nth-child(5) { animation-delay: 0.3s; }
.info-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.info-item:hover {
    background: #ffccd5;
    border-left-color: #FF7F89;
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.3);
}

.info-item label {
    display: block;
    font-size: 0.85rem;
    color: #c62828;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.info-item p {
    margin: 0;
    font-size: 1.1rem;
    color: #000000;
    font-weight: 700;
    line-height: 1.4;
}

/* ======================
   FORMULAIRE ÉDITABLE - Informations personnelles
   ====================== */

/* Grille de formulaire - 3 colonnes (spécifique à la page profil) */
#app-content .form-row,
.profile-page .form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

/* Cartes de formulaire stylisées */
.form-group {
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    background: #e3f2fd;
    border-radius: 12px;
    border-left: 5px solid #1976d2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.form-group:hover {
    background: #bbdefb;
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.3);
}

.form-group.full-width {
    grid-column: 1 / -1;
    background: #f3e5f5;
    border-left-color: #7b1fa2;
}

.form-group.full-width:hover {
    background: #e1bee7;
    box-shadow: 0 8px 24px rgba(123, 31, 162, 0.3);
}

.form-group label {
    margin-bottom: 0.6rem;
    color: #1565c0;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-group.full-width label {
    color: #6a1b9a;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid #1976d2;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
    background: #ffffff;
    color: #000000;
    font-weight: 600;
}

.form-group.full-width textarea {
    border-color: #7b1fa2;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0d47a1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.15);
}

.form-group.full-width textarea:focus {
    border-color: #4a148c;
    box-shadow: 0 0 0 4px rgba(123, 31, 162, 0.15);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: rgba(240, 240, 245, 0.6);
    cursor: not-allowed;
    color: #9ca3af;
    border-color: rgba(200, 200, 200, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.field-hint {
    font-size: 0.85rem;
    color: #1565c0;
    margin-top: 0.25rem;
    font-weight: 600;
}

.form-group.full-width .field-hint {
    color: #6a1b9a;
}

/* Input avec unité */
.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-unit input {
    flex: 1;
}

.input-with-unit .unit {
    position: absolute;
    right: 1rem;
    color: #9ca3af;
    font-weight: 600;
    pointer-events: none;
}

.input-with-unit .conversion {
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
    min-width: 80px;
    font-weight: 500;
}

/* Compteur de caractères */
.char-count {
    font-size: 0.85rem;
    color: #999;
    text-align: right;
    margin-top: 0.25rem;
}

.char-count #bioCount {
    font-weight: 600;
    color: #FF7F89;
}

/* ======================
   LANGUES PARLÉES
   ====================== */
.languages-container {
    border: 2px solid rgba(230, 57, 70, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
}

.languages-selected {
    padding: 1rem;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
}

.languages-selected .no-languages {
    color: #9ca3af;
    font-style: italic;
}

/* ANCIEN SYSTÈME - Commenté car remplacé par le nouveau sélecteur à tags */
/*
.language-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #FF7F89;
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
}

.language-tag .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.language-tag .remove:hover {
    opacity: 1;
}
*/

.languages-picker {
    border-top: 2px solid rgba(230, 57, 70, 0.15);
    background: rgba(255, 255, 255, 0.8);
}

.languages-picker input {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-bottom: 1px solid rgba(230, 57, 70, 0.15);
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

.languages-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

.languages-list label {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    color: #000000;
    font-weight: 600;
}

.languages-list label:hover {
    background: rgba(230, 57, 70, 0.08);
}

.languages-list input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* ======================
   CENTRES D'INTÉRÊT
   ====================== */
.interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.interest-tag {
    padding: 0.65rem 1.2rem;
    border: 2px solid #FF7F89;
    border-radius: 20px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    user-select: none;
    color: #000000;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.interest-tag:hover {
    border-color: #FF7F89;
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.2);
}

.interest-tag.selected {
    background: linear-gradient(135deg, #FF7F89, #FFD93D);
    color: #ffffff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

.interest-tag.selected:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.4);
}

.interest-tag:not(.editable) {
    cursor: default;
    opacity: 0.8;
}

/* Langues parlées */
.language-selector {
    margin: 1rem 0;
}

.language-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.language-tag {
    padding: 0.6rem 1.2rem;
    border: 2px solid #FF7F89;
    border-radius: 25px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    user-select: none;
    color: #000000;
    font-weight: 600;
}

.language-tag:hover {
    border-color: #FF7F89;
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.2);
}

.language-tag.selected {
    background: linear-gradient(135deg, #FF7F89, #FFD93D);
    color: white;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

.language-selector .hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
    font-weight: 500;
}

/* ======================
   RESPONSIVE
   ====================== */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .profile-actions {
        width: 100%;
        justify-content: center;
    }

    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-upload {
        aspect-ratio: 1;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .readonly-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-page {
        padding: 1rem 0;
    }

    .profile-section {
        padding: 1.5rem;
    }

    .profile-header-content h1 {
        font-size: 1.5rem;
    }

    .photos-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================
   ANIMATIONS
   ====================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-section {
    animation: fadeIn 0.3s ease;
}

.profile-section:nth-child(1) { animation-delay: 0s; }
.profile-section:nth-child(2) { animation-delay: 0.1s; }
.profile-section:nth-child(3) { animation-delay: 0.2s; }

/* ======================
   ÉTATS DU FORMULAIRE
   ====================== */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #ff4444;
}

/* Champs validés automatiquement (natif CSS) */
.form-group input:valid:not(:placeholder-shown),
.form-group select:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
    border-color: #4CAF50;
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

/* Champs validés avec succès après sauvegarde (via JS) */
.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: #4CAF50;
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.error-message {
    color: #ff4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.success-message {
    background: #4CAF50;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}
