/* Sticky footer styles
-------------------------------------------------- */
:root {
  direction: rtl;
  text-orientation: mixed;
  
  /* Brand Colors */
  --brand-primary: #2563eb;
  --brand-secondary: #9333ea;
  --brand-accent: #4c1d95;
  --brand-dark: #1d1e25;
  --brand-muted: #6b6f7b;
  --brand-light: #e8eaed;
  --brand-bg: #f5f5f5;
  --brand-card: #fafafa;
  --brand-border: rgba(16, 24, 40, 0.08);
  
  /* Typography Scale - نظام الخطوط الاحترافي */
  --font-size-base: clamp(0.9375rem, 0.85rem + 0.25vw, 1rem); /* 15px - 16px */
  
  /* Font Sizes */
  --font-size-xs: clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);      /* 12px - 13px */
  --font-size-sm: clamp(0.8125rem, 0.75rem + 0.2vw, 0.875rem);    /* 13px - 14px */
  --font-size-md: var(--font-size-base);                           /* 15px - 16px */
  --font-size-lg: clamp(1.0625rem, 0.95rem + 0.3vw, 1.125rem);    /* 17px - 18px */
  --font-size-xl: clamp(1.125rem, 1rem + 0.35vw, 1.25rem);        /* 18px - 20px */
  
  /* Headings */
  --font-size-h1: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);           /* 32px - 44px */
  --font-size-h2: clamp(1.625rem, 1.25rem + 1.2vw, 2.25rem);     /* 26px - 36px */
  --font-size-h3: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem);     /* 22px - 30px */
  --font-size-h4: clamp(1.1875rem, 1rem + 0.6vw, 1.5rem);        /* 19px - 24px */
  --font-size-h5: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);    /* 17px - 20px */
  --font-size-h6: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);         /* 16px - 18px */
  
  /* Display Sizes */
  --font-size-display-1: clamp(3rem, 2rem + 3vw, 5rem);          /* 48px - 80px */
  --font-size-display-2: clamp(2.5rem, 1.75rem + 2.5vw, 4.25rem);/* 40px - 68px */
  --font-size-display-3: clamp(2.25rem, 1.5rem + 2vw, 3.5rem);   /* 36px - 56px */
  --font-size-display-4: clamp(2rem, 1.375rem + 1.75vw, 3rem);   /* 32px - 48px */
  
  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 1.75;
  
  /* Spacing Scale */
  --space-xs: clamp(0.25rem, 0.2rem + 0.15vw, 0.375rem);    /* 4px - 6px */
  --space-sm: clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);       /* 8px - 12px */
  --space-md: clamp(0.75rem, 0.6rem + 0.45vw, 1rem);        /* 12px - 16px */
  --space-lg: clamp(1rem, 0.8rem + 0.6vw, 1.5rem);          /* 16px - 24px */
  --space-xl: clamp(1.5rem, 1.2rem + 0.9vw, 2rem);          /* 24px - 32px */
  --space-2xl: clamp(2rem, 1.5rem + 1.5vw, 3rem);           /* 32px - 48px */
  --space-3xl: clamp(2.5rem, 2rem + 2vw, 4rem);             /* 40px - 64px */
  --space-4xl: clamp(3rem, 2.5rem + 2.5vw, 5rem);           /* 48px - 80px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;    /* 6px */
  --radius-md: 0.5rem;      /* 8px */
  --radius-lg: 0.75rem;     /* 12px */
  --radius-xl: 1rem;        /* 16px */
  --radius-2xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

html {
  position: relative;
  min-height: 100%;
  font-size: 100%; /* يسمح بالتحكم من المتصفح */
}

body {
  background: #f7f8fa;
  color: #2b2d31;
  font-family: "Tajawal", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  margin-bottom: 60px; /* Margin bottom by footer height */
}

.container {
  max-width: 960px;
}

.pricing-header {
  max-width: 700px;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px; /* Set the fixed height of the footer here */
  line-height: 60px; /* Vertically center the text there */
  background-color: #f5f5f5;
}

