@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

:root {
  --accent: #1a4fa0;
  --accent-light: #e8eef8;
  --accent-2: #1a6b3c;
  --accent-3: #6c3483;
  --text: #1a1a1a;
  --muted: #555;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --border: #e0e0e0;
  --max-w: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* === HEADER === */
.site-header {
  background: var(--accent);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo { font-size: 1.35rem; font-weight: 900; color: white; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo span { color: #ffd700; }
.logo .en-tag { background: rgba(255,255,255,0.25); color: white; font-size: 0.65rem; padding: 2px 7px; border-radius: 4px; font-weight: 700; letter-spacing: 1px; font-family: monospace; }
nav a { color: rgba(255,255,255,0.85); text-decoration: none; margin-right: 18px; font-size: 0.88rem; font-weight: 600; }
nav a:hover, nav a.active { color: white; }
nav a:first-child { margin-right: 0; }

/* === AD SLOTS === */
.ad-slot { background: #f0f0f0; border: 1px dashed #ccc; text-align: center; color: #999; font-size: 0.8rem; padding: 20px; }
.ad-top { display: block; width: 100%; min-height: 90px; }
.ad-mid { margin: 32px 0; min-height: 250px; border-radius: 8px; }
.ad-sidebar { min-height: 200px; border-radius: 8px; }

/* === LAYOUT === */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding: 40px 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; padding: 20px; }
  nav { display: none; }
}

/* === ARTICLE === */
h1 { font-size: 1.75rem; font-weight: 900; line-height: 1.4; margin-bottom: 12px; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 32px 0 14px; border-right: 4px solid var(--accent); padding-right: 12px; }
h3 { font-size: 1rem; font-weight: 700; margin: 22px 0 10px; color: var(--accent); }
p { margin-bottom: 16px; }
ul, ol { margin: 0 24px 18px 0; }
li { margin-bottom: 8px; }
.meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }

/* === TEMPLATE BOX (English copy-paste templates) === */
.template-box {
  background: #f0f4ff;
  border: 1px solid #c5d3f0;
  border-right: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 24px 0;
}
.template-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
  direction: rtl;
  text-align: right;
}
.template-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.93rem;
  line-height: 1.9;
  color: #1a2a4a;
  white-space: pre-wrap;
  display: block;
  direction: ltr;
  text-align: left;
  background: white;
  border: 1px solid #d0daf0;
  border-radius: 6px;
  padding: 16px 20px;
  margin-top: 8px;
}
.template-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 10px;
  display: block;
  direction: rtl;
  text-align: right;
  font-style: italic;
}

