/* ═══════════════════════════════════════════════════
   TunisiaGsm - Main Stylesheet
   RTL Arabic | Bootstrap 5 | Production
═══════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─────────────────────────────── */
:root {
  --primary: #1a56db;
  --primary-dark: #1341b0;
  --primary-light: #e8f0fe;
  --secondary: #0e9f6e;
  --accent: #ff6b35;
  --dark: #111827;
  --dark-2: #1f2937;
  --dark-3: #374151;
  --gray: #6b7280;
  --light-gray: #f3f4f6;
  --border: #e5e7eb;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-main: 'Cairo', 'Tajawal', sans-serif;
  --transition: 0.25s ease;
  --nav-height: 64px;
}

/* ─── BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.7;
  color: var(--dark);
  background: #f8fafc;
  direction: rtl;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ─── TYPOGRAPHY ────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.35; color: var(--dark); }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

/* ─── NAVBAR ────────────────────────────────────── */
#mainNav {
  background: var(--dark);
  min-height: var(--nav-height);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  transition: background var(--transition);
}

#mainNav.scrolled { background: rgba(17,24,39,0.97); backdrop-filter: blur(10px); }

.logo-icon {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: white;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

.navbar-nav .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 600;
  padding: 0.5rem 0.9rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex; align-items: center; gap: 5px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: white !important;
  background: rgba(255,255,255,0.1);
}

.btn-google {
  background: white;
  color: var(--dark) !important;
  font-weight: 600;
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 13px;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}

.btn-google:hover {
  background: #f1f3f4;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

/* Search Form */
.search-form { position: relative; }

.search-form .form-control {
  border-radius: 50px 0 0 50px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  padding-right: 1.2rem;
  width: 220px;
  transition: all var(--transition);
}

.search-form .form-control::placeholder { color: rgba(255,255,255,0.5); }
.search-form .form-control:focus {
  background: rgba(255,255,255,0.2);
  box-shadow: none;
  border-color: transparent;
  width: 260px;
}

.search-form .btn {
  border-radius: 0 50px 50px 0;
  padding: 6px 14px;
}

/* Live Search */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0; left: 0;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  display: none;
}

.search-dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  color: var(--dark);
  font-size: 14px;
}

.search-dropdown-item:hover { background: var(--light-gray); }
.search-dropdown-item img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-sm); }

/* ─── HERO / SLIDER ─────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 60px 0 40px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ─── MAIN CONTENT ──────────────────────────────── */
.main-content { min-height: 60vh; }

/* ─── SECTION TITLE ─────────────────────────────── */
.section-title {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.section-title h2 {
  font-size: 1.3rem;
  margin: 0;
}

.section-title .title-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 0.9rem;
}

.section-title a {
  margin-right: auto;
  font-size: 13px;
  color: var(--gray);
}

/* ─── POST CARD ─────────────────────────────────── */
.post-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
  display: flex; flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card-img {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
}

.post-card-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card-img img { transform: scale(1.05); }

.post-card-cat {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
}

.post-card-body {
  padding: 18px;
  flex: 1;
  display: flex; flex-direction: column;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-title a { color: var(--dark); }
.post-card-title a:hover { color: var(--primary); }

.post-card-excerpt {
  font-size: 13px;
  color: var(--gray);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px;
  color: var(--gray);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.post-meta i { font-size: 11px; }

/* ─── FEATURED POST (large) ─────────────────────── */
.featured-post {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 400px;
  display: flex; align-items: flex-end;
  box-shadow: var(--shadow-lg);
}

.featured-post img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.featured-post-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 60%);
}

.featured-post-content {
  position: relative;
  padding: 32px;
  color: white;
}

.featured-post-content .post-card-cat { position: static; display: inline-block; margin-bottom: 12px; }

/* ─── SIDEBAR ───────────────────────────────────── */
.sidebar-widget {
  background: white;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.sidebar-widget h5 {
  font-size: 1rem;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  color: var(--dark);
}

/* ─── TRENDING LIST ─────────────────────────────── */
.trending-item {
  display: flex; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.trending-item:last-child { border-bottom: none; }

.trending-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--border);
  min-width: 28px;
  line-height: 1;
}

