/* محتوى CSS من index.php تم نقله هنا */
body {
  font-family: 'Almarai', sans-serif;
  background: #f5f5f5;
  margin: 0;
}
header {
  position: fixed;
  top: 0; right: 0; left: 0;
  height: 50px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 1001;
}
#menu-toggle {
  font-size: 26px;
  cursor: pointer;
  background: none;
  border: none;
}
.hero {
  margin-top: 50px;
  padding: 80px 20px;
  text-align: center;
  background: url('https://cdn.mos.cms.futurecdn.net/97QX5fRoqwVAQD5cZ6nPoa-650-80.jpg') center/cover no-repeat;
  color: white;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}
.hero h1, .hero p, .hero a {
  position: relative;
  z-index: 2;
}
.hero a {
  background: #FF4081;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 8px;
  display: inline-block;
  margin-top: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 30px 20px 10px 20px;
  background: #fff;
}
.card {
  background: #f9f9f9;
  padding: 20px;
  text-align: center;
  border-radius: 10px;
  transition: 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
a:hover .card {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.note-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border-right: 5px solid #2196F3;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 140px;
  max-height: 140px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.note-card.expanded {
  max-height: none;
}
.note-card h4 {
  margin: 0 0 2px;
  font-size: 16px;
}
.note-content {
  margin-top: 2px;
}
.note-card .likes {
  color: gray;
  font-size: 13px;
  margin-top: 8px;
}
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 20px;
}
.stat-card {
  background: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.fab-menu {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1002;
}
.fab-options {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: none;
  flex-direction: column;
  align-items: flex-end;
}
.fab-options.show {
  display: flex;
}
.fab-options button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 190px;
  padding: 8px 10px;
  font-size: 14px;
  text-align: right;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: 'Almarai', sans-serif;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background 0.2s ease;
}

.fab-options button:hover {
  background: #f0f0f0;
}
.fab-main {
  width: 50px;
  height: 50px;
  background: #2196F3;
  color: white;
  border-radius: 50%;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.3s ease;
}
.fab-main.active {
  transform: rotate(45deg);
}
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1003;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  font-family: 'Almarai', sans-serif;
  position: relative;
}
.modal-content input,
.modal-content textarea,
.modal-content select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: 'Almarai', sans-serif;
  box-sizing: border-box;
}
.modal-content button[type="submit"] {
  background: #2196F3;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Almarai', sans-serif;
  cursor: pointer;
  width: 100%;
}
.color-options {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: center;
}
input[type="radio"][name="color"] {
  display: none;
}
.color-radio {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid #ccc;
  display: inline-block;
}
input[type="radio"]:checked + .color-radio {
  border: 3px solid #000;
}
.close-modal {
  position: absolute;
  top: 10px;
  left: 15px;
  background: none;
  border: none;
  font-size: 20px;
  color: #888;
  cursor: pointer;
}
footer {
  background: #eee;
  text-align: center;
  padding: 15px;
}
.notes-preview {
  background: #fff;
  padding: 30px 20px;
}
.note-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.note-content {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.6;
  max-height: 3.2em;
}
.note-card.expanded .note-content {
  -webkit-line-clamp: unset;
  max-height: none;
}
.show-more {
  font-size: 13px;
  color: #2196F3;
  cursor: pointer;
  text-decoration: underline;
  display: inline-block;
}
@media (max-width: 600px) {
  .note-card {
    font-size: 14px;
    padding: 12px;
  }
  .note-card h4 {
    font-size: 15px;
  }
  .show-more {
    font-size: 12px;
  }
}
.note-title {
  text-align: center;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 20px;
}
.title-text {
  display: inline-block;
  border-bottom: 2px solid #2196F3;
  color: #000;
  text-decoration: none !important;
}
.hero h1 {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  transition: all 0.2s ease-in-out;
}
.hero h1 span {
  opacity: 0;
  transform: translateY(10px);
  display: inline-block;
  transition: all 0.3s ease-in-out;
}
.hero h1 span.visible {
  opacity: 1;
  transform: translateY(0);
}

.card {
  background: #f9f9f9;
  padding: 20px;
  text-align: center;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.card h3, .card p {
  color: inherit;
  text-decoration: none;
}


.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-container {
  margin: 20px auto 0 auto;   /* محاذاة وسط أفقياً */
  width: 90%;
  max-width: 400px;
  min-width: 260px;
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;    /* يضمن أن الحقل داخلها في المنتصف */
}


#liveSearch {
  width: 100%;
  padding: 12px 40px 12px 15px;
  background-color: rgba(0,0,0,0.4);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  color: white;
  font-family: 'Almarai', sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#liveSearch::placeholder {
  color: #cccccc;
}

