/* ==========================================================================
   AfroConnect Forum — Styles frontend
   Palette : vert #1DB954, noir, blanc, gris foncé — style social/média premium
   ========================================================================== */

.afr-forum-wrapper {
	--afr-primary: #1DB954;
	--afr-primary-dark: #169943;
	--afr-black: #121212;
	--afr-dark-gray: #2b2b2b;
	--afr-light-gray: #f5f6f7;
	--afr-border: #e6e8eb;
	--afr-radius: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--afr-black);
	max-width: 1200px;
	margin: 0 auto;
}

.afr-forum-wrapper * { box-sizing: border-box; }

/* Header */
.afr-header {
	background: linear-gradient(135deg, var(--afr-black) 0%, var(--afr-dark-gray) 100%);
	border-radius: var(--afr-radius);
	padding: 24px;
	color: #fff;
	margin-bottom: 20px;
}
.afr-header-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.afr-brand-title { font-size: 26px; font-weight: 800; display: block; }
.afr-brand-subtitle { font-size: 14px; color: #cfcfcf; }
.afr-header-actions { display: flex; gap: 10px; align-items: center; }

.afr-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border-radius: 999px;
	border: 1px solid rgba(255,255,255,0.2);
	background: rgba(255,255,255,0.08);
	color: #fff;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: transform .15s ease, background .15s ease;
}
.afr-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.16); color: #fff; }
.afr-btn-primary { background: var(--afr-primary); border-color: var(--afr-primary); }
.afr-btn-primary:hover { background: var(--afr-primary-dark); }
.afr-btn-block { width: 100%; justify-content: center; }
.afr-btn.is-liked { background: #e0245e; border-color: #e0245e; }
.afr-btn.is-following { background: var(--afr-primary); border-color: var(--afr-primary); }

.afr-icon-btn {
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 999px;
	color: #fff;
	padding: 8px 14px;
	cursor: pointer;
	position: relative;
}
.afr-badge {
	background: #e0245e;
	color: #fff;
	border-radius: 999px;
	padding: 1px 6px;
	font-size: 11px;
	margin-left: 4px;
}
.afr-notif-wrap { position: relative; }
.afr-notif-dropdown {
	display: none;
	position: absolute;
	right: 0;
	top: 44px;
	background: #fff;
	color: var(--afr-black);
	width: 280px;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.2);
	overflow: hidden;
	z-index: 50;
}
.afr-notif-dropdown.is-open { display: block; }
.afr-notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--afr-border); font-size: 13px; color: var(--afr-black); text-decoration: none; }
.afr-notif-item.is-unread { background: #eafaf0; font-weight: 600; }

.afr-header-search { margin-top: 18px; position: relative; }
.afr-header-search input {
	width: 100%;
	padding: 12px 16px;
	border-radius: 999px;
	border: none;
	font-size: 14px;
}
.afr-search-results {
	display: none;
	position: absolute;
	top: 48px;
	left: 0;
	right: 0;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.25);
	z-index: 40;
	overflow: hidden;
}
.afr-search-results.is-open { display: block; }
.afr-search-results a { display: block; padding: 10px 14px; color: var(--afr-black); text-decoration: none; border-bottom: 1px solid var(--afr-border); font-size: 14px; }
.afr-search-results a:hover { background: var(--afr-light-gray); }

