/* =============================================
   منصة جيل الصحوة - تصميم الصفحة العامة
   ============================================= */

:root {
  --primary:       #17698B;
  --primary-dark:  #0f4d66;
  --primary-light: #e8f4f9;
  --secondary:     #38A2B0;
  --accent:        #8B7055;
  --bg:            #f5f7fa;
  --card-bg:       #ffffff;
  --border:        #e8ecf0;
  --text:          #1a2332;
  --text-muted:    #6b7280;
  --radius:        14px;
  --radius-sm:     8px;
  --shadow:        0 2px 8px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
  --shadow-hover:  0 8px 32px rgba(23,105,139,.16);
  --transition:    .2s ease;
  --fw-600: 600; --fw-700: 700; --fw-800: 800;
}

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

body {
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  margin: 0;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
.fw-700 { font-weight: 700; }

/* ============================
   Navbar
   ============================ */
.pub-navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.pub-navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}

.pub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pub-logo {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  flex-shrink: 0;
}

.pub-logo-sm { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }

.pub-brand-name { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1.1; }
.pub-brand-sub  { font-size: 11px; color: var(--text-muted); }

.pub-nav-links { display: flex; align-items: center; gap: 8px; }

.pub-nav-link {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}
.pub-nav-link:hover, .pub-nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}
.pub-nav-admin {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(23,105,139,.2);
}
.pub-nav-admin:hover { background: var(--primary); color: #fff; }

/* ============================
   Hero
   ============================ */
.pub-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--secondary) 100%);
  padding: 70px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pub-hero::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.04'%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");
}

.pub-hero-content { position: relative; max-width: 680px; margin: 0 auto; padding: 0 16px; }

.pub-hero-icon {
  width: 80px; height: 80px;
  background: rgba(255,255,255,.15);
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff;
  margin: 0 auto 20px;
  border: 2px solid rgba(255,255,255,.2);
}

.pub-hero-title { font-size: clamp(24px, 4vw, 38px); font-weight: 800; color: #fff; margin: 0 0 10px; }
.pub-hero-sub   { font-size: 16px; color: rgba(255,255,255,.8); margin: 0 0 32px; }

/* Search */
.pub-hero-search { max-width: 520px; margin: 0 auto 28px; }
.pub-search-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 50px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.pub-search-icon { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
.pub-search-input {
  flex: 1;
  border: none; outline: none;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  padding: 8px 12px;
  background: transparent;
  direction: rtl;
}
.pub-search-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 10px 24px;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.pub-search-btn:hover { background: var(--primary-dark); }

/* Stats */
.pub-hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: rgba(255,255,255,.9);
}
.pub-hero-stat-num { font-size: 28px; font-weight: 800; display: block; }
.pub-hero-stat-lbl { font-size: 13px; }
.pub-hero-stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,.3); }

/* ============================
   Filter Card
   ============================ */
.pub-filter-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: 76px;
}

.pub-filter-header {
  padding: 16px 20px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-filter-reset {
  color: rgba(255,255,255,.8);
  font-size: 12px;
  font-weight: 500;
}
.pub-filter-reset:hover { color: #fff; }

.pub-filter-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.pub-filter-section:last-child { border-bottom: none; }

.pub-filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.pub-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--card-bg);
  cursor: pointer;
}
.pub-select:focus { outline: none; border-color: var(--primary); }

.pub-tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #f3f4f6;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}
.pub-tag:hover, .pub-tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================
   Results Header
   ============================ */
.pub-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.pub-results-count { font-size: 15px; color: var(--text-muted); font-weight: 500; }
.pub-results-count strong { color: var(--primary); }

.pub-filter-toggle {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================
   Activity Cards
   ============================ */
.pub-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
  position: relative;
}

.pub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(23,105,139,.2);
}

.pub-card-img {
  width: 100%;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-light), #e0f0f5);
}

