:root {
    --fb-bg: #18191A;
    --fb-surface: #242526;
    --fb-text: #E4E6EB;
    --fb-text-secondary: #B0B3B8;
    --fb-border: #3E4042;
    --fb-blue: #2D88FF;
    --fb-hover: #3A3B3C;
    --app-width: 500px; /* Plus large qu'Insta pour simuler le feed tablette/desktop mobile */
    --font-family: Segoe UI, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { background-color: #000; font-family: var(--font-family); color: var(--fb-text); display: flex; justify-content: center; min-height: 100vh; overflow-x: hidden;}

.fb-container { width: 100%; max-width: var(--app-width); min-height: 100dvh; background-color: var(--fb-bg); display: flex; flex-direction: column; position: relative; box-shadow: 0 0 30px rgba(0,0,0,0.8); }

/* HEADER */
.fb-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background-color: var(--fb-surface); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--fb-border);}
.header-icons { display: flex; gap: 12px; }
.icon-circle { width: 40px; height: 40px; border-radius: 50%; background-color: var(--fb-hover); display: flex; justify-content: center; align-items: center; cursor: pointer; color: var(--fb-text);}

/* COVER & PROFILE */
.fb-profile-top { background-color: var(--fb-surface); padding-bottom: 16px; margin-bottom: 8px; }
.cover-photo { width: 100%; height: 200px; background-color: #333; position: relative; overflow: hidden;}
.cover-photo img { width: 100%; height: 100%; object-fit: cover; }

.profile-info-section { padding: 0 16px; position: relative; margin-top: -60px; text-align: center; }
.profile-pic-wrapper { width: 130px; height: 130px; border-radius: 50%; border: 4px solid var(--fb-surface); margin: 0 auto 12px auto; overflow: hidden; background-color: #000; position: relative; z-index: 2;}
.fb-profile-pic { width: 100%; height: 100%; object-fit: cover; }

.page-name { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-category { font-size: 14px; color: var(--fb-text-secondary); margin-bottom: 16px; }

.action-buttons { display: flex; gap: 8px; justify-content: center; }
.action-buttons button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; border: none; }
.btn-primary { background-color: var(--fb-blue); color: #fff; flex: 1; }
.btn-secondary { background-color: var(--fb-hover); color: var(--fb-text); flex: 1; }
.btn-more { background-color: var(--fb-hover); color: var(--fb-text); padding: 8px 16px !important; }

/* ABOUT SECTION */
.fb-about-section { background-color: var(--fb-surface); padding: 16px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 16px; }
.about-item { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.about-item svg { flex-shrink: 0; margin-top: 2px; }

/* TABS */
.fb-tabs { display: flex; background-color: var(--fb-surface); margin-bottom: 8px; border-top: 1px solid var(--fb-border); box-shadow: 0 1px 2px rgba(0,0,0,0.2);}
.tab { flex: 1; text-align: center; padding: 16px 0; font-weight: 600; font-size: 15px; color: var(--fb-text-secondary); cursor: pointer; position: relative;}
.tab.active { color: var(--fb-blue); }
.tab.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background-color: var(--fb-blue); }

/* FEED & POSTS */
.fb-feed { display: flex; flex-direction: column; gap: 8px; background-color: var(--fb-bg); padding-bottom: 40px;}

.fb-post { background-color: var(--fb-surface); padding-top: 12px; }
.post-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 16px; margin-bottom: 12px; }
.post-author-info { display: flex; gap: 10px; }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background-color: #000;}
.post-meta h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.post-time { font-size: 13px; color: var(--fb-text-secondary); display: flex; align-items: center; gap: 4px; margin-top: 2px;}
.post-options { color: var(--fb-text-secondary); cursor: pointer; }

.post-content { font-size: 15px; line-height: 1.4; padding: 0 16px; margin-bottom: 12px; white-space: pre-line; }

/* GRID IMAGES DANS LE POST FB */
.post-images { display: grid; gap: 2px; width: 100%; max-height: 500px; overflow: hidden; background-color: #000; cursor: pointer;}
.post-images.single { grid-template-columns: 1fr; }
.post-images.double { grid-template-columns: 1fr 1fr; }
.post-images img { width: 100%; height: 100%; object-fit: cover; max-height: 500px; }

.post-stats { display: flex; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--fb-border); color: var(--fb-text-secondary); font-size: 15px; }
.stats-left { display: flex; align-items: center; gap: 6px; }
.reaction-icon { width: 18px; height: 18px; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #fff; font-size: 10px; }
.bg-blue { background-color: var(--fb-blue); }
.bg-red { background-color: #E41E3F; }

.post-actions { display: flex; padding: 4px 16px; }
.action-btn { flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 8px 0; color: var(--fb-text-secondary); font-weight: 600; font-size: 15px; cursor: pointer; border-radius: 4px; transition: background 0.2s;}
.action-btn:hover { background-color: var(--fb-hover); }

/* MODAL IMAGE */
.fb-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.95); z-index: 100; display: none; justify-content: center; align-items: center; flex-direction: column;}
.fb-modal.active { display: flex; }
.fb-modal img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.close-modal { position: absolute; top: 20px; left: 20px; color: #fff; font-size: 30px; cursor: pointer; z-index: 101;}