* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #000;
    color: #fff;

}

.app {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 350px;
    height: 100vh;
}

/* Sidebar gauche */
.sidebar {
    border-right: 1px solid #262626;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    height: 40px;
}

.nav-main,
.nav-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #f5f5f5;
    text-decoration: none;
    font-size: 15px;
}

.nav-item i {
    font-size: 18px;
}

.nav-item:hover,
.nav-item.active {
    background: #111;
}

/* Feed central */
.feed {
    border-right: 1px solid #262626;
    padding: 24px 40px;
    overflow-y: auto; /* garde le scroll */
    -ms-overflow-style: none; /* IE / Edge */
    scrollbar-width: none; /* Firefox */
}

.feed::-webkit-scrollbar { /* Chrome / Safari / Opera */
    display: none;
}

/* Stories */
.stories {
    display: flex;
    gap: 16px;
    padding: 16px 0 24px;
    border-bottom: 1px solid #262626;
    margin-bottom: 24px;
    align-items: center;
    justify-content: center;
}

.story.close-friend {
    background: linear-gradient(45deg, #00ff95, #00c851);
    padding: 4px; /* un peu plus que 3px pour couvrir l’ancien bord */
}

.story-close-friends-badge {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: #00c851; /* vert */
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: none; /* caché par défaut */
    align-items: center;
    gap: 4px;
}

.story-close-friends-badge::before {
    content: "★";
    font-size: 11px;
}

/* Post */
.post {
    max-width: 600px;
    margin: 0 auto 40px;
    background: #000;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.post-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #444;
}

.username {
    font-size: 14px;
    font-weight: 600;
}

.time {
    font-size: 12px;
    color: #a8a8a8;
}

.post-image img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #262626;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    font-size: 22px;
}

.post-actions .left i {
    margin-right: 12px;
}

.post-actions i {
    cursor: pointer;
}

.post-actions i:hover {
    opacity: 0.7;
}

.post-likes {
    font-size: 14px;
    font-weight: 600;
    padding: 0 4px;
}

.post-caption {
    padding: 4px 4px 0;
    font-size: 14px;
}

.post-comments-link {
    padding: 4px 4px 8px;
    font-size: 13px;
    color: #a8a8a8;
}

.post-add-comment {
    border-top: 1px solid #262626;
    padding-top: 8px;
}

.post-add-comment input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
}

/* Colonne droite */
.rightbar {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-mini .avatar {
    width: 48px;
    height: 48px;
}

.profile-mini .info .sub {
    font-size: 12px;
    color: #a8a8a8;
}

.switch,
.follow,
.see-all {
    border: none;
    background: none;
    color: #0095f6;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.suggest-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #a8a8a8;
}

.suggest-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggest-item .avatar {
    width: 40px;
    height: 40px;
}

.suggest-item .info .sub {
    font-size: 12px;
    color: #a8a8a8;
}

.footer {
    margin-top: auto;
    font-size: 11px;
    color: #737373;
}

/* Responsive */
@media (max-width: 1100px) {
    .app {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .rightbar {
        display: none;
    }

    .logo {
        display: none;
    }

    .nav-item span {
        display: none;
    }
}

@media (max-width: 700px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        flex-direction: row;
        justify-content: space-around;
        border-right: none;
        border-top: 1px solid #262626;
        padding: 8px 0;
    }

    .feed {
        padding: 16px;
        padding-bottom: 70px;
    }
}

/* Stories avec image */
.story {
    width: 78px; /* augmente la taille ici (ex : 78 au lieu de 66) */
    height: 78px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
}

.story img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #000;
}

/* Avatars globaux (post, profil, recommandés) */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: #444;
}

.profile-mini .avatar {
    width: 48px;
    height: 48px;
}

.suggest-item .avatar {
    width: 40px;
    height: 40px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay story plein écran */
.story-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.story-viewer.active {
    display: flex;
}

/* Conteneur 9:16 */
.story-viewer-content {
    position: relative;
    aspect-ratio: 9 / 16;
    max-height: 90vh;
    max-width: 90vw;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}


/* Image qui remplit la story */
.story-viewer-content img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* comme sur Instagram */
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.story-name {
    font-size: 12px;
    color: #f5f5f5;
    max-width: 80px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bouton fermer */
.story-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    z-index: 1;
}

.story-viewer-header {
    position: absolute;
    top: 18px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 3;
    color: #fff;
}

/* avatar un peu plus grand */
.avatar-small {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-username {
    font-size: 18px; /* au lieu de 14px */
    font-weight: 600;
    font-weight: bold;
}

.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: #fff;
    font-size: 26px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}

.story-nav.prev {
    left: 10px;
}

.story-nav.next {
    right: 10px;
}

.story-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.story-progress {
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 3;
}

.story-progress-segment {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    overflow: hidden;
}

.story-progress-segment span {
    display: block;
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: inherit;
    transition: width 0.3s linear;
}

.story-header-text {
    display: flex;
    flex-direction: column;
}

.story-time {
    font-size: 12px;
    opacity: 0.9;
}

.story-header-icons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.story-header-icons button {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.story-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px; /* moins de padding à gauche pour coller la PP */
    border-radius: 9999px; /* pilule bien arrondie */
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* texte dedans */
.story-header-text {
    display: flex;
    flex-direction: column;
}

.story-username {
    font-size: 18px;
    font-weight: 600;
}

.story-time {
    font-size: 12px;
    opacity: 0.9;
}

.post-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3; /* comme Instagram feed vertical */
    border-radius: 8px;
    border: 1px solid #262626;
    overflow: hidden;
}

.post-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid #262626;
}

.post-slide {
    width: 100%;
    height: 100%;
    display: none;
}

.post-slide.active {
    display: block;
}

.post-slide img,
.post-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* recadre pour remplir sans déformer */
    display: block;
}

.post-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
}

.post-arrow.prev {
    left: 10px;
}

.post-arrow.next {
    right: 10px;
}

.post-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.story-reply-bar {
    position: absolute;
    bottom: 16px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3;
}

.story-reply-input {
    flex: 1;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.story-reply-input span {
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* icônes coeur / envoyer */
.story-reply-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
}

.story-reply-actions i {
    cursor: pointer;
}


.logo img {
    height: 100%;
    width: auto;
    display: block;
}

.post-actions .fa-heart.liked {
    color: #ff3040;
}

.post-actions .fa-bookmark.saved {
    color: #ffd700; /* doré pour les posts enregistrés */
}

/* Zone des commentaires ajoutés */
.post-comments-dynamic {
    padding: 4px 4px 8px; /* espace autour du texte */
    font-size: 13px;
}

/* Chaque commentaire */
.post-comment {
    margin-top: 2px; /* petit espace entre les commentaires */
}

/* Pseudo du commentaire (déjà utilisé ailleurs) */
.post-comment .username {
    font-weight: 600;
    margin-right: 4px;
}

/* Espace entre les commentaires et la barre d'ajout */
.post-add-comment {
    border-top: 1px solid #262626;
    padding-top: 5px; /* un peu plus que 8px pour décoller */
    margin-top: 1px; /* espace au-dessus de la barre */
}

.story-commercial-badge {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    display: none;
    align-items: center;
    white-space: nowrap;
}