/* ==========================================
   PAGE PROFIL
   ========================================== */
#profileSection, #friendProfileSection {
    animation: cardFadeUp 0.5s ease forwards;
    opacity: 0;
}

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar-big {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #c678dd);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 800; color: #000;
    overflow: hidden;
    border: 3px solid var(--border-color);
    flex-shrink: 0;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0; right: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #000;
    border: 2px solid var(--bg-color);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.profile-avatar-edit:hover { transform: scale(1.1); }

.profile-info {
    flex: 1;
    min-width: 200px;
}

.profile-display-name {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.profile-username {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 4px 0 8px;
}

.profile-bio {
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.profile-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}
.profile-edit-btn:hover { border-color: var(--primary); color: var(--primary); }

.profile-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-display);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.profile-edit-form {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    animation: cardFadeUp 0.3s ease forwards;
    opacity: 0;
}

.profile-edit-form h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ==========================================
   PAGE AMIS
   ========================================== */
#friendsSection {
    animation: cardFadeUp 0.5s ease forwards;
    opacity: 0;
}

.friends-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.friends-search-box {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    margin-bottom: 2rem;
}

.friends-search-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.friends-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.friends-search-row input {
    flex: 1;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 11px 15px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.friends-search-row input:focus { border-color: var(--primary); box-shadow: var(--shadow-glow); }

.friends-search-row button {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: var(--font-body);
    display: flex; align-items: center; gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.friends-search-row button:hover { background: var(--primary-hover); transform: translateY(-1px); }

.friend-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friends-block {
    margin-bottom: 2rem;
}

.friends-block h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.friends-count-badge {
    background: var(--primary-light);
    border: 1px solid rgba(255, 132, 161, 0.3);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

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

.friend-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: border-color 0.2s;
    animation: cardFadeUp 0.3s ease forwards;
    opacity: 0;
}
.friend-item:hover { border-color: var(--primary); }

.friend-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #c678dd);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 800; color: #000;
    flex-shrink: 0;
}

.friend-avatar-img {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-username {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.friend-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.friend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
    white-space: nowrap;
}
.friend-btn:hover { border-color: var(--primary); color: var(--primary); }

.friend-btn-accept {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.4);
    color: #4ade80;
}
.friend-btn-accept:hover { background: rgba(74, 222, 128, 0.2); color: #4ade80; border-color: #4ade80; }

.friend-btn-danger {
    background: rgba(252, 129, 129, 0.08);
    border-color: rgba(252, 129, 129, 0.3);
    color: #FC8181;
}
.friend-btn-danger:hover { background: rgba(252, 129, 129, 0.15); color: #FC8181; border-color: #FC8181; }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 9px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    margin-bottom: 1.5rem;
    transition: all 0.2s;
}
.back-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ==========================================
   PAGE SUGGESTION IA
   ========================================== */
#suggestionSection {
    animation: cardFadeUp 0.5s ease forwards;
    opacity: 0;
    max-width: 860px;
    margin: 0 auto;
}
.suggestion-hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
    position: relative;
}
.suggestion-hero::after {
    content: '';
    display: block;
    width: 60px; height: 3px;
    background: linear-gradient(90deg, var(--primary), #c678dd);
    border-radius: 2px;
    margin: 1.5rem auto 0;
}
.suggestion-hero-icon {
    font-size: 2.4rem;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--primary), #c678dd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}
.suggestion-hero-title {
    font-family: var(--font-display);
    font-size: 2.6rem; font-weight: 800; color: var(--text-main);
    margin-bottom: 0.6rem; line-height: 1.1;
}
.suggestion-hero-sub {
    font-size: 1rem; color: var(--text-muted); line-height: 1.6;
    max-width: 480px; margin: 0 auto;
}
.suggestion-form {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    margin: 2rem 0 2.5rem;
    display: flex; flex-direction: column; gap: 0;
}
.suggestion-group {
    display: flex; flex-direction: column; gap: 12px;
    padding: 1.6rem 0;
    border-bottom: 1px solid var(--border-color);
}
.suggestion-group:first-child { padding-top: 0; }
.suggestion-group:last-of-type { border-bottom: none; padding-bottom: 0; }
.suggestion-group-label { display: flex; flex-direction: column; gap: 3px; }
.suggestion-group-label .q-title { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.suggestion-group-label .q-sub { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    background: var(--bg-color);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.83rem; font-weight: 600;
    cursor: pointer; font-family: var(--font-body);
    transition: all 0.18s ease; line-height: 1;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.chip.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.suggestion-textarea-wrapper { padding: 1.6rem 0 0; }
.suggestion-textarea-wrapper label { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.suggestion-textarea-wrapper .q-title { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.suggestion-textarea-wrapper .q-sub { font-size: 0.8rem; color: var(--text-muted); }
.suggestion-textarea-wrapper textarea {
    background: var(--bg-color); border: 1px solid var(--border-color);
    color: var(--text-main); padding: 13px 16px; border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 0.93rem;
    resize: vertical; outline: none; transition: border-color 0.2s;
    width: 100%; line-height: 1.6;
}
.suggestion-textarea-wrapper textarea:focus { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.suggestion-submit-btn {
    align-self: center;
    background: linear-gradient(135deg, var(--primary), #c678dd);
    color: #000; border: none;
    padding: 15px 44px; border-radius: 50px;
    font-weight: 800; font-size: 1rem;
    cursor: pointer; font-family: var(--font-body);
    transition: all 0.25s ease;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 4px 20px rgba(255, 132, 161, 0.35);
    letter-spacing: 0.3px; margin-top: 1.8rem;
}
.suggestion-submit-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(255, 132, 161, 0.5); }
.suggestion-loading {
    text-align: center; padding: 3rem; color: var(--text-muted);
    font-size: 0.95rem; display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.suggestion-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.suggestion-results-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.2rem; padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap; gap: 12px;
}
.suggestion-results-header h3 {
    font-size: 1.3rem; font-weight: 700; color: var(--text-main);
    display: flex; align-items: center; gap: 8px;
}
.suggestion-results-header h3 i { color: var(--primary); }
.suggestion-again-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 18px; border-radius: 30px;
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer; font-family: var(--font-body);
    display: flex; align-items: center; gap: 6px;
    transition: all 0.2s ease;
}
.suggestion-again-btn:hover { border-color: var(--primary); color: var(--primary); }
.suggestion-ai-intro {
    background: linear-gradient(135deg, rgba(255,132,161,0.08), rgba(198,120,221,0.08));
    border: 1px solid rgba(255, 132, 161, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 18px; font-size: 0.95rem; line-height: 1.6;
    color: var(--text-main); margin-bottom: 1.5rem; font-style: italic;
}
.suggestion-card .media-info { padding: 0.8rem; }
.suggestion-reason {
    font-size: 0.78rem; color: var(--text-muted); line-height: 1.4;
    margin-top: 4px; font-style: italic; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}



/* ==========================================
   AMELIORATIONS PC (Desktop - min-width: 1024px) POUR PAGES
   ========================================== */
@media (min-width: 1024px) {

    /* -- Profil PC : en-tête panoramique -- */
    .profile-header {
        flex-wrap: nowrap;
        align-items: flex-start;
        background: var(--surface);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        padding: 2.5rem 3rem;
        gap: 2.5rem;
        box-shadow: var(--shadow-sm);
    }

    .profile-avatar-big {
        width: 130px;
        height: 130px;
        font-size: 3rem;
    }

    .profile-display-name {
        font-size: 2.4rem;
    }

    .profile-stats {
        flex-shrink: 0;
        flex-direction: row;
        gap: 2rem;
        align-items: center;
        padding-left: 2.5rem;
        border-left: 1px solid var(--border-color);
        margin-left: auto;
    }

    .stat-item {
        gap: 6px;
    }

    .stat-num {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.72rem;
        text-align: center;
    }

    /* -- Amis PC : grille 2 colonnes -- */
    .friends-list,
    .friend-search-results {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 1rem;
    }

    .friend-item {
        padding: 1.2rem 1.4rem;
    }

    .friends-search-box {
        max-width: 700px;
    }
}

