/* ==========================================
   PROFIL PUBLIC — profile.css
   ========================================== */

/* ── En-tête hero ───────────────────────── */
.profile-hero {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 2rem 0 1.5rem;
}

.profile-hero-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    flex-wrap: wrap;
}

/* Avatar */
.profile-avatar-wrap {
    flex-shrink: 0;
}

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

/* Infos */
.profile-info {
    flex: 1;
    min-width: 0;
    padding-top: 0.25rem;
}

.profile-pseudo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.profile-bio {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    max-width: 480px;
    line-height: 1.5;
}

/* Stats */
.profile-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.25rem 0 0;
}

.profile-stat:first-child { padding-left: 0; }

.profile-stat-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.profile-stat-label {
    font-size: 0.72rem;
    color: var(--color-text-light);
    font-weight: var(--font-weight-medium);
    margin-top: 0.1rem;
}

.profile-stat-sep {
    width: 1px;
    height: 2rem;
    background: var(--color-border);
    margin: 0 1.25rem 0 0;
    flex-shrink: 0;
}

/* ── Onglets ────────────────────────────── */
.profile-tabs-wrap {
    background: var(--color-white);
    border-bottom: 2px solid var(--color-border);
    position: sticky;
    top: 56px; /* hauteur navbar */
    z-index: 10;
}

.profile-tabs {
    display: flex;
    gap: 0;
}

.profile-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.profile-tab:hover {
    color: var(--color-primary);
}

.profile-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.profile-tab-count {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--color-background-light);
    color: var(--color-text-light);
    border-radius: var(--radius-full);
    padding: 0.1rem 0.45rem;
    min-width: 1.5rem;
    text-align: center;
}

.profile-tab.active .profile-tab-count {
    background: rgba(0, 0, 60, 0.1);
    color: var(--color-primary);
}

/* ── Cartes de tops ─────────────────────── */
.profile-top-card {
    display: block;
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    color: var(--color-text);
    height: 100%;
}

.profile-top-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--color-text);
}

.profile-top-img {
    position: relative;
    height: 130px;
    overflow: hidden;
    background: var(--color-background);
}

.profile-top-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-top-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--color-background);
}

/* Badge likes */
.profile-top-likes {
    position: absolute;
    bottom: 0.4rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.profile-top-likes .bi-heart-fill { color: #ff5a7e; }

/* Badge privé */
.profile-top-private {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
}

.profile-top-body {
    padding: 0.65rem 0.75rem;
}

.profile-top-title {
    font-size: 0.85rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text);
}

.profile-top-meta {
    font-size: 0.72rem;
    color: var(--color-text-light);
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-top-count {
    font-size: 0.7rem;
    color: var(--color-text-light);
    margin: 0;
}

/* ── État vide ──────────────────────────── */
.profile-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-light);
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 576px) {
    .profile-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    .profile-stats {
        justify-content: center;
    }
    .profile-stat {
        padding: 0 0.85rem;
    }
    .profile-pseudo {
        font-size: 1.3rem;
    }
    .profile-bio {
        font-size: 0.85rem;
    }
}

/* ── Accès restreint ────────────────────────────────────── */
.profile-restricted-box {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: 0.5rem;
    margin-bottom: 3rem;
}

.profile-restricted-icon {
    font-size: 2.5rem;
    color: var(--color-border);
    display: block;
    margin-bottom: 1rem;
}

.profile-restricted-msg {
    font-size: 0.95rem;
    color: var(--color-text-light);
    max-width: 380px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.profile-restricted-msg strong {
    color: var(--color-text);
}

.profile-restricted-btns {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── My Profile — sections demandes/amis ────────────────── */
.myp-section {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
}

.myp-section-title {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.myp-count {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--color-background-light);
    color: var(--color-text-light);
    border-radius: var(--radius-full);
    padding: 0.1rem 0.5rem;
    margin-left: 0.25rem;
}

/* Carte utilisateur */
.myp-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.myp-user-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.myp-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
}
.myp-user-info:hover { color: var(--color-primary); }

.myp-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.myp-user-pseudo {
    font-size: 0.9rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.myp-user-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Badge rouge sur l'onglet demandes */
.myp-badge {
    transition: background 0.2s, color 0.2s;
}

@media (max-width: 576px) {
    .myp-user-card { flex-direction: column; align-items: flex-start; }
    .myp-user-actions { width: 100%; justify-content: flex-start; }
}

/* ── Panneau de partage (my-profile) ─────────────────────── */
.share-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
    backdrop-filter: blur(2px);
}
.share-panel-card {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(480px, 100%);
    background: var(--color-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem 1.5rem 2rem;
    z-index: 1050;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.18);
    animation: shareSlideUp 0.22s ease;
}
@keyframes shareSlideUp {
    from { transform: translateX(-50%) translateY(100%); }
    to   { transform: translateX(-50%) translateY(0); }
}
.share-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}
.share-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    font-size: 1.1rem;
    padding: 0.25rem;
    line-height: 1;
}
.share-url-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-background);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin-bottom: 1.5rem;
}
.share-url-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    color: var(--color-text-light);
    min-width: 0;
    outline: none;
}
.share-url-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    font-size: 1rem;
    flex-shrink: 0;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}
.share-url-copy:hover { color: var(--color-primary-light); }
.share-channels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.share-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: filter var(--transition-fast);
    color: #fff;
}
.share-channel:hover { filter: brightness(1.1); color: #fff; }
.share-channel i { font-size: 1.5rem; }
.share-whatsapp { background: #25D366; }
.share-twitter  { background: #000; }
.share-email    { background: #EA4335; }
.share-copy     { background: var(--color-primary); }
