/*
Theme Name: Sahar Al-Bayan (سحر البيان)
Theme URI: https://example.com
Author: Sahar Al-Bayan Team
Description: قالب تعليمي احترافي متكامل لمنصة سحر البيان المتخصصة في التعبيرات الاصطلاحية (Idioms) بين الإنجليزية والعربية.
Version: 2.0.0
Text Domain: sahar-bayan
*/

:root {
  --bg-main: #f4f7f8;
  --bg-card: #ffffff;
  --bg-subtle: #eef3f5;
  --text-main: #0f292e;
  --text-muted: #4a6368;
  --border-color: #dce5e7;
  --brand-dark: #062126;
  --brand-teal: #0b3940;
  --accent-lime: #70e000;
  --accent-gold: #d49422;
  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;
  --danger-text: #be123c;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #15803d;
  --shadow-sm: 0 4px 14px rgba(6, 33, 38, 0.06);
  --shadow-md: 0 12px 30px rgba(6, 33, 38, 0.11);
}

body.dark-mode {
  --bg-main: #05181c;
  --bg-card: #09262c;
  --bg-subtle: #0d323a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #16444d;
  --danger-bg: rgba(190, 18, 60, 0.16);
  --danger-border: rgba(244, 63, 94, 0.35);
  --danger-text: #fda4af;
  --success-bg: rgba(21, 128, 61, 0.16);
  --success-border: rgba(34, 197, 94, 0.35);
  --success-text: #86efac;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.75;
  direction: rtl;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
}

.en-text {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  direction: ltr;
  unicode-bidi: isolate;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 18px;
}

/* قسم البطل والبحث الفوري */
.hero-section {
  background: linear-gradient(135deg, #062126 0%, #0b3940 60%, #07262c 100%);
  color: #ffffff;
  padding: 54px 18px 66px;
  text-align: center;
  border-bottom: 3px solid rgba(112, 224, 0, 0.4);
  position: relative;
}

.hero-badge {
  display: inline-block;
  background: rgba(242, 193, 78, 0.15);
  border: 1px solid rgba(242, 193, 78, 0.5);
  color: #fff3b0;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-title {
  font-size: 2.3rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero-subtitle {
  color: #cbd5e1;
  max-width: 700px;
  margin: 0 auto 28px;
  font-size: 1.08rem;
}

.search-box-wrap {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.search-form {
  display: flex;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 22px;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 999px;
  color: #0f292e;
}

.search-btn {
  background: #0b3940;
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.search-btn:hover {
  background: #70e000;
  color: #062126;
}

.live-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  z-index: 1100;
  text-align: right;
  overflow: hidden;
  display: none;
}

.live-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.15s;
}

.live-search-item:hover {
  background: var(--bg-subtle);
}

/* شريط التصنيفات السريع */
.quick-cats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.quick-cat-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.quick-cat-pill:hover {
  background: rgba(112, 224, 0, 0.22);
  border-color: #70e000;
  color: #ffffff;
}

/* بطاقة تعبير اليوم المميزة */
.wotd-banner {
  background: var(--bg-card);
  border: 2px solid rgba(112, 224, 0, 0.45);
  border-radius: 22px;
  padding: 28px;
  margin: -34px auto 40px;
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
}

@media (max-width: 820px) {
  .wotd-banner {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }
}

.wotd-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 148, 34, 0.15);
  color: var(--accent-gold);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 10px;
}

/* البطاقات وشبكة التعبيرات */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  position: relative;
  padding-right: 14px;
}

.section-title::before {
  content: "";
  position: absolute;
  right: 0;
  top: 5px;
  bottom: 5px;
  width: 5px;
  border-radius: 4px;
  background: var(--accent-lime);
}

.idioms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 22px;
  margin-bottom: 48px;
}

.idiom-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.idiom-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-lime);
}

.card-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.cat-badge {
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.level-badge {
  color: var(--accent-gold);
  font-weight: 700;
}

.idiom-phrase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.idiom-phrase {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
}

.idiom-phrase:hover {
  color: #16a34a;
}

.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-action-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.icon-action-btn:hover,
.icon-action-btn.is-saved {
  background: var(--accent-lime);
  color: #062126;
  border-color: var(--accent-lime);
}

.idiom-arabic-eq {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--success-text);
  margin-bottom: 10px;
}

.idiom-excerpt {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 16px;
}

.card-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* صفحة التعبير المفردة */
.breadcrumb {
  margin: 22px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
}

.single-idiom-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  margin: 22px auto 60px;
}

@media (max-width: 960px) {
  .single-idiom-wrap {
    grid-template-columns: 1fr;
  }
}

.idiom-hero-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.idiom-main-title {
  font-size: 2.15rem;
  font-weight: 800;
  margin: 8px 0 6px;
}

.phonetic-line {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.meaning-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .meaning-grid {
    grid-template-columns: 1fr;
  }
}

.meaning-box {
  background: var(--bg-subtle);
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

.meaning-box h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.meaning-box p {
  font-size: 1.12rem;
  font-weight: 700;
}

.content-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.content-block h2 {
  font-size: 1.28rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.example-item {
  background: var(--bg-subtle);
  border-right: 4px solid var(--accent-lime);
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.example-en {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.example-ar {
  color: var(--text-muted);
  font-size: 0.96rem;
}

.mistake-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .mistake-compare {
    grid-template-columns: 1fr;
  }
}

.mistake-wrong {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  padding: 16px;
  border-radius: 12px;
}

.mistake-right {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  padding: 16px;
  border-radius: 12px;
}

/* الاختبار التفاعلي السريع */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.quiz-opt-btn {
  text-align: right;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-opt-btn:hover {
  border-color: var(--accent-lime);
}

.quiz-opt-btn.correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.quiz-opt-btn.wrong {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

/* الصفحات الثابتة */
.static-page-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 36px;
  margin: 36px auto 60px;
  max-width: 920px;
  box-shadow: var(--shadow-sm);
}

.static-page-box h1 {
  font-size: 1.95rem;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-color);
}

.static-page-content p {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

/* الترقيم */
.pagination-wrap .nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 50px;
}

.pagination-wrap .page-numbers {
  padding: 8px 15px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-decoration: none;
  font-weight: 700;
}

.pagination-wrap .page-numbers.current {
  background: #0b3940;
  color: #ffffff;
  border-color: #0b3940;
}

/* الفوتر */
.site-footer {
  background: #062126;
  color: #cbd5e1;
  padding: 48px 18px 24px;
  border-top: 2px solid rgba(112, 224, 0, 0.35);
  margin-top: 60px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: #70e000;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 0.88rem;
  color: #94a3b8;
}