/* استيراد خط عربي جميل لجميع الصفحات */
@font-face {
  font-family: 'Amiri';
  src: url('/font/Amiri.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'UthmanicHafs';
  src: url('/quran/quran-font/uthmanic-hafs-v20.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'UthmanicShuba';
  src: url('/quran/quran-font/uthmanic-shuba-v20.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'UthmanicWarsh';
  src: url('/quran/quran-font/uthmanic-warsh-v21.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'UthmanicQaloun';
  src: url('/quran/quran-font/uthmanic-qaloun-v21.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'UthmanicDouri';
  src: url('/quran/quran-font/uthmanic-douri-v20.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'UthmanicSousi';
  src: url('/quran/quran-font/uthmanic-sousi-v20.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* Modern, clean, and fully responsive layout */
:root {
  --primary: #1a237e;
  --secondary: #3949ab;
  --accent: #ffb300;
  --background: #f5f6fa;
  --text: #222;
  --white: #fff;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 12px;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

html, body {
  height: 100%;
}
html {
  box-sizing: border-box;
  font-size: 16px;
  scroll-behavior: smooth;
  direction: rtl;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  margin: 0;
  font-family: 'Amiri' !important;
  background: var(--background);
  background-image: url('/img/bg.jpg');
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  direction: rtl !important;
  text-align: right !important;
  display: flex;
  flex-direction: column;
}
.main-content {
  flex: 1 0 auto;
}
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: black;
  box-shadow: var(--shadow);
  z-index: 1000;
  direction: rtl;
}
.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: red;
  font-size: 1.7rem;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 1px;
  transition: color var(--transition);
}
.navbar-logo:focus,
.navbar-logo:hover {
  color: var(--white);
}
.navbar-icon {
  display: inline-block;
  vertical-align: middle;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.navbar-menu {
  list-style: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
  direction: rtl;
}
.navbar-item {
  position: relative;
}
.navbar-link {
  display: block;
  padding: 1rem 1.25rem;
  color: var(--white);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  direction: rtl !important;
  text-align: right !important;
}
.navbar-link:focus,
.navbar-link:hover {
  background: gray;
  color: red;
  outline: none;
}
li::marker {
  content: "";
  font-size: 1.2em;
}

/* Dropdown styles */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 190px;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.5rem 0;
  z-index: 1001;
  text-align: right;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.dropdown-link {
  display: block;
  padding: 0.75rem 1.25rem;
  color: black;
  text-decoration: none;
  font-size: 1rem;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  direction: rtl !important;
  text-align: right !important;
}
.dropdown-link:hover,
.dropdown-link:focus {
  background: red;
  color: var(--white);
  outline: none;
}
.dropdown:focus-within > .dropdown-menu,
.dropdown:hover > .dropdown-menu {
  display: block;
}
.dropdown[aria-expanded="true"] > .dropdown-menu {
  display: block;
}

/* Blog styles */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 2rem auto 0 auto;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  direction: rtl !important;
  text-align: right !important;
}
.blog-list-item {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1rem;
  gap: 1.5rem;
  transition: box-shadow 0.2s;
}
.blog-list-item:hover {
  box-shadow: 0 4px 16px rgba(26,35,126,0.13);
}
.blog-topic-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  background: #eee;
  flex-shrink: 0;
}
.blog-list-item .dropdown-link {
  font-size: 1.25rem;
  font-weight: 700;
  color: black;
  text-decoration: none;
  transition: color 0.2s;
}
.blog-list-item .dropdown-link:hover {
  color: red;
}
@media (max-width: 600px) {
  .blog-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1rem 0.5rem;
  }
  .blog-topic-img {
    width: 100%;
    height: 140px;
    border-radius: 8px;
  }
}

/* Responsive styles */
@media (max-width: 900px) {
  .navbar-container {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 0 1rem;
  }
  .navbar-menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
    direction: rtl;
  }
  .navbar-item {
    width: 100%;
  }
  .navbar-link {
    width: 100%;
    padding: 1rem;
  }
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    min-width: 100%;
    animation: none;
  }
}
@media (max-width: 600px) {
  .navbar-container {
    padding: 0 0.5rem;
  }
  .navbar-logo {
    font-size: 1.1rem;
  }
  .navbar-link {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
  }
  .dropdown-link {
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
  }
}

/* Hero section */
.hero {
  max-width: 700px;
  margin: 4rem auto 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  text-align: center;
  direction: rtl;
}
.hero h1 {
  font-size: 2.2rem;
  color: black;
  margin-bottom: 1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.hero p {
  font-size: 1.2rem;
  color: gray;
  margin-bottom: 0;
}

/* Utility */
[tabindex="0"]:focus {
  outline: 2px solid red;
  outline-offset: 2px;
}

/* Professional touch: subtle hover, focus, and transitions */
.navbar-link, .dropdown-link {
  cursor: pointer;
}

/* Scrollbar styling for modern look */
body::-webkit-scrollbar {
  width: 10px;
  background: var(--background);
}
body::-webkit-scrollbar-thumb {
  background: gray;
  border-radius: 6px;
}

/* Main content spacing for sticky nav */
.main-content {
  margin-top: 2.5rem;
  padding: 0 1rem;
  direction: rtl !important;
  text-align: right !important;
}

/* Footer styles */
.site-footer {
  width: 100%;
  background: black;
  color: var(--white);
  text-align: center;
  padding: 1.2rem 0 1rem 0;
  font-size: 1.05rem;
  font-family: 'Amiri' !important;
  letter-spacing: 0.5px;
  margin-top: 3rem;
  direction: rtl;
  flex-shrink: 0;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 100;
}
.footer-content {
  max-width: 900px;
  margin: 0 auto;
}

/* Hadith display custom styles */
.hadith-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  background: #f3f6ff;
  padding: 0.5rem 0.7rem;
  border-radius: 7px;
}
.hadith-text {
  margin-bottom: 0.7rem;
  color: #b71c1c;
  font-size: 1.08rem;
  font-weight: 600;
}
.hadith-meta {
  margin-bottom: 0.7rem;
}
.hadith-grade {
  color: green;
  font-weight: 700;
}
.hadith-takhrij {
  color: #b71c1c;
  font-weight: 700;
  margin-right: 1.5rem;
}

/* Search box styles */
.hadith-search-box {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 700px; /* Match #search-results */
  margin: 2rem auto 1.5rem auto;
  padding: 2rem 1.5rem 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.hadith-search-label {
  font-weight: 700;
  font-size: 1.08rem;
  margin-bottom: 0.3rem;
}
.hadith-search-input {
  width: 100%;
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  border-radius: 7px;
  border: 1px solid #bbb;
  padding: 0.7rem 0.9rem;
  resize: vertical;
  min-height: 60px;
  max-height: 200px; /* Prevent excessive enlargement */
  box-sizing: border-box;
}
.hadith-search-options {
  display: flex;
  gap: 1.5rem;
  font-size: 1.01rem;
  align-items: center;
}
.hadith-search-btn {
  background: var(--primary);
  color: var(--white);
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  border: none;
  border-radius: 7px;
  padding: 0.6rem 2.2rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s;
}
.hadith-search-btn:hover, .hadith-search-btn:focus {
  background: var(--secondary);
}
#search-results {
  max-width: 700px;
  margin: 1.5rem auto 0 auto;
  direction: rtl;
  text-align: right;
}

/* Bible navigation styles */
.bible-nav-box {
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  max-width: 700px;
  margin: 2.5rem auto 1.5rem auto;
  padding: 2rem 1.5rem 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: stretch;
}
.bible-translation-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-bottom: 0.7rem;
}
.bible-btn {
  flex: 1 1 22%;
  min-width: 120px;
  max-width: 180px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 7px;
  padding: 0.6rem 1.3rem;
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
  box-sizing: border-box;
}
.bible-btn.active {
  background: #b71c1c !important;
  color: #fff !important;
  border: 2px solid #b71c1c;
  box-shadow: 0 2px 8px rgba(183,28,28,0.13);
}
.bible-btn:nth-child(5) {
  margin-right: 0;
  flex-basis: 100%;
}
.bible-btn:nth-child(n+5) {
  margin-top: 0.7rem;
}
.bible-translation-btns {
  flex-wrap: wrap;
  row-gap: 0.7rem;
}
@media (max-width: 700px) {
  .bible-nav-box, .bible-text-display {
    max-width: 98vw;
    width: 98vw;
    padding: 1.2rem 0.5rem 1.2rem 0.5rem;
  }
  .bible-translation-btns {
    flex-direction: column;
    gap: 0.4rem;
  }
  .bible-btn {
    min-width: 90vw;
    max-width: 100vw;
    flex-basis: unset;
  }
}

.bible-nav-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
}
.bible-nav-controls label {
  font-weight: 700;
  margin-right: 0.2rem;
}
.bible-nav-controls input, .bible-nav-controls select {
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  border-radius: 7px;
  border: 1px solid #bbb;
  padding: 0.3rem 0.7rem;
  min-width: 70px;
}
.bible-nav-controls .bible-view-btn {
  margin-right: 0.5rem;
  margin-left: 0.5rem;
}
.bible-verse-nav-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  width: 100%;
  margin-top: 1.2rem;
}
.bible-verse-nav-row .bible-view-btn {
  padding: 0.5rem 1.5rem;
  font-size: 1.08rem;
  min-width: 48px;
}