#liveSearch:focus {
  outline: none;
  border-bottom: 2px solid #fff;
  background-color: rgba(0,0,0,0.6); /* أكثر تباين عند التركيز */
}

.clear-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 20px;
  color: #ccc;
  display: none;
  z-index: 2;
}

.suggestions-list {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 4px;
  list-style: none;
  padding: 0;
  z-index: 999;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  font-size: 14px;
  color: white;
}

.suggestions-list li {
text-align: right; /* ← لمحاذاة النص إلى اليمين */
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease;
}

.suggestions-list li:hover {
  background: rgba(255, 255, 255, 0.2);
}

.suggestions-list li:last-child {
  border-bottom: none;
}



.expandable-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}
.expandable-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.expandable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 18px;
}

.expandable-content {
  margin-top: 10px;
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.expandable-card.open .expandable-content {
  display: block;
}

.expandable-card .arrow {
  transition: transform 0.3s ease;
}
.expandable-card.open .arrow {
  transform: rotate(90deg);
}

.expandable-content a {
  display: block;
  padding: 8px 12px;
  margin: 5px 0;
  background: #f9f9f9;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  font-size: 15px;
  transition: background 0.2s;
}
.expandable-content a:hover {
  background: #e3f2fd;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.sub-card {
  background: #ffffff;
  border-radius: 10px;
  margin-bottom: 10px;
  font-weight: 500;
  color: #333333; /* رمادي غامق */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  padding: 12px 40px 12px 12px;
  text-decoration: none; /* إزالة الخط تحت النص */
  display: block;
}

.sub-card:hover {
  background: #e3f2fd;
  color: #222; /* ظل أغمق قليل عند التفاعل */
  transform: translateY(-2px);
}

.sub-card::after {
  content: '↗';
  position: absolute;
  right: 15px;
  color: #90caf9;
  font-size: 1.1rem;
}

.sub-cards {
  display: none;
}

.responsive-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* نسبة 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  max-height: 90vh; /* أقصى ارتفاع للشاشة */
}

.responsive-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media (min-width: 768px) {
  .modal-content {
    width: 80%;
    max-width: 960px;
    max-height: 80vh;
    margin: auto;
    padding: 0;
  }
}

/* توزيع البطاقات على 3 أعمدة في الشاشات الكبيرة */
@media (min-width: 900px) {
  .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .audio-notice {
    font-size: 12px;
    padding: 4px 8px;
  }
}

.audio-notice {
  font-size: 12px;
  padding: 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95vw;
  background: #e3f2fd;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  margin: 8px auto;
}

.unit-grid-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 25px auto;
  max-width: 800px;
  padding: 10px;
}

.unit-card {
  padding: 12px 20px;
  background-color: #e0f7fa;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: #00796b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

#unitMenuBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #00796b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 999;
}

.unit-menu {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px 15px;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 998;
  width: 200px;
  font-size: 14px;
}

.unit-menu a {
  display: block;
  color: #00796b;
  padding: 6px 0;
  text-decoration: none;
  border-bottom: 1px solid #eee;
}

.unit-menu a:last-child {
  border-bottom: none;
}

.unit-menu h4 {
  margin: 0 0 10px;
  color: #444;
  font-size: 15px;
}

.unit-fab-btn {
  width: 50px;
  height: 50px;
  font-size: 22px;
  background-color: #2196F3;
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.unit-options {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: none;
  flex-direction: column;
  align-items: flex-end;
}

.unit-options.show {
  display: flex;
}

.unit-options button {
  width: 180px;
  text-align: right;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 5px 10px;
  margin-bottom: 6px;
  font-size: 14px;
  font-family: 'Almarai', sans-serif;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fab-options.unit-buttons button {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal !important;
  line-height: 1.6;
  width: 230px !important; /* أضفنا هذا لحل مشكلة الطول */
}

.fab-options.unit-buttons .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ccc; /* رمادي افتراضي */
  display: inline-block;
  margin-left: 8px;
}

.fab-options.unit-buttons .dot.active {
  background-color: #2196F3; /* أزرق */
}


#unitFab i {
  font-size: 20px !important;
}

.menu-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

/* عند فتح القائمة الجانبية، نحرك الزر لليسار */
.dashboard-container.sidebar-visible .menu-toggle {
  right: 260px; /* نفس عرض القائمة */
}

/* تحسين للموبايل */
@media (max-width: 768px) {
  .menu-toggle {
    right: 16px !important;
  }

  .dashboard-container.sidebar-visible .menu-toggle {
    right: 220px !important; /* أقل من 240px حتى لا يلامس القائمة */
  }
}

.site-footer {
  text-align: center;
  padding: 20px;
  background: #f5f5f5;
  color: #555;
  font-size: 1.1rem; /* خط أكبر وواضح */
  border-top: 1px solid #ddd;
  line-height: 1.8;
}