.pub-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.pub-card:hover .pub-card-img img { transform: scale(1.05); }

.pub-card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  color: var(--primary);
  opacity: .3;
}

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

.pub-card-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }

.pub-cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(23,105,139,.15);
}
.pub-cat-badge-lg { padding: 5px 14px; font-size: 13px; }
.pub-cat-more { background: #f3f4f6; color: var(--text-muted); }

.pub-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pub-card-participants {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.pub-card-arrow {
  position: absolute;
  bottom: 18px;
  left: 18px;
  width: 28px; height: 28px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--primary);
  transition: var(--transition);
}
.pub-card:hover .pub-card-arrow { background: var(--primary); color: #fff; }

/* ============================
   Detail Page
   ============================ */
.pub-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.pub-breadcrumb a { color: var(--primary); font-weight: 600; }

.pub-detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pub-detail-img { width: 100%; max-height: 400px; overflow: hidden; }
.pub-detail-img img { width: 100%; height: 100%; object-fit: cover; }

.pub-detail-body { padding: 32px; }

.pub-detail-title { font-size: 26px; font-weight: 800; color: var(--text); margin: 10px 0 16px; }

.pub-detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.pub-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.pub-detail-meta-item i { color: var(--primary); width: 16px; text-align: center; }

.pub-detail-divider { height: 1px; background: var(--border); margin: 20px 0; }

.pub-detail-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-detail-description {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}

.pub-detail-tools {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
  background: var(--bg);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--primary);
}

.pub-attachment-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}
.pub-attachment-btn:hover { background: var(--primary-dark); color: #fff; }

/* Share */
.pub-detail-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pub-share-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.pub-share-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.pub-share-btn.whatsapp  { background: #25d366; }
.pub-share-btn.telegram  { background: #0088cc; }
.pub-share-btn.copy-link { background: var(--accent); }
.pub-share-btn:hover { opacity: .85; transform: scale(1.1); }

/* Info Box */
.pub-info-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pub-info-title {
  padding: 14px 20px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.pub-info-list { list-style: none; padding: 0; margin: 0; }
.pub-info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pub-info-list li:last-child { border-bottom: none; }
.pub-info-label { color: var(--text-muted); font-weight: 500; }
.pub-info-value  { font-weight: 700; color: var(--text); }

/* Related */
.pub-related {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pub-related-title {
  padding: 14px 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.pub-related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.pub-related-item:last-child { border-bottom: none; }
.pub-related-item:hover { background: var(--bg); }
.pub-related-img {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.pub-related-img-placeholder {
  width: 52px; height: 52px;
  border-radius: 8px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 18px;
  flex-shrink: 0;
}
.pub-related-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; }
.pub-related-age  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.pub-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition);
}
.pub-back-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================
   Empty State
   ============================ */
.pub-empty {
  text-align: center;
  padding: 60px 20px;
}
.pub-empty-icon {
  font-size: 4rem;
  color: var(--primary);
  opacity: .3;
  margin-bottom: 20px;
}
.pub-empty h4 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.pub-empty p  { color: var(--text-muted); margin-bottom: 20px; }

.pub-btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}
.pub-btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* ============================
   Pagination
   ============================ */
.pub-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; }
.pub-page-btn {
  min-width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
  padding: 0 8px;
}
.pub-page-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.pub-page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================
   Footer
   ============================ */
.pub-footer {
  background: var(--primary-dark);
  padding: 32px 0;
  margin-top: 60px;
}

/* ============================
   Main padding
   ============================ */
.pub-main { min-height: calc(100vh - 68px); }

/* ============================
   Responsive
   ============================ */
@media (max-width: 991px) {
  .pub-filter-card { position: static; display: none; }
  .pub-filter-card.show { display: block; }
}

@media (max-width: 575px) {
  .pub-hero { padding: 48px 0 40px; }
  .pub-detail-body { padding: 20px; }
  .pub-hero-stats { gap: 16px; }
}