/* Topic Detail Page Styles */
.tag-badge{ background:#eef1f4; color:#333; }
.tag-badge a{ color: inherit; text-decoration: none; }
.card{ border-radius: .75rem; box-shadow: 0 2px 8px rgba(16,24,40,.06); }
.topic-layout{ display:flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 992px){ .topic-layout{ flex-direction: row-reverse; align-items: flex-start; } }
.topic-content{ flex: 1 1 auto; }
.topic-meta{ font-size: var(--font-size-sm); color: #6c757d; }
.topic-actions .btn{ border-radius: 999px; }
.topic-quick-actions{ display:flex; flex-wrap:wrap; gap:.75rem; align-items:center; }
.topic-quick-actions .btn{ border-radius:999px; display:inline-flex; align-items:center; gap:.45rem; }
.favorite-count-badge{ background: rgba(147, 51, 234, 0.12); color:#5b21b6; border-radius:var(--radius-full); padding:var(--space-xs) var(--space-md); font-size:var(--font-size-sm); display:inline-flex; align-items:center; gap:var(--space-sm); }
.favorite-count-badge i{ color:#7c3aed; }
.favorite-toggle{ width:2.5rem; height:2.5rem; border-radius:50%; border:1px solid #d0d5dd; background:#fff; color:#94a3b8; display:inline-flex; align-items:center; justify-content:center; transition:all .2s ease; cursor: pointer; }
.favorite-toggle .icon-filled{ display:none; color:#facc15; }
.favorite-toggle .icon-outline{ font-size:1.2rem; }
.favorite-toggle.active{ border-color:#facc15; background:rgba(250,204,21,0.12); color:#facc15; box-shadow:0 4px 12px rgba(250,204,21,0.25); }
.favorite-toggle.active .icon-filled{ display:inline; }
.favorite-toggle.active .icon-outline{ display:none; }
.topic-follow-card{ border:1px solid #e2e8f0; border-radius: 1rem; padding:1.25rem 1.5rem; background:#fff; box-shadow:0 8px 24px rgba(15,23,42,0.08); }
.topic-follow-card .avatar-sm{ width:40px; height:40px; border-radius:50%; object-fit:cover; }
.tag-follow-chip{ display:inline-flex; align-items:center; gap:var(--space-sm); border-radius:var(--radius-full); padding:var(--space-sm) var(--space-lg); background:#eff6ff; color:#1d4ed8; border:1px solid #bfdbfe; font-size:var(--font-size-sm); }
.tag-follow-chip i{ color:#1d4ed8; }
.topic-header-inline{ display:flex; flex-wrap:wrap; align-items:center; gap:1rem; }
.topic-header-main{ flex:1 1 240px; min-width:0; }
.vote-widget{ display:inline-flex; align-items:center; gap:.6rem; background:#fff; border:1px solid #e5e7eb; border-radius:999px; padding:.45rem .9rem; box-shadow:0 1px 6px rgba(15,23,42,0.08); }
.vote-button{ width:40px; height:40px; border-radius:50%; border:2px solid #dee2e6; background:#fff; display:flex; align-items:center; justify-content:center; font-size:1.2rem; color:#6c757d; transition:all .2s ease; cursor:pointer; }
.vote-button:hover{ border-color:var(--brand-primary); color:var(--brand-primary); }
.vote-button.active{ border-color:var(--brand-primary); background:rgba(37,99,235,0.12); color:var(--brand-primary); }
.vote-score{ font-size:var(--font-size-h4); font-weight:700; color:var(--brand-primary); min-width:2.5rem; text-align:center; }
.vote-label{ font-size:var(--font-size-xs); color:#6c757d; }
@media (max-width: 575.98px){
  .topic-header-inline{ flex-direction:column; align-items:stretch; }
  .vote-widget{ width:100%; justify-content:space-between; padding:.5rem .75rem; }
  .vote-score{ font-size:1.25rem; }
}
.expert-badge { background: #ffd700; color: #000; }
.comment-item { background: white; border-radius: .75rem; border: 1px solid #e5e7eb; }
.comment-item-main{ border-right: 4px solid transparent; }
.comment-expert{ background: #fff8dc; border-right-color: #ffd700; }
.comment-member{ background: #f8f9fa; border-right-color: #dee2e6; }
.comment-item .badge{ font-size: .7rem; }
.accordion-button .badge{ margin-left: .5rem; }
.accordion-button:not(.collapsed) { background-color: rgba(37, 99, 235, 0.12); color: var(--brand-primary); }
.related-topic-item{ border: 1px solid #e5e7eb; border-radius: .75rem; background: #f8f9fa; padding: 1.5rem; height: 100%; transition: box-shadow .2s ease; text-decoration: none; display: block; }
.related-topic-item:hover{ box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12); }
.related-topic-title{ color: #2b2d31; font-size: var(--font-size-h5); font-weight: 600; margin-bottom: var(--space-md); }
.related-topic-excerpt{ color: #6c757d; font-size: var(--font-size-sm); margin-bottom: var(--space-md); }
.related-topic-meta{ color: #6c757d; font-size: var(--font-size-sm); }
.related-topic-tags .badge{ background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; font-size: var(--font-size-xs); }
figure img{ box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12); }

/* Content Templates */
.content-quote {
  background: linear-gradient(135deg, #2563eb 0%, #4c1d95 55%, #9333ea 100%);
  color: white;
  border-left: 5px solid #ffd700;
  padding: 1.5rem;
  border-radius: .75rem;
  margin: 1.5rem 0;
  position: relative;
}
.content-quote::before {
  content: '"';
  font-size: var(--font-size-display-2);
  position: absolute;
  top: -10px;
  right: 10px;
  opacity: 0.3;
}

.content-false-info {
  background: #fff5f5;
  border: 2px solid #dc3545;
  border-radius: .75rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.content-true-info {
  background: linear-gradient(135deg, #d4f1f4 0%, #c3f0e2 100%);
  border: 2px solid #198754;
  border-radius: .75rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.content-rule {
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border: 3px solid #f39c12;
  border-radius: .75rem;
  padding: 1.75rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}
.content-rule h5 {
  color: #7d4e00;
  font-weight: bold;
  margin: 0;
}

.content-template-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.content-template-header i {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-tight);
}

.governance-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.75rem;
  margin-top: 2.5rem;
}

.governance-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-top: 1rem;
}

.governance-controls .form-select {
  width: auto;
  min-width: 220px;
}

.governance-summary {
  background: #f8f9fa;
  border: 1px dashed #93c5fd;
  border-radius: .75rem;
  padding: 1rem;
  margin-top: 1.5rem;
}

.governance-summary-content {
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font-size: var(--font-size-md);
  color: #1f2937;
  min-height: 90px;
  line-height: var(--line-height-loose);
}

.governance-summary-content:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

.governance-summary-content[contenteditable="true"]:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.ai-tools-card {
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  border-radius: 1rem;
}

.ai-summary-preview {
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font-size: var(--font-size-sm);
  white-space: pre-wrap;
  line-height: var(--line-height-relaxed);
  color: #0f172a;
}

.ai-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.ai-insight-card {
  background: #f8fffb;
  border: 2px solid rgba(25, 135, 84, 0.35);
  border-radius: 1rem;
}

.ai-vote-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #198754;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.ai-vote-badge {
  background: rgba(25, 135, 84, 0.12);
  color: #0f5132;
  border: 1px solid rgba(25, 135, 84, 0.35);
}

.vote-summary-card {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.vote-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.vote-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: #475569;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.vote-summary-chip.text-success {
  background: rgba(25, 135, 84, 0.14);
  color: #0f5132;
}

.vote-summary-chip i {
  font-size: 1rem;
}

.vote-summary-note {
  margin-top: var(--space-md);
  font-size: var(--font-size-xs);
  color: #64748b;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