.afr-nav { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.afr-nav a { color: #d8d8d8; text-decoration: none; font-size: 14px; font-weight: 600; }
.afr-nav a:hover { color: #fff; }

/* Body layout */
.afr-forum-body { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
@media (max-width: 900px) { .afr-forum-body { grid-template-columns: 1fr; } }

.afr-section { margin-bottom: 28px; }
.afr-section h2 { font-size: 19px; margin-bottom: 12px; }

/* Categories grid */
.afr-categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.afr-category-card {
	background: #fff;
	border: 1px solid var(--afr-border);
	border-top: 4px solid var(--afr-cat-color, var(--afr-primary));
	border-radius: var(--afr-radius);
	padding: 16px;
	text-decoration: none;
	color: var(--afr-black);
	display: flex;
	flex-direction: column;
	gap: 4px;
	transition: transform .15s ease, box-shadow .15s ease;
}
.afr-category-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); color: var(--afr-black); }
.afr-category-icon { font-size: 26px; }
.afr-category-name { font-weight: 700; }
.afr-category-desc { font-size: 12px; color: #666; }

/* Topics list */
.afr-topics-list { display: flex; flex-direction: column; gap: 10px; }
.afr-topic-card {
	display: flex;
	gap: 12px;
	background: #fff;
	border: 1px solid var(--afr-border);
	border-radius: var(--afr-radius);
	padding: 14px;
	transition: box-shadow .15s ease;
}
.afr-topic-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
.afr-topic-card.is-pinned { border-left: 4px solid var(--afr-primary); }
.afr-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.afr-avatar-lg { width: 100px; height: 100px; }
.afr-topic-main { flex: 1; min-width: 0; }
.afr-topic-meta-top { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.afr-topic-cat { font-size: 11px; font-weight: 700; color: var(--afr-cat-color, var(--afr-primary)); background: color-mix(in srgb, var(--afr-cat-color, var(--afr-primary)) 12%, white); padding: 3px 8px; border-radius: 999px; }
.afr-topic-title { font-size: 16px; font-weight: 700; color: var(--afr-black); text-decoration: none; display: block; margin-bottom: 6px; }
.afr-topic-title:hover { color: var(--afr-primary); }
.afr-topic-meta-bottom { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: #666; }

/* Single topic */
.afr-single-topic { background: #fff; border: 1px solid var(--afr-border); border-radius: var(--afr-radius); padding: 24px; }
.afr-topic-header h1 { font-size: 24px; margin: 10px 0; }
.afr-topic-author-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.afr-author-name { font-weight: 700; color: var(--afr-black); text-decoration: none; }
.afr-topic-date { color: #888; font-size: 12px; display: block; }
.afr-topic-content { line-height: 1.7; margin-bottom: 16px; }
.afr-topic-image { max-width: 100%; border-radius: 10px; margin-bottom: 16px; }
.afr-topic-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0; border-top: 1px solid var(--afr-border); border-bottom: 1px solid var(--afr-border); padding: 14px 0; }
.afr-topic-actions .afr-btn { background: var(--afr-light-gray); color: var(--afr-black); border-color: var(--afr-border); }
.afr-topic-actions .afr-btn.is-liked { background: #ffe1ea; color: #e0245e; border-color: #ffc2d4; }
.afr-topic-actions .afr-btn.is-following { background: #e6f9ee; color: var(--afr-primary-dark); border-color: #bdeed2; }
.afr-share { margin-left: auto; display: flex; gap: 10px; }
.afr-share a { font-size: 13px; color: var(--afr-primary-dark); text-decoration: none; font-weight: 600; }

.afr-poll { background: var(--afr-light-gray); border-radius: var(--afr-radius); padding: 16px; margin: 16px 0; }
.afr-poll h3 { margin-top: 0; }
.afr-poll-option {
	display: flex;
	justify-content: space-between;
	width: 100%;
	background: #fff;
	border: 1px solid var(--afr-border);
	border-radius: 8px;
	padding: 10px 14px;
	margin-bottom: 8px;
	cursor: pointer;
	font-size: 14px;
}
.afr-poll-option:hover:not(:disabled) { border-color: var(--afr-primary); }
.afr-poll-option:disabled { cursor: default; opacity: 0.85; }

.afr-replies { margin-top: 20px; }
.afr-reply { display: flex; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--afr-border); }
.afr-reply-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; font-size: 13px; }
.afr-reply-meta span { color: #888; font-size: 12px; }
.afr-reply-content { line-height: 1.6; font-size: 14.5px; }
.afr-reply-actions { display: flex; gap: 10px; margin-top: 6px; }
.afr-btn-mini { background: var(--afr-light-gray); border: 1px solid var(--afr-border); border-radius: 999px; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.afr-btn-mini.is-liked { background: #ffe1ea; color: #e0245e; border-color: #ffc2d4; }

.afr-reply-form { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.afr-reply-form textarea { border-radius: 10px; border: 1px solid var(--afr-border); padding: 12px; font-size: 14px; resize: vertical; }
.afr-closed-notice, .afr-login-notice { text-align: center; color: #777; padding: 16px 0; }

.afr-similar-topics { margin-top: 28px; }

/* Sidebar */
.afr-sidebar { display: flex; flex-direction: column; gap: 18px; }
.afr-sidebar-block { background: #fff; border: 1px solid var(--afr-border); border-radius: var(--afr-radius); padding: 16px; }
.afr-sidebar-block h3 { font-size: 14px; margin: 0 0 10px; }
.afr-sidebar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.afr-sidebar-list a { color: var(--afr-black); text-decoration: none; font-size: 13.5px; }
.afr-sidebar-list a:hover { color: var(--afr-primary); }

.afr-stats-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.afr-stat { text-align: center; background: var(--afr-light-gray); border-radius: 10px; padding: 10px; }
.afr-stat-num { display: block; font-size: 18px; font-weight: 800; color: var(--afr-primary-dark); }
.afr-stat-label { font-size: 11px; color: #666; }

.afr-active-members { display: flex; flex-direction: column; gap: 10px; }
.afr-member-card { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--afr-black); }
.afr-member-name { font-weight: 700; font-size: 13.5px; display: block; }
.afr-member-count { font-size: 11px; color: #888; }

/* Profile */
.afr-profile-card { background: #fff; border: 1px solid var(--afr-border); border-radius: var(--afr-radius); padding: 28px; text-align: center; margin-bottom: 24px; }
.afr-profile-bio { color: #555; }
.afr-profile-since { color: #999; font-size: 12px; }
.afr-profile-stats { display: flex; justify-content: center; gap: 30px; margin: 18px 0; }
.afr-profile-stats strong { display: block; font-size: 20px; }
.afr-profile-stats span { font-size: 12px; color: #777; }
.afr-profile-badges { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.afr-badge-chip { background: var(--afr-light-gray); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; }

/* Category header */
.afr-category-header { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--afr-border); border-left: 6px solid var(--afr-cat-color, var(--afr-primary)); border-radius: var(--afr-radius); padding: 20px; margin-bottom: 16px; }
.afr-category-icon-lg { font-size: 40px; }

.afr-pagination { display: flex; justify-content: space-between; margin-top: 16px; }
.afr-pagination .afr-btn { background: var(--afr-light-gray); color: var(--afr-black); }

.afr-empty { color: #888; text-align: center; padding: 30px; }

/* Modal */
.afr-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.afr-modal.is-open { display: flex; }
.afr-modal-content { background: #fff; border-radius: var(--afr-radius); padding: 26px; width: 92%; max-width: 520px; max-height: 88vh; overflow-y: auto; position: relative; }
.afr-modal-close { position: absolute; top: 14px; right: 18px; border: none; background: none; font-size: 24px; cursor: pointer; }
.afr-modal-content form { display: flex; flex-direction: column; gap: 4px; }
.afr-modal-content label { font-size: 13px; font-weight: 600; margin-top: 10px; }
.afr-modal-content input[type="text"],
.afr-modal-content input[type="url"],
.afr-modal-content select,
.afr-modal-content textarea {
	border: 1px solid var(--afr-border);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
}
.afr-form-message { font-size: 13px; margin-top: 10px; text-align: center; }

/* Mobile */
@media (max-width: 600px) {
	.afr-header-top { flex-direction: column; align-items: flex-start; }
	.afr-share { margin-left: 0; }
	.afr-topic-actions { flex-direction: column; align-items: stretch; }
}
