@font-face {
  font-family: "Cairo";
  src: url("https://tawjihna.com/fonts/Cairo-VariableFont_slnt,wght.ttf") format("truetype-variations"),
       url("https://tawjihna.com/fonts/Cairo-Regular.ttf") format("truetype"); /* fallback */
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  /* الأولوية للأحرف العربية */
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* fallback للإنجليزية أو اللاتينية */
body {
  font-family: "Cairo", "Arial", "Helvetica", sans-serif;
}

:root {
  --primary-color: #00796b;
  --secondary-color: #004d40;
  --text-color: #333;
  --light-bg: #f4f6f8;
  --section-bg: #fff;
  --ol-bg-level1: #f0f9ff;
  --ol-bg-level2: #e0f2fe;
  --ol-bg-level3: #bae6fd;
  --ol-bg-level4: #7dd3fc;
  --ol-icon-level1: #007acc;
  --ol-icon-level2: #0099cc;
  --ol-icon-level3: #33bbee;
  --ol-icon-level4: #66ccee;
  --ul-bg-level1: #fff5f5;
  --ul-bg-level2: #ffeaea;
  --ul-bg-level3: #ffd6d6;
  --ul-icon-level1: red;
  --ul-icon-level2: darkred;
  --ul-icon-level3: crimson;
  --comment-bg: #fff;
  --reply-bg: #f0f4f0;
  --comment-link: var(--primary-color);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  font-size: 100%;
}
body {
  font-family: "Cairo", sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  margin: 0;
  line-height: 1.85;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100vw;
  overflow-x: hidden;
}
.deadline {
  text-align: center;
  font-weight: 700;
  color: #d9534f;
}
.anim {
  animation: animate 2s linear infinite;
}
@keyframes animate {
  0%,
  50%,
  80% {
    color: #ff085a;
  }
  100% {
    color: #fff;
  }
}
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--secondary-color);
  font-weight: 700;
}
h1 {
  background-color: var(--primary-color);
  color: #fff;
  padding: 25px 20px;
  text-align: center;
  font-size: clamp(24px, 4vw, 36px);
  margin-bottom: 25px;
  border-bottom: 5px solid var(--secondary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h2 {
  color: var(--primary-color);
  font-size: clamp(18px, 3vw, 28px);
  margin-top: 30px;
  border-right: 5px solid #80cbc4;
  padding-right: 12px;
  padding-bottom: 5px;
  position: relative;
}
p {
  font-size: clamp(15px, 2.5vw, 17px);
  line-height: 2;
  margin: 1rem 0;
}
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}
.button {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  background-color: var(--primary-color);
  color: #fff;
}
.button:hover {
  background-color: var(--secondary-color);
  color: wheat;
  transform: translateY(-2px);
}
.container,
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.section {
  background: var(--section-bg);
  padding: 25px;
  margin: 25px auto;
  max-width: 960px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
.section:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
body > ol,
body > ul,
.section ol,
.section ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  direction: rtl;
}
body > ol li,
body > ul li,
.section ol li,
.section ul li {
  position: relative;
  font-size: clamp(15px, 2.5vw, 17px);
  border-radius: 8px;
  margin-bottom: 0.8rem;
  padding: 10px 50px 10px 14px;
  display: block;
  box-sizing: border-box;
}
body > ol li::before,
body > ul li::before,
.section ol li::before,
.section ul li::before {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
body > ol li,
.section ol li {
  counter-increment: ol-counter;
  background: var(--ol-bg-level1);
}
body > ol li::before,
.section ol li::before {
  content: counter(ol-counter);
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  background-color: var(--ol-icon-level1);
}
body > ol li ol li {
  background: var(--ol-bg-level2);
}
body > ol li ol li::before {
  background-color: var(--ol-icon-level2);
}
body > ol li ol li ol li {
  background: var(--ol-bg-level3);
}
body > ol li ol li ol li::before {
  background-color: var(--ol-icon-level3);
}
body > ol li ol li ol li ol li {
  background: var(--ol-bg-level4);
}
body > ol li ol li ol li ol li::before {
  background-color: var(--ol-icon-level4);
}
body > ul li,
.section ul li {
  background: var(--ul-bg-level1);
}
body > ul li::before,
.section ul li::before {
  content: "✔";
  width: 24px;
  height: 24px;
  line-height: 24px;
  border-radius: 4px;
  background-color: var(--ul-icon-level1);
}
body > ul li ul li {
  background: var(--ul-bg-level2);
}
body > ul li ul li::before {
  background-color: var(--ul-icon-level2);
}
body > ul li ul li ul li {
  background: var(--ul-bg-level3);
}
body > ul li ul li ul li::before {
  background-color: var(--ul-icon-level3);
}
body > ol li:hover,
body > ul li:hover,
.section ol li:hover,
.section ul li:hover {
  filter: brightness(0.95);
  cursor: pointer;
}
body > ol li ol,
body > ol li ul,
body > ul li ol,
body > ul li ul,
.section ol li ol,
.section ol li ul,
.section ul li ol,
.section ul li ul {
  margin-top: 0.5rem;
  margin-inline-end: 20px;
  counter-reset: ol-counter;
}
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
img:hover,
video:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
@media (hover: none) {
  .button:hover,
  .table-button:hover,
  img:hover,
  video:hover {
    transform: none;
    box-shadow: none;
  }
}
.navbar {
  background-color: var(--secondary-color);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  margin-bottom: 30px;
  padding: 10px 0;
}
.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 25px;
  flex-wrap: wrap;
}
.navbar .logo img {
  height: 55px;
  transition: transform 0.3s ease;
}
.navbar .logo img:hover {
  transform: scale(1.05);
}
.nav-links {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}
.nav-links li {
  margin: 0 15px;
}
.nav-links a {
  color: #fff;
  font-weight: 500;
  padding: 10px 15px;
  border-radius: 6px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-size: 16px;
}
.nav-links a:hover {
  background-color: #00695c;
  transform: translateY(-2px);
}
.menu-toggle {
  display: none;
  font-size: 32px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.3s ease;
}
.menu-toggle:hover {
  transform: scale(1.1);
}
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
  padding-bottom: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 25px 0;
  background-color: var(--section-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  border: 2px solid #7fffd4;
  table-layout: auto;
}
thead {
  background-color: var(--primary-color);
  color: #fff;
}
thead th {
  padding: 12px 16px;
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  text-align: center;
  font-weight: 700;
  border: 1px solid #7fffd4;
}
tbody td {
  padding: 9px 15px;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  text-align: center;
  color: #222;
  border: 1px solid #7fffd4;
  background-color: #fafafa;
  transition: background-color 0.2s ease-in-out;
}
tbody tr:nth-child(even) td {
  background-color: #f0fdfc;
}
tbody tr:hover td {
  background-color: #e6f7f6;
  cursor: pointer;
}
.table-button {
  background-color: var(--primary-color);
  color: #fff;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-decoration: none;
}
.table-button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}
.grid-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  justify-items: center;
  margin: 20px 0;
}
.grid-buttons .button {
  width: 100%;
  text-align: center;
}
.footer {
  background-color: var(--primary-color);
  color: #fff;
  text-align: center;
  padding: 30px 15px;
  margin-top: 50px;
  font-size: 16px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
}
.footer a {
  color: #fff;
}
.footer a:hover {
  color: #e0e0e0;
}
.footer .social {
  margin-top: 15px;
}
.footer .social a {
  margin: 0 10px;
  font-size: 24px;
  color: #fff;
  transition: transform 0.3s ease, color 0.3s ease;
}
.footer .social a:hover {
  color: #add8e6;
  transform: scale(1.2);
}
.comments {
  background-color: #eef4f9;
  border-left: 5px solid #00796b;
  padding: 15px;
  margin: 25px 0;
  border-radius: 8px;
  font-style: italic;
}
#backToTop {
  display: none;
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 99;
  font-size: 24px;
  width: 40px;
  height: 40px;
  background-color: #00796b;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, transform 0.2s ease,
    box-shadow 0.3s ease;
}
#backToTop:hover {
  background-color: #004d40;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}
@media (max-width: 768px) {
  .container,
  main {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }
  .section {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    margin: 10px 0;
  }
  h1,
  h2,
  p {
    padding-left: 10px;
    padding-right: 10px;
  }
  h1 {
    font-size: clamp(20px, 6vw, 28px);
    padding: 20px 10px;
  }
  h2 {
    font-size: clamp(16px, 5vw, 22px);
    padding-right: 10px;
  }
  p {
    font-size: clamp(14px, 4vw, 16px);
  }
  .button,
  .table-button {
    padding: 12px 20px;
    font-size: 16px;
  }
  .navbar .container {
    padding: 0 10px;
  }
  .menu-toggle {
    display: block;
  }
  .nav-links {
    width: 100%;
    display: none;
    flex-direction: column;
    background-color: var(--secondary-color);
    margin-top: 10px;
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease;
  }
  .nav-links.show {
    display: flex;
    max-height: 500px;
    opacity: 1;
  }
  .nav-links li {
    margin: 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-links li:last-child {
    border-bottom: none;
  }
  .nav-links a {
    padding: 15px 20px;
    display: block;
    font-size: 17px;
  }
  .nav-links a:hover {
    background-color: #00695c;
    transform: none;
  }
  .navbar .logo img {
    height: 45px;
  }
  .footer {
    padding: 25px 10px;
    font-size: 14px;
  }
  .footer .social a {
    font-size: 22px;
    margin: 0 8px;
  }
  .table-wrapper {
    padding: 0;
    margin: 0;
  }
  table {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .section {
    width: 90%;
    padding: 25px;
  }
  .navbar .container {
    padding: 0 30px;
  }
  .nav-links li {
    margin: 0 12px;
  }
}
.comment-form,
.comment-box,
.reply-box {
  background: var(--comment-bg);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 700px;
  margin-right: auto;
  margin-left: auto;
}
.reply-box {
  background-color: var(--reply-bg);
  margin-top: 10px;
  margin-right: 40px;
}
.comment-form input,
.comment-form textarea,
.reply-form input,
.reply-form textarea {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 15px;
  box-sizing: border-box;
}
.comment-form button,
.reply-form button {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}
.comment-form button:hover,
.reply-form button:hover {
  background-color: var(--secondary-color);
}
.comment-box strong {
  color: var(--comment-link);
}
.comment-box small {
  color: gray;
}
.comment-form h2 {
  text-align: center;
  color: var(--primary-color);
}
.reply-link {
  font-size: 14px;
  color: var(--comment-link);
  cursor: pointer;
  margin-top: 5px;
  display: inline-block;
}
.reply-form {
  display: none;
}