.trending-item:nth-child(1) .trending-num { color: var(--accent); }
.trending-item:nth-child(2) .trending-num { color: var(--gray); }
.trending-item:nth-child(3) .trending-num { color: #b08d57; }

.trending-img {
  width: 70px; height: 55px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.trending-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.trending-title a { color: inherit; }
.trending-title a:hover { color: var(--primary); }

/* ─── DOWNLOAD CARD ─────────────────────────────── */
.download-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column;
  height: 100%;
}

.download-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.download-card-icon {
  height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  background: var(--light-gray);
}

.download-card-body { padding: 16px; flex: 1; }

.download-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 700;
}

.download-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

/* ─── SINGLE POST ───────────────────────────────── */
.post-header {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.post-hero-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.post-header-body { padding: 30px; }

.post-content {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  font-size: 15.5px;
  line-height: 1.8;
}

.post-content h2, .post-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-right: 14px;
  border-right: 4px solid var(--primary);
}

.post-content p { margin-bottom: 1.1rem; }

.post-content img {
  border-radius: var(--radius-sm);
  margin: 16px auto;
  display: block;
  max-width: 100%;
  box-shadow: var(--shadow);
}

.post-content blockquote {
  border-right: 4px solid var(--accent);
  padding: 12px 20px;
  background: var(--light-gray);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
  font-style: italic;
}

.post-tags { margin: 20px 0; }

.tag-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--light-gray);
  color: var(--dark-3);
  font-size: 12px;
  font-weight: 600;
  margin: 3px;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.tag-badge:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ─── COMMENTS ──────────────────────────────────── */
.comments-section {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-top: 28px;
}

.comment-item {
  display: flex; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child { border-bottom: none; }

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

.comment-author { font-weight: 700; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--gray); }
.comment-text { margin-top: 6px; font-size: 14px; }

/* ─── BREADCRUMB ────────────────────────────────── */
.breadcrumb-section {
  background: white;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "‹";
  color: var(--gray);
}

/* ─── CONTACT FORM ──────────────────────────────── */
.contact-form-wrap {
  background: white;
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

/* ─── ADMIN ─────────────────────────────────────── */
.admin-sidebar {
  background: var(--dark);
  min-height: 100vh;
  padding: 0;
}

.admin-sidebar .sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex; align-items: center; gap: 10px;
}

.admin-sidebar .nav-link {
  color: rgba(255,255,255,0.7) !important;
  padding: 10px 20px !important;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  border-radius: 0;
  transition: all var(--transition);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: white !important;
  background: rgba(255,255,255,0.1);
  border-right: 3px solid var(--primary);
}

.admin-sidebar .nav-link i { font-size: 1rem; }

.admin-main { background: #f1f5f9; min-height: 100vh; padding: 28px; }

.admin-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--light-gray);
}

.admin-card-body { padding: 22px; }

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: white;
}

.stat-icon.bg-blue { background: var(--primary); }
.stat-icon.bg-green { background: var(--secondary); }
.stat-icon.bg-orange { background: var(--accent); }
.stat-icon.bg-purple { background: #7c3aed; }

.stat-num { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--gray); }

/* ─── TABLES ─────────────────────────────────────── */
.table-responsive { border-radius: var(--radius-sm); overflow: hidden; }

.table th {
  background: var(--light-gray);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.table-hover tbody tr:hover { background: #f8f9ff; }

/* ─── BADGES ────────────────────────────────────── */
.badge-status { font-size: 11px; padding: 4px 10px; border-radius: 50px; font-weight: 700; }
.badge-published { background: #dcfce7; color: #16a34a; }
.badge-draft { background: #fef9c3; color: #ca8a04; }
.badge-pending { background: #fee2e2; color: #dc2626; }

/* ─── FOOTER ────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.8);
  margin-top: auto;
}

.footer-top { padding: 50px 0 30px; }
.footer-bottom {
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
}

.footer-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
}

.footer-logo i { color: var(--primary); font-size: 1.6rem; }
.footer-desc { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.7; }

.widget-title {
  color: white;
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.footer-links { list-style: none; padding: 0; margin: 0; }

.footer-links li { margin-bottom: 8px; }

.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  display: flex; align-items: center; gap: 6px;
  transition: color var(--transition);
}

.footer-links a:hover { color: white; }
.footer-links a i { font-size: 10px; color: var(--primary); }

.social-links { display: flex; gap: 10px; }

.social-links a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1rem;
  transition: all var(--transition);
}

.social-links a:hover { background: var(--primary); transform: translateY(-2px); }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.tags-cloud .tag-badge {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.15);
  font-size: 11px;
}

.tags-cloud .tag-badge:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ─── BACK TO TOP ───────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 44px; height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 999;
}

.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ─── PAGINATION ────────────────────────────────── */
.page-link {
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  color: var(--primary);
  border-color: var(--border);
  font-weight: 600;
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

/* ─── FORMS ─────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  padding: 10px 14px;
  font-family: var(--font-main);
  font-size: 14px;
  transition: all var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

.form-label { font-weight: 600; font-size: 14px; margin-bottom: 6px; }

/* ─── BUTTONS ───────────────────────────────────── */
.btn {
  font-family: var(--font-main);
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  transition: all var(--transition);
}

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }

.btn-success { background: var(--secondary); border-color: var(--secondary); }
.btn-success:hover { filter: brightness(0.9); transform: translateY(-1px); }

/* ─── ALERTS ────────────────────────────────────── */
.alert { border-radius: var(--radius-sm); border: none; font-weight: 600; }

/* ─── NO IMAGE PLACEHOLDER ──────────────────────── */
.img-placeholder {
  width: 100%; height: 200px;
  background: linear-gradient(135deg, #e8f0fe, #f0f9ff);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 2.5rem;
}


/* ─── LOADING SPINNER ───────────────────────────── */
.spinner-wrap { display: flex; justify-content: center; padding: 40px; }

/* ─── SEARCH PAGE ───────────────────────────────── */
.search-page-header {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.search-highlight { background: #fef08a; padding: 0 3px; border-radius: 3px; }


/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 768px) {
  .search-form .form-control { width: 150px; }
  .search-form .form-control:focus { width: 160px; }
  .hero-section { padding: 40px 0 25px; }
  .featured-post { min-height: 260px; }
  .featured-post-content { padding: 20px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }
  .post-content { padding: 20px; }
  .admin-sidebar { min-height: auto; }
  
}



/* ─── PRINT ─────────────────────────────────────── */
@media print {
  #mainNav, .site-footer, .sidebar-widget, .back-to-top { display: none; }
  .post-content { box-shadow: none; }
  
}
.




/* ═══════════════════════════════════════════════════
   v2 — FORUM, CONSENT, ADS (uses the same design tokens)
═══════════════════════════════════════════════════ */
.btn-accent { background: var(--accent); color: #fff; border: 0; }
.btn-accent:hover { background: #e5561f; color: #fff; }

.avatar { border-radius: 50%; object-fit: cover; background: var(--light-gray); flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 110px; height: 110px; border: 4px solid #fff; box-shadow: var(--shadow); }

.notif-dot { position: absolute; top: -6px; inset-inline-end: -6px; background: #ef4444; color: #fff; font-size: 10px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; text-align: center; font-weight: 700; }

/* forum hero */
.forum-hero { background: linear-gradient(135deg, var(--dark) 0%, #1e3a5f 100%); color: #fff; padding: 34px 0; }
.forum-hero h1 { color: #fff; font-size: 1.8rem; margin: 0 0 6px; }
.forum-hero p { color: #cbd5e1; margin: 0; }
.forum-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; }
.forum-stats b { font-size: 1.25rem; display: block; line-height: 1.1; }
.forum-stats span { font-size: 12px; color: #94a3b8; }

/* category cards (tree) */
.cat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; height: 100%; transition: box-shadow var(--transition), transform var(--transition); }
.cat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-card h3 { font-size: 1.05rem; margin: 0 0 4px; }
.cat-card h3 i { color: var(--primary); margin-inline-end: 6px; }
.cat-card .cat-desc { color: var(--gray); font-size: 13px; margin-bottom: 8px; }
.cat-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.cat-sub a { font-size: 12px; background: var(--primary-light); color: var(--primary); padding: 2px 10px; border-radius: 20px; }
.cat-meta { font-size: 12px; color: var(--gray); margin-top: 10px; display: flex; gap: 14px; }

/* topic list */
.topic-list { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.topic-row { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: #fafcff; }
.topic-main { flex: 1; min-width: 0; }
.topic-title { display: block; font-weight: 700; color: var(--dark); font-size: 15px; line-height: 1.4; }
.topic-title:hover { color: var(--primary); }
.topic-meta { font-size: 12px; color: var(--gray); }
.topic-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.topic-stats { display: flex; gap: 12px; font-size: 12px; color: var(--gray); white-space: nowrap; }
@media (max-width: 640px) { .topic-stats { display: none; } }

.type-badge { font-size: 11px; font-weight: 700; color: var(--tc, #555); background: color-mix(in srgb, var(--tc, #555) 12%, #fff); padding: 2px 9px; border-radius: 20px; }
.mini-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--light-gray); color: var(--gray); }
.mini-badge.solved { background: #dcfce7; color: #15803d; }
.mini-badge.pin { background: #fef3c7; color: #b45309; }
.mini-badge.pending { background: #fef9c3; color: #a16207; }
.mini-badge.rejected { background: #fee2e2; color: #b91c1c; }
.role-badge { font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 20px; margin-inline-start: 6px; }
.role-mod { background: #ede9fe; color: #6d28d9; }
.role-trusted { background: #dbeafe; color: #1d4ed8; }

.forum-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.forum-filters .chip { font-size: 13px; padding: 4px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--border); color: var(--dark-3); }
.forum-filters .chip.active, .forum-filters .chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* topic page */
.post-box { display: flex; gap: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.post-box.best { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.15); }
.post-author { width: 150px; flex-shrink: 0; background: #f8fafc; padding: 16px 10px; text-align: center; border-inline-end: 1px solid var(--border); }
.post-author .name { font-weight: 700; font-size: 14px; display: block; word-break: break-word; }
.post-author .rank { font-size: 11px; color: var(--gray); }
.post-author .astats { font-size: 11px; color: var(--gray); margin-top: 6px; line-height: 1.6; }
.post-body { flex: 1; min-width: 0; padding: 16px 18px; }
.post-body .when { font-size: 12px; color: var(--gray); margin-bottom: 8px; }
.user-text { overflow-wrap: anywhere; line-height: 1.85; }
.user-text p { margin-bottom: .8rem; }
.user-text blockquote { border-inline-start: 3px solid var(--primary); background: var(--primary-light); padding: 8px 14px; border-radius: 6px; color: var(--dark-3); }
.user-text code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: .9em; direction: ltr; unicode-bidi: embed; }
.code-block { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow-x: auto; direction: ltr; text-align: left; font-size: 13px; }
.code-block code { background: none; color: inherit; padding: 0; }
.attach-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.attach-grid img { max-height: 180px; border-radius: 8px; border: 1px solid var(--border); }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.post-actions .act { font-size: 12px; background: none; border: 0; color: var(--gray); padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.post-actions .act:hover, .post-actions .act.active { background: var(--light-gray); color: var(--primary); }
.best-flag { background: #22c55e; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 20px; display: inline-block; margin-bottom: 8px; }
.reply-nested { margin-inline-start: 32px; }
@media (max-width: 640px) {
  .post-box { flex-direction: column; }
  .post-author { width: auto; display: flex; gap: 10px; align-items: center; text-align: start; border-inline-end: 0; border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .post-author .astats { display: none; }
  .reply-nested { margin-inline-start: 12px; }
}

.reaction-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.react-btn { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 2px 11px; font-size: 13px; cursor: pointer; transition: all var(--transition); }
.react-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.react-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 700; }

/* editor */
.md-editor { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.md-toolbar { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); background: #f8fafc; flex-wrap: wrap; }
.md-toolbar button { border: 0; background: none; padding: 3px 10px; border-radius: 6px; color: var(--dark-3); cursor: pointer; }
.md-toolbar button:hover { background: var(--border); }
.md-editor textarea { border: 0; width: 100%; min-height: 200px; padding: 12px; resize: vertical; outline: 0; background: transparent; }
.md-preview { padding: 12px; min-height: 120px; }

/* profile */
.profile-head { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px; }
.profile-stats b { display: block; font-size: 1.15rem; }
.profile-stats span { font-size: 12px; color: var(--gray); }

/* FAQ / pages */
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }
.faq-item summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: inline-end; color: var(--primary); font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-answer { padding: 0 18px 14px; color: var(--dark-3); }
.page-content h2 { margin-top: 1.6rem; font-size: 1.25rem; }

/* consent banner */
.cookie-banner { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 2000; max-width: 760px; margin-inline: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 16px 18px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cookie-body { flex: 1 1 320px; font-size: 13px; }
.cookie-body p { margin: 4px 0 0; color: var(--dark-3); }
.cookie-opts { display: grid; gap: 4px; margin-top: 8px; }
.cookie-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ads */
.ad-slot { text-align: center; margin: 18px auto; min-height: 90px; }
.ad-slot .ad-label { display: block; font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: .08em; }
.ad-top { max-width: 970px; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--gray); }
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: 8px; color: #cbd5e1; }


/* ═══ v2: navbar — full menu on desktop (>=992px), hamburger only on tablet/phone; language + sign-in always visible ═══ */
#mainNav > .container { flex-wrap: wrap; row-gap: 0; }
#mainNav .navbar-brand { margin-inline-end: .5rem; flex-shrink: 0; }
.nav-actions { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; flex-shrink: 0; }
.nav-actions .btn { white-space: nowrap; }
#mainNav .navbar-toggler { margin-inline-start: .5rem; }
#mainNav .navbar-collapse { flex-basis: 100%; }

/* ≥ 992px: one single row — menu | search | actions */
@media (min-width: 992px) {
  #mainNav > .container { flex-wrap: nowrap; }
  #mainNav .navbar-collapse { order: 2; flex-basis: auto; flex-grow: 1; min-width: 0; }
  .nav-actions { order: 3; margin-inline-start: .5rem; }
  /* compact sizing so 7 links + search + 2 buttons fit between 992 and 1399px */
  .navbar-nav .nav-link { padding: .5rem .5rem !important; font-size: 13.5px; white-space: nowrap; }
  .navbar-nav .nav-link > i { display: none; }
  .nav-actions .lbl { display: none; }                       /* icon-only buttons (tooltips on hover) */
  .logo-text { font-size: 1.15rem; }
  /* search shrinks to an icon and opens on hover/focus */
  .search-form { position: relative; }
  .search-form .form-control { width: 0; padding-inline: 0; border-width: 0; opacity: 0; transition: width .25s ease, opacity .2s ease, padding .25s ease; }
  .search-form:hover .form-control, .search-form:focus-within .form-control { width: 170px; padding-inline: .75rem; border-width: 1px; opacity: 1; }
  #searchDropdown { inset-inline-end: 0; }
}
/* ≥ 1200px: a little more room */
@media (min-width: 1200px) {
  .navbar-nav .nav-link { padding: .5rem .65rem !important; font-size: 14px; }
  .nav-actions .lbl-lang { display: inline; }                /* language name appears */
}
/* ≥ 1400px: original full-size look (icons in links, labels on buttons, always-open search) */
@media (min-width: 1400px) {
  .navbar-nav .nav-link { padding: .5rem .85rem !important; font-size: 15px; }
  .navbar-nav .nav-link > i { display: inline-block; }
  .nav-actions .lbl { display: inline; }
  .logo-text { font-size: 1.3rem; }
  .search-form .form-control { width: 190px; padding-inline: .75rem; border-width: 1px; opacity: 1; }
  .search-form .form-control:focus { width: 220px; }
}
@media (max-width: 575.98px) {
  .nav-actions .lbl { display: none; }                       /* icons only on phones */
  .nav-actions .btn-google { padding: 6px 11px; }
  .logo-text { font-size: 1.05rem; }
  #mainNav .navbar-brand { gap: 6px !important; }
}
body { overflow-x: clip; }                                   /* safety net; clip keeps the sticky navbar working */
.dropdown-menu { max-width: calc(100vw - 24px); }

/* ═══ v2: forum restyled to match the site (cards = white + soft shadow, like .post-card / .sidebar-widget) ═══ */
.topic-list, .post-box, .cat-card, .profile-head, .faq-item, .md-editor, .reply-box {
  border: 0; box-shadow: var(--shadow); border-radius: var(--radius); background: #fff;
}
.topic-list { overflow: hidden; }
.topic-row { border-bottom: 1px solid var(--light-gray); padding: 16px 18px; }
.topic-row:hover { background: var(--primary-light); }
.topic-title:hover { color: var(--primary); }
.post-author { background: var(--light-gray); border-inline-end: 0; }
.post-box { transition: box-shadow var(--transition); }
.post-box:hover { box-shadow: var(--shadow-lg); }
.post-box.best { box-shadow: 0 0 0 2px rgba(14,159,110,.35), var(--shadow); }
.cat-card { transition: transform var(--transition), box-shadow var(--transition); }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-card h3 { font-size: 1.05rem; }
.cat-sub a, .forum-filters .chip { border-radius: 50px; }
.forum-filters .chip { background: #fff; border: 1px solid var(--border); font-weight: 600; font-size: 13px; padding: 5px 14px; box-shadow: none; }
.forum-filters .chip.active, .forum-filters .chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.md-toolbar { background: var(--light-gray); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.reaction-bar .react-btn { box-shadow: none; }
.type-badge, .mini-badge, .role-badge { font-family: var(--font-main); }
.section-title .title-icon { flex-shrink: 0; }
.forum-stat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--light-gray); font-size: 14px; }
.forum-stat-row:last-child { border-bottom: 0; }
.forum-stat-row b { color: var(--primary); }
.forum-cat-link { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--light-gray); color: var(--dark); font-size: 14px; text-decoration: none; }
.forum-cat-link:hover { color: var(--primary); }
.forum-cat-link:last-child { border-bottom: 0; }
.forum-cat-link.sub { padding-inline-start: 16px; font-size: 13px; color: var(--gray); }


/* ═══════════════════════════════════════════════════════════════
   v2.1 — MODERN FORUM (cards, soft shadows, pill controls, safe avatars)
═══════════════════════════════════════════════════════════════ */
/* avatars can never be squashed by flex layouts / img{max-width:100%} */
.avatar { display: block; max-width: none; object-fit: cover; flex: 0 0 auto; border-radius: 50%; background: var(--light-gray); }
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 44px; height: 44px; min-width: 44px; }
.avatar-lg { width: 72px; height: 72px; min-width: 72px; }
.avatar-xl { width: 110px; height: 110px; min-width: 110px; }
.tc-avatar, .pc-avatar { flex: 0 0 auto; line-height: 0; }

/* ── topic list: one soft card per topic, coloured by type ── */
.topic-list { display: grid; gap: 12px; background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
.topic-row { display: flex; gap: 14px; align-items: center; background: #fff; border: 0; border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05); position: relative;
  border-inline-start: 4px solid var(--tc, var(--primary)); transition: transform .2s ease, box-shadow .2s ease; }
.topic-row:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 6px 22px rgba(15,23,42,.10); }
.topic-main { flex: 1 1 auto; min-width: 0; }
.topic-title { font-size: 16px; font-weight: 800; color: var(--dark); line-height: 1.5; display: block; overflow-wrap: anywhere; }
.topic-meta { font-size: 12.5px; color: var(--gray); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; }
.topic-meta a { color: var(--dark-3); font-weight: 600; }
.tc-cat { background: var(--primary-light); color: var(--primary) !important; padding: 1px 10px; border-radius: 50px; font-size: 12px; font-weight: 700 !important; }
.topic-stats { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tc-pill { display: inline-flex; align-items: center; gap: 5px; background: var(--light-gray); color: var(--dark-3); padding: 5px 11px; border-radius: 50px; font-size: 12.5px; font-weight: 700; }
.tc-pill i { color: var(--primary); font-size: 12px; }
.tc-solved { color: #16a34a; font-size: 1.5rem; line-height: 1; }
.topic-badges { margin-bottom: 4px; }
@media (max-width: 640px) {
  .topic-row { padding: 14px; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
  .topic-main { flex-basis: calc(100% - 60px); }
  .topic-stats { display: flex; width: 100%; padding-inline-start: 58px; margin-top: -2px; }
}

/* ── category tiles ── */
.cat-card { border: 0; border-radius: 18px; padding: 18px !important; background: #fff; position: relative; overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05); }
.cat-card::before { content: ''; position: absolute; inset-inline-end: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--primary-light); opacity: .7; }
.cat-card h3 { position: relative; display: flex; align-items: center; gap: 10px; font-size: 1.02rem; font-weight: 800; margin: 0 0 6px; }
.cat-card h3 a { color: var(--dark); }
.cat-card h3 i { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; margin: 0;
  background: linear-gradient(135deg, var(--primary), #5b9bff); color: #fff; font-size: 1.05rem; box-shadow: 0 6px 14px rgba(26,86,219,.28); }
.cat-card .cat-desc, .cat-card .cat-sub, .cat-card .cat-meta { position: relative; }
.cat-sub a { background: var(--light-gray); color: var(--dark-3); font-weight: 600; }
.cat-sub a:hover { background: var(--primary); color: #fff; }

/* ── filter chips: pill row, scrolls sideways on phones instead of wrapping into a wall ── */
.forum-filters { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 8px; scrollbar-width: none; }
.forum-filters::-webkit-scrollbar { display: none; }
.forum-filters .chip { flex: 0 0 auto; white-space: nowrap; border: 0; background: #fff; color: var(--dark-3); font-weight: 700; font-size: 13px;
  padding: 7px 16px; border-radius: 50px; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.forum-filters .chip.active { background: linear-gradient(135deg, var(--primary), #3b82f6); color: #fff; box-shadow: 0 6px 14px rgba(26,86,219,.28); }
.forum-filters .chip:hover:not(.active) { background: var(--primary-light); color: var(--primary); }

/* search pill */
.col-lg-8 > .d-flex form[role=search] .form-control { border-radius: 50px; border: 0; box-shadow: 0 1px 3px rgba(15,23,42,.10); padding-inline: 16px; min-width: 200px; }
.col-lg-8 > .d-flex form[role=search] .btn { border-radius: 50px; }
.btn-accent { border-radius: 50px; font-weight: 700; padding-inline: 18px; box-shadow: 0 6px 14px rgba(255,107,53,.28); }

/* ── post / reply cards ── */
.pc { background: #fff; border-radius: 18px; margin-bottom: 14px; overflow: hidden; position: relative;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05); }
.pc.best { box-shadow: 0 0 0 2px #22c55e, 0 8px 24px rgba(34,197,94,.18); }
.pc.best::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 4px; background: linear-gradient(90deg, #22c55e, #86efac); }
.pc-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.pc-who { min-width: 0; }
.pc-name { font-weight: 800; color: var(--dark); font-size: 15px; }
.pc-sub { font-size: 12px; color: var(--gray); margin-top: 1px; }
.pc-body { padding: 12px 20px 6px; }
.pc-body .when { font-size: 12px; color: var(--gray); margin-bottom: 8px; }
.pc .post-actions { margin: 4px 20px 14px; padding-top: 10px; border-top: 1px dashed var(--border); }
.post-actions .act { border-radius: 50px; padding: 5px 12px; font-weight: 600; }
.react-btn { border-radius: 50px; border: 0; background: var(--light-gray); padding: 4px 13px; font-weight: 700; }
.react-btn:hover { background: var(--primary-light); }
.react-btn.active { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(26,86,219,.28); }
.best-flag { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 4px 10px rgba(34,197,94,.3); }
.user-text { font-size: 15.5px; }
.user-text img, .attach-grid img { max-width: 100%; height: auto; }
.attach-grid img { max-height: 220px; width: auto; border: 0; border-radius: 12px; box-shadow: var(--shadow); }
@media (max-width: 640px) {
  .pc-head { padding: 14px 14px 0; }
  .pc-body { padding: 10px 14px 4px; }
  .pc .post-actions { margin: 4px 14px 12px; }
}

/* ── reply composer ── */
.reply-box { background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05); }
.reply-box .md-editor { box-shadow: none; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.md-toolbar button { border-radius: 8px; }
.md-editor textarea:focus { outline: 0; }
.md-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.12); }

/* ── sidebar + forms in the same language ── */
.sidebar-widget { border-radius: 18px; }
.forum-stat-row b { background: var(--primary-light); padding: 1px 12px; border-radius: 50px; }
.admin-card { border-radius: 18px; }
.profile-head { border-radius: 20px; }
.type-badge { border-radius: 50px; padding: 3px 11px; }
.mini-badge { border-radius: 50px; }