.bible-view-btn {
  background: var(--accent);
  color: var(--white);
  width: 90px;
  height: 50px;
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  border: none;
  border-radius: 7px;
  padding: 0.5rem 0.5rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s;
}
.bible-copy-btn {
  background: var(--accent);
  color: var(--white);
  width: 88px;
  border: none;
  border-radius: 7px;
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  font-weight: 700;
  padding: 0.3rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  box-shadow: var(--shadow);
  outline: none;
  z-index: 2;
  order: 3;
  margin-left: 0;
  margin-right: 0;
  align-self: flex-end;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bible-text-display {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 700px;
  width: 100%;
  margin: 2.5rem auto 0 auto;
  padding: 2rem 1.5rem 1.2rem 1.5rem;
  min-height: 80px;
  font-size: 1.18rem;
  color: #1a237e;
  direction: rtl;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.bible-verse {
  margin-bottom: 1.2rem;
  width: 100%;
  text-align: center;
  position: relative;
}
.bible-verse-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.7rem;
  gap: 0.5rem;
  position: relative;
}
.bible-verse-ref {
  font-weight: 700;
  color: var(--secondary);
  font-size: 1.1rem;
  margin-bottom: 0;
  margin-right: 0;
  margin-left: 0;
  align-self: flex-start;
  order: 1;
}
.bible-verse-translation {
  flex: 1;
  text-align: center;
  font-weight: 700;
  color: #000 !important;
  margin-bottom: 0;
  width: 100%;
  order: 2;
  font-size: 1.08rem;
}
.quran-verse {
  margin-bottom: 1.2rem;
  width: 100%;
  text-align: center;
  position: relative;
}
.quran-verse-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.7rem;
  gap: 0.5rem;
  position: relative;
}
.quran-verse-ref {
  font-weight: 700;
  color: var(--secondary);
  font-size: 1.1rem;
  margin-bottom: 0;
  margin-right: 0;
  margin-left: 0;
  align-self: flex-start;
  order: 1;
  text-align: right;
  flex: 0 0 auto;
}
.quran-surah-name {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 700;
  color: #b71c1c;
  font-size: 1.1rem;
  margin-bottom: 0;
  order: 2;
}
.quran-copy-btn {
  background: var(--accent);
  color: var(--white);
  border: none;
  width: 88px;
  border-radius: 7px;
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  font-weight: 700;
  padding: 0.3rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  box-shadow: var(--shadow);
  outline: none;
  z-index: 2;
  order: 3;
  margin-left: 0;
  margin-right: 0;
  align-self: flex-end;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quran-verse-header > .quran-verse-ref {
  order: 1;
  text-align: right;
}
.quran-verse-header > .quran-surah-name {
  order: 2;
  text-align: center;
}
.quran-verse-header > .quran-copy-btn {
  order: 3;
  text-align: left;
}

/* Quran styles: inherit Bible styles for unified design */
.quran-btn {
  /* Inherit all styles from .bible-btn */
  @extend .bible-btn;
}
.quran-nav-box {
  @extend .bible-nav-box;
}
.quran-riwaya-btns {
  @extend .bible-translation-btns;
}
.quran-nav-controls {
  @extend .bible-nav-controls;
}
.quran-view-btn {
  @extend .bible-view-btn;
}
.quran-ayah-nav-row {
  @extend .bible-verse-nav-row;
}
.quran-text-display {
  @extend .bible-text-display;
}

/* If @extend is not supported, duplicate the CSS rules for each class: */
.quran-btn {
  flex: 1 1 22%;
  min-width: 120px;
  max-width: 180px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 7px;
  padding: 0.6rem 1.3rem;
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
  box-sizing: border-box;
}
.quran-btn.active {
  background: #b71c1c !important;
  color: #fff !important;
  border: 2px solid #b71c1c;
  box-shadow: 0 2px 8px rgba(183,28,28,0.13);
}
.quran-riwaya-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-bottom: 0.7rem;
}
.quran-nav-box {
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  max-width: 700px;
  margin: 2.5rem auto 1.5rem auto;
  padding: 2rem 1.5rem 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: stretch;
}
.quran-nav-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
}
.quran-nav-controls label {
  font-weight: 700;
  margin-right: 0.2rem;
}
.quran-nav-controls input, .quran-nav-controls select {
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  border-radius: 7px;
  border: 1px solid #bbb;
  padding: 0.3rem 0.7rem;
  min-width: 70px;
}
.quran-nav-controls .quran-view-btn {
  margin-right: 0.5rem;
  margin-left: 0.5rem;
}
.quran-view-btn {
  background: var(--accent);
  color: var(--white);
  width: 90px;
  height: 50px;
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  border: none;
  border-radius: 7px;
  padding: 0.5rem 0.5rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s;
}
.quran-ayah-nav-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  width: 100%;
  margin-top: 1.2rem;
}
.quran-ayah-nav-row .quran-view-btn {
  padding: 0.5rem 1.5rem;
  font-size: 1.08rem;
  min-width: 48px;
}
.quran-text-display {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 700px;
  width: 100%;
  margin: 2.5rem auto 0 auto;
  padding: 2rem 1.5rem 1.2rem 1.5rem;
  min-height: 80px;
  font-size: 1.18rem;
  color: #1a237e;
  direction: rtl;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.quran-verse-translation.hafs {
  font-family: 'UthmanicHafs', 'Amiri', serif;
}
.quran-verse-translation.shuba {
  font-family: 'UthmanicShuba', 'Amiri', serif;
}
.quran-verse-translation.warsh {
  font-family: 'UthmanicWarsh', 'Amiri', serif;
}
.quran-verse-translation.qaloun {
  font-family: 'UthmanicQaloun', 'Amiri', serif;
}
.quran-verse-translation.douri {
  font-family: 'UthmanicDouri', 'Amiri', serif;
}
.quran-verse-translation.sousi {
  font-family: 'UthmanicSousi', 'Amiri', serif;
}
