@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;
  padding: 10px;
}

table {
  width: 100%;
  /* السر هنا: فصل الحدود وتحديد المسافات */
  border-collapse: separate; 
  border-spacing: 8px 12px; /* الرقم الأول للفصل بين الأعمدة، والثاني للفصل بين الأسطر */
  margin: 10px 0;
  background-color: transparent; /* جعل الخلفية شفافة لإبراز انفصال الخلايا */
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  direction: rtl;
}

thead th {
  background: linear-gradient(135deg, var(--primary-color, #008080), #20b2aa);
  color: #fff;
  padding: 15px;
  font-weight: 700;
  border-radius: 8px; /* حواف دائرية لكل خلية في الرأس */
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  text-align: center;
}

tbody td {
  padding: 15px;
  text-align: center;
  color: #333;
  background-color: #ffffff; /* كل خلية لها خلفية بيضاء خاصة بها */
  
  /* إضافة حواف دائرية لكل خلية لجعلها تبدو كبطاقة صغيرة */
  border-radius: 10px; 
  
  /* حدود خفيفة جداً لإبراز الشكل */
  border: 1px solid #eef2f2;
  
  /* ظل خفيف لإعطاء عمق وانفصال حقيقي */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.03);
  
  transition: all 0.3s ease;
}

/* تأثير عند تمرير الماوس على الخلية */
tbody td:hover {
  transform: translateY(-3px); /* حركة بسيطة للأعلى عند التأشير */
  box-shadow: 0 5px 12px rgba(0, 128, 128, 0.1);
  border-color: var(--primary-color, #008080);
  background-color: #faffff;
}

/* تمييز العمود الأول (مثلاً: وقت الحصة أو اسم المادة) */
tbody td:first-child {
  font-weight: 800;
  color: var(--primary-color, #008080);
  background-color: #f0fdfc;
}

/* تنسيق الزر داخل الخلية ليناسب التصميم الجديد */
.table-button {
  display: inline-block;
  background-color: var(--primary-color, #008080);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 20px; /* زر بيضاوي عصري */
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: 0.3s;
}

.table-button:hover {
  box-shadow: 0 4px 10px rgba(0, 128, 128, 0.3);
  filter: brightness(1.1);
}
.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;
}
/* تنسيق الزر الأساسي */
    .smart-fab {
        position: fixed;
        bottom: 30px;
        right: 30px; /* مكان الزر */
        z-index: 10000;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 24px;
        background: #25D366; /* لون واتساب/أخضر مريح للعين */
        color: white;
        text-decoration: none;
        border-radius: 50px;
        box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
        font-family: 'Noto Sans Arabic', sans-serif;
        font-weight: bold;
        font-size: 16px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* حركة ناعمة جداً */
        border: 2px solid white;
        overflow: hidden;
        max-width: 250px; /* العرض الكامل */
    }

    .fab-icon { font-size: 20px; }
    
    .fab-text {
        white-space: nowrap;
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    /* حالة الانكماش (عند القراءة) */
    .smart-fab.mini-mode {
        padding: 12px; /* تصغير الحواف */
        gap: 0;
        max-width: 50px; /* العرض يصبح بحجم الأيقونة فقط */
        background: #333; /* لون داكن ليكون أقل لفتاً للانتباه أثناء القراءة */
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    .smart-fab.mini-mode .fab-text {
        opacity: 0; /* إخفاء النص */
        width: 0;
    }

    /* تحسين شكل الزر عند التحويم بالماوس */
    .smart-fab:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.25);
        background: #ff8c00; /* يتحول للبرتقالي عند الرغبة في الضغط */
    }