/* ==========================================
   Page de Profil - Design Moderne Simplifié
   ========================================== */

/* Variables CSS */
:root {
    --primary-color: #176d86;
    --primary-hover: #125a6d;
    --secondary-color: #f8fafc;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

/* Container principal */
.profile-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
    min-height: 100vh;
}

/* Hero Section avec Avatar */
.profile-hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e7a96 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-background {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%23ffffff"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    text-align: center;
    padding: 48px 24px;
    color: white;
}

.avatar-section {
    margin-bottom: 24px;
}

.profile-username {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-subtitle {
    font-size: 1.125rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Formulaire */
.profile-form {
    margin-bottom: 0;
}

/* Grille de cartes */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

/* Cartes de profil */
.profile-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.profile-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.profile-card.location-card {
    grid-column: 1 / -1;
}

/* En-tête de carte */
.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, var(--secondary-color), #f1f5f9);
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    color: white;
    box-shadow: var(--shadow-md);
}

.card-icon.personal {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.card-icon.investor {
    background: linear-gradient(135deg, #10b981, #059669);
}

.card-icon.location {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.card-icon.social {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.card-icon.website {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

/* Assurer que les icônes FontAwesome s'affichent correctement */
.card-icon i {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Icônes de marque pour les réseaux sociaux */
.field-label i.fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

.card-title {
    flex: 1;
}

.card-title h3 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-title p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Corps de carte */
.card-body {
    padding: 24px;
}

/* Champs de formulaire */
.form-field {
    margin-bottom: 24px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.badge-required {
    background: var(--error-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inputs sans icônes */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
    font-family: inherit;
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(23, 109, 134, 0.1);
}

/* Input désactivé */
.form-control.disabled {
    background: #f3f4f6;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Style pour les selects */
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

select.form-control:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23176d86' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* Pour les inputs texte, pas de flèche */
input.form-control[type="text"] {
    background-image: none;
    padding-right: 16px;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Radio cards */
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.radio-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    transition: var(--transition);
    text-align: center;
}

.radio-content i {
    font-size: 2rem;
    color: var(--text-muted);
    transition: var(--transition);
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.radio-content span {
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.radio-card:hover .radio-content {
    border-color: var(--primary-color);
    background: rgba(23, 109, 134, 0.05);
}

.radio-card input[type="radio"]:checked + .radio-content {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(23, 109, 134, 0.1), rgba(23, 109, 134, 0.05));
    box-shadow: 0 0 0 3px rgba(23, 109, 134, 0.1);
}

.radio-card input[type="radio"]:checked + .radio-content i {
    color: var(--primary-color);
}

.radio-card input[type="radio"]:checked + .radio-content span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Champs de localisation */
.location-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Section des sites web */
.websites-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.website-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--secondary-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.website-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
}

.btn-remove-website {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: #dc2626;
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.btn-remove-website:hover {
    background: #b91c1c;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.btn-remove-website i {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.no-websites {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
    background: var(--secondary-color);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

/* Validation errors */
.field-error {
    display: block;
    margin-top: 6px;
    color: var(--error-color);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Bouton de soumission à droite */
.form-submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
}

/* État de chargement */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin-bottom: 24px;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.loading-container p {
    margin: 0;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .website-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-container {
        padding: 0 12px 32px;
    }

    .profile-hero {
        border-radius: var(--radius-md);
    }

    .hero-content {
        padding: 32px 16px;
    }

    .profile-username {
        font-size: 2rem;
    }

    .profile-subtitle {
        font-size: 1rem;
    }

    .profile-grid {
        gap: 16px;
        margin-bottom: 24px;
    }

    .card-header {
        padding: 20px;
    }

    .card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .card-body {
        padding: 20px;
    }

    .location-fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .radio-group {
        grid-template-columns: 1fr;
    }

    .form-submit {
        margin-top: 24px;
        justify-content: center;
    }
    
    .website-entry {
        flex-direction: column;
    }
    
    .website-fields {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-username {
        font-size: 1.5rem;
    }

    .card-title h3 {
        font-size: 1.125rem;
    }

    .form-field {
        margin-bottom: 20px;
    }
}