/* === PHRASE BOX (English phrase + Arabic explanation) === */
.phrase-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 12px 0;
}
.phrase-en { font-weight: 700; color: var(--accent); font-size: 1rem; direction: ltr; text-align: left; display: block; margin-bottom: 4px; }
.phrase-ar { font-size: 0.88rem; color: var(--muted); display: block; margin-bottom: 4px; }
.phrase-use { font-size: 0.8rem; color: #777; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; display: block; }

/* === MISTAKE LIST === */
.mistake-list { list-style: none; margin: 0 0 24px 0; padding: 0; counter-reset: mistakes; }
.mistake-list > li {
  counter-increment: mistakes;
  padding: 18px 70px 18px 18px;
  margin-bottom: 14px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-right: 4px solid #dc2626;
  border-radius: 0 8px 8px 0;
  position: relative;
}
.mistake-list > li::before {
  content: counter(mistakes);
  position: absolute;
  right: 18px;
  top: 20px;
  width: 34px;
  height: 34px;
  background: #dc2626;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}
.mistake-wrong { color: #dc2626; font-weight: 700; direction: ltr; text-align: left; margin: 8px 0 4px; font-size: 0.93rem; }
.mistake-wrong::before { content: "✗ "; }
.mistake-right { color: #16a34a; font-weight: 700; direction: ltr; text-align: left; margin: 4px 0 8px; font-size: 0.93rem; }
.mistake-right::before { content: "✓ "; }

/* === APP CARDS === */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; margin: 24px 0; }
.app-card { background: var(--bg-light); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 8px; padding: 20px; }
.app-name { font-weight: 900; font-size: 1.05rem; color: var(--accent); margin-bottom: 4px; }
.app-price { font-size: 0.85rem; font-weight: 700; color: #16a34a; margin-bottom: 10px; }
.app-desc { font-size: 0.87rem; color: var(--muted); line-height: 1.6; }
.free-badge { display: inline-block; background: #dcfce7; color: #16a34a; padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; margin-bottom: 6px; }
.paid-badge { display: inline-block; background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; margin-bottom: 6px; }

/* === STEPS LIST === */
.steps-list { list-style: none; margin: 0 0 24px 0; padding: 0; counter-reset: steps; }
.steps-list li {
  counter-increment: steps;
  padding: 14px 60px 14px 16px;
  margin-bottom: 12px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
}
.steps-list li::before {
  content: counter(steps);
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}

/* === HIGHLIGHT / TIP BOXES === */
.highlight-box { background: var(--accent-light); border-right: 4px solid var(--accent); padding: 18px 20px; margin: 24px 0; border-radius: 0 8px 8px 0; }
.highlight-box p { margin: 0; }
.tip-box { background: #fffbeb; border: 1px solid #fcd34d; border-right: 4px solid #f59e0b; padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 24px 0; font-size: 0.95rem; }
.tip-box p { margin: 0; }

/* === SISTER SITE BOXES === */
.sister-box { background: #f0f9f4; border-right: 4px solid var(--accent-2); padding: 16px 20px; margin: 28px 0; border-radius: 0 8px 8px 0; font-size: 0.95rem; }
.sister-box p { margin: 0; }
.sister-box a { color: var(--accent-2); font-weight: 700; }
.ai-box { background: #faf5ff; border-right: 4px solid var(--accent-3); padding: 16px 20px; margin: 28px 0; border-radius: 0 8px 8px 0; font-size: 0.95rem; }
.ai-box p { margin: 0; }
.ai-box a { color: var(--accent-3); font-weight: 700; }

/* === COMPARE TABLE === */
.compare-table { width: 100%; border-collapse: collapse; margin: 28px 0; font-size: 0.93rem; overflow-x: auto; display: block; }
.compare-table th { background: var(--accent); color: white; padding: 12px 16px; text-align: right; font-weight: 700; }
.compare-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: right; }
.compare-table tr:nth-child(even) td { background: #f0f4ff; }
.compare-table .yes { color: #16a34a; font-weight: 700; }
.compare-table .no { color: #dc2626; }
.compare-table .partial { color: #d97706; font-weight: 600; }

/* === SIDEBAR === */
.sidebar-section { background: var(--bg-light); border-radius: 8px; padding: 20px; margin-bottom: 24px; border: 1px solid var(--border); }
.sidebar-section h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; border-bottom: 2px solid var(--accent); padding-bottom: 8px; }
.sidebar-section ul { list-style: none; margin: 0; padding: 0; }
.sidebar-section li { margin-bottom: 10px; }
.sidebar-section a { color: var(--text); font-size: 0.9rem; text-decoration: none; }
.sidebar-section a:hover { color: var(--accent); }
.sidebar-section.sister-green { border-color: #a7d4b5; }
.sidebar-section.sister-green h3 { color: #1a6b3c; border-bottom-color: #1a6b3c; }
.sidebar-section.sister-green a:hover { color: #1a6b3c; }
.sidebar-section.sister-purple { border-color: #d8b4f0; }
.sidebar-section.sister-purple h3 { color: #6c3483; border-bottom-color: #6c3483; }
.sidebar-section.sister-purple a:hover { color: #6c3483; }

/* === FOOTER === */
.site-footer { background: #0d2a60; color: rgba(255,255,255,0.8); padding: 28px 0; margin-top: 60px; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.site-footer p { font-size: 0.88rem; }
.site-footer nav a { color: rgba(255,255,255,0.7); font-size: 0.88rem; margin-right: 20px; text-decoration: none; }
.site-footer nav a:hover { color: white; }
.site-footer nav a:first-child { margin-right: 0; }
.sister-link-green { color: #4ade80 !important; font-weight: 700; }
.sister-link-purple { color: #c084fc !important; font-weight: 700; }
