/* -------------- عام ----------------- */
body {
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  background: #f9f9f9;
  margin: 0;
  padding: 0;
  color: #333;
}

a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover, a:focus {
  color: #0056b3;
  text-decoration: underline;
}

img {
max-width: 140px;
  height: 140px;
  width: 140px;
  object-fit: cover;
  border-radius: 20px;
}

/* ----------- الشريط العلوي (Topbar) ------------ */
.topbar {
  display: flex;
  align-items: center;
  background-color: #003366;
  padding: 10px 20px;
  color: #fff;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 9999;
}

.topbar .menu-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
}

.topbar .logo img {
  height: 40px;
}

.topbar .search-box {
  flex-grow: 1;
  display: flex;
  gap: 5px;
  justify-content: flex-start;
}

.topbar .search-box input[type="search"] {
  width: 100%;
  max-width: 350px;
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  font-size: 1rem;
}

.topbar .search-box button {
  background-color: #0056b3;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}

.topbar .search-box button:hover {
  background-color: #003d80;
}

/* ----------- التعتيم (Overlay) ------------ */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 998;
  display: none;
}

.overlay.active {
  display: block;
}

/* ----------- القائمة الجانبية (Sidebar) ------------ */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 280px;
  background-color: #002244;
  color: #fff;
  box-shadow: -2px 0 6px rgba(0,0,0,0.3);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.sidebar.expanded {
  transform: translateX(0);
}

.sidebar .close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  align-self: flex-start;
  cursor: pointer;
  margin-bottom: 15px;
}

.sidebar nav ul.main-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar nav ul.main-menu > li {
  margin-bottom: 15px;
}

.sidebar nav ul.main-menu > li > a,
.sidebar nav ul.main-menu > li > span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
}

.sidebar nav ul.main-menu > li > a:hover,
.sidebar nav ul.main-menu > li > span:hover {
  color: #1e90ff;
}

.sidebar nav ul.submenu {
  list-style: none;
  padding-right: 20px;
  margin-top: 8px;
  margin-bottom: 15px;
  display: none;
}

.sidebar nav ul.submenu li {
  margin-bottom: 10px;
}

.sidebar nav ul.submenu li a {
  font-weight: 400;
  font-size: 1rem;
  color: #ccc;
  display: block;
}

.sidebar nav ul.submenu li a:hover {
  color: #1e90ff;
}

/* قم بإظهار القائمة الفرعية عند وجود class مخصص - يمكن التحكم من جافاسكريبت */
.sidebar nav ul.submenu.show {
  display: block;
}

/* ---------- الصفحة الرئيسية - تخطيط القائمة الرئيسية ------------ */
.container {
  max-width: 1200px;
  margin: 1rem auto 3rem;
  padding: 0 15px;
}

.playlist-layout {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 15px;
}

.playlist-column {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
  flex: 1 0 320px;
  display: flex;
  flex-direction: column;
  padding: 15px;
}

.playlist-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #003366;
  border-bottom: 2px solid #003366;
  padding-bottom: 5px;
}

.playlist-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  overflow-y: auto;
  max-height: 600px;
  padding-right: 5px;
}

/* بطاقة الوسائط */
.media-card {
  background: #fefefe;
  border-radius: 8px;
  box-shadow: 0 1px 5px rgb(0 0 0 / 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.media-card:hover {
  transform: translateY(-5px);
}

.media-image {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.media-image img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.media-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background-color: rgba(0, 51, 102, 0.7);
  border-radius: 50%;
  font-size: 2rem;
  padding: 12px 18px;
  transition: background-color 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-play:hover {
  background-color: rgba(0, 51, 102, 0.9);
}

.media-info {
  padding: 10px 12px;
}

.media-info h3 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #003366;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-info h3 a {
  color: inherit;
}

.media-info h3 a:hover {
  text-decoration: underline;
}

.media-info .date {
  font-size: 0.85rem;
  color: #666;
}

/* ---------------- صفحة تفاصيل الوسائط ---------------- */
.media-cover {
  max-height: 306px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

/* زر التحميل والعودة */
.btn-download {
  background-color: #0056b3;
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.btn-download:hover {
  background-color: #003d80;
}

.btn-outline-secondary {
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  color: #003366;
  border: 1.5px solid #003366;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline-secondary:hover {
  background-color: #003366;
  color: #fff;
}

/* ------------- قائمة الوسائط الشائعة والأقسام الجانبية ------------- */
.section-list {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.section-list h5.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #003366;
}

.section-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-list ul li {
  padding: 8px 0;
  border-bottom: 1px solid #ddd;
}

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

.section-list ul li a {
  color: #007bff;
}

.section-list ul li a:hover {
  text-decoration: underline;
}

/* --------- تخطيط عام الشبكة ---------------- */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.0005rem;
}

/* --------- تجهيز الهواتف والجوال --------- */
@media (max-width: 991px) {
  .playlist-layout {
    flex-wrap: wrap;
  }
  .playlist-column {
    flex: 1 1 100%;
  }
  .playlist-items {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .sidebar {
    width: 260px;
  }
}

@media (max-width: 575px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .topbar .search-box {
    flex-grow: 1;
    margin-top: 10px;
    order: 3;
  }
}

/* --------- تحسينات المشغل plyr --------- */
.plyr--audio {
  width: 100% !important;
  border-radius: 10px;
}

.plyr--video {
  border-radius: 10px;
}

/* --------- الأزرار الصغيرة --------- */
button, .btn {
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
}

/* ------------- تلميحات الشاشة عند التمرير ------------- */
[aria-label] {
  cursor: help;
}

/* ------------- اختصارات أيقونات فاونت أوسم ------------- */
.fas, .fa {
  vertical-align: middle;
}

.media-cover.mb-3.img-fluid {
  width: 190px;
  height: 190px;
  object-fit: cover;
  border-radius: 90px;
}

