:root {
  --primary-blue: #003673d3;
  --secondary-blue: #297690e7;
  --accent-blue: #2b7cc3e4;
  --bg-color: #f5f6fa;
  --white: #ffffff;
  --gray-text: #666666;
  --light-gray: #e8e8e8;
  --success: #0d8c4b;
  --warning: #ff6b35;
  --info: #2196f3;
  --purple: #9c27b0;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --border-radius: 18px;
  --border-radius-sm: 12px;
  --border-radius-lg: 24px;
  --transition: all 0.3s ease;
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-shadow: rgba(31, 38, 135, 0.15);
  --bg-light: #f8fafc;
  --border-color: #e2e8f0;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --mobile-breakpoint: 768px;
  --poster-height: 360px;
  --poster-height-mobile: 280px;

  /* متغيرات البطاقة الجديدة - محسنة */
  --exam-w: clamp(190px, 23vw, 250px);
  --exam-h: calc(var(--exam-w) * 1.5);

  /* ألوان محسنة للبطاقات */
  --btn-exam: linear-gradient(135deg, #9a3412, #ea580c);
  --btn-exam-hover: linear-gradient(135deg, #9a3412, #ea580c);
  --grade-badge-bg: linear-gradient(135deg, #2563eb, #1e40af);
  --curriculum-badge-bg: linear-gradient(135deg, #e74c3c, #c0392b);
  --shadow-strong: 0 15px 30px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 20px 35px rgba(0, 43, 91, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Tajawal", "Segoe UI", system-ui, sans-serif;
}

body {
  background: var(--bg-color);
  color: var(--gray-text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
}

/* خلفية متحركة */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(43, 125, 195, 0.05) 0%,
    transparent 70%
  );
  animation: float 20s infinite linear;
}

.circle:nth-child(1) {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 10%;
  animation-duration: 25s;
  animation-direction: reverse;
}

.circle:nth-child(2) {
  width: 200px;
  height: 200px;
  top: 60%;
  right: 15%;
  animation-duration: 30s;
}

.circle:nth-child(3) {
  width: 150px;
  height: 150px;
  bottom: 20%;
  left: 20%;
  animation-duration: 20s;
  animation-direction: reverse;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, 20px) rotate(90deg);
  }
  50% {
    transform: translate(0, 40px) rotate(180deg);
  }
  75% {
    transform: translate(-20px, 20px) rotate(270deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}

/* قسم الهيرو */
.explorer-hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 100px 20px 40px;
  background-color: var(--primary-blue);
}

@media (min-width: 768px) {
  .explorer-hero {
    min-height: 60vh;
    padding: 140px 20px 60px;
  }
}

.hero-bg-single {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-bg-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.home-hero .overlay-gradient {
  z-index: 2;
  opacity: 0.75;
}

.home-hero .hero-content,
.home-hero .hero-search {
  z-index: 3;
  position: relative;
}

.overlay-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--secondary-blue) 100%
  );
  opacity: 0.85;
  z-index: 2;
  mix-blend-mode: multiply;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 0 20px;
  margin-bottom: 30px;
}

.hero-icon {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  color: #fff;
  font-size: 1.8rem;
  transition: transform 0.3s ease;
}

.hero-icon:hover {
  transform: scale(1.05);
}

.hero-content h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  max-width: 800px;
  line-height: 1.3;
}

.hero-content p {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 20px;
  line-height: 1.6;
  max-width: 700px;
}

.explorer-hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 800px;
  width: 100%;
  margin-top: 15px;
}

/* Breadcrumb */
.breadcrumb-container {
  position: absolute;
  top: 15px;
  right: 15px;
  left: auto;
  z-index: 10;
  direction: rtl;
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
  max-width: none;
  margin: 0;
  box-shadow: none;
  animation: fadeInDown 0.8s ease;
  display: flex;
  justify-content: flex-start;
  max-width: calc(100% - 30px);
  overflow: hidden;
}

.breadcrumb {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  background-color: transparent;
  border-radius: 0;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.breadcrumb::-webkit-scrollbar {
  display: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  margin: 0;
  flex-shrink: 0;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  background-color: transparent;
  white-space: nowrap;
}

.breadcrumb a:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.breadcrumb a i {
  margin-left: 5px;
  font-size: 0.8em;
  color: #f59e0b;
}

.breadcrumb li.active span {
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin: 0 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  font-weight: bold;
  flex-shrink: 0;
}

/* شريط البحث */
.explorer-hero-search {
  max-width: 600px;
  margin: 1.2rem auto 0;
  position: relative;
  animation: fadeInUp 1.5s ease 0.6s both;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25),
    rgba(255, 255, 255, 0.15)
  );
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 50px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  padding: 8px;
  transition: var(--transition);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.15),
    0 2px 10px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease forwards 0.2s;
  opacity: 0;
}

.search-input-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border-radius: 50px;
  z-index: -1;
}

.search-input-wrapper:focus-within {
  transform: translateY(-5px);
  box-shadow:
    0 20px 50px rgba(43, 125, 195, 0.25),
    0 3px 15px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0.2)
  );
}

.search-icon {
  padding: 0 20px;
  color: white;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 60%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  left: 0;
  top: 20%;
}

.explorer-hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 18px 15px;
  font-size: 1.1rem;
  color: white;
  background: transparent;
  height: 100%;
  z-index: 1;
  width: 100%;
}

.explorer-hero-search-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.explorer-hero-search-input:focus::placeholder {
  opacity: 0.5;
  transform: translateX(5px);
}

/* زر الفلاتر */
.filter-btn-main {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.85)
  );
  color: var(--primary-blue);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 120px;
  height: 56px;
  margin-left: 8px;
  box-shadow:
    0 8px 25px rgba(0, 43, 91, 0.3),
    0 2px 8px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  z-index: 1;
  white-space: nowrap;
}

.filter-btn-main::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  transition: left 0.7s ease;
  z-index: -1;
}

.filter-btn-main:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 15px 35px rgba(0, 43, 91, 0.4),
    0 3px 12px rgba(255, 255, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1),
    rgba(255, 255, 255, 0.95)
  );
  border-color: rgba(255, 255, 255, 0.6);
}

.filter-btn-main:hover::before {
  left: 100%;
}

.filter-btn-main:active {
  transform: translateY(-1px);
  transition: all 0.1s ease;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.filter-btn-main.pulse {
  animation: pulse 2s infinite;
}

/* التبويبات */
.type-tabs-container {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin: 12px 0 15px;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-blue) var(--light-gray);
  background: var(--white);
  padding: 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--light-gray);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.type-tabs-container::-webkit-scrollbar {
  height: 5px;
}

.type-tabs-container::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: 8px;
}

.type-tabs-container::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 8px;
}

.type-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 22px;
  text-decoration: none;
  color: var(--gray-text);
  background: var(--bg-color);
  border: 1px solid var(--light-gray);
  transition: var(--transition);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 40px;
}

.type-tab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--primary-blue);
}

.type-tab.active {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: white;
  border-color: var(--primary-blue);
}

.type-tab i {
  font-size: 0.85rem;
}

/* الفلاتر الثابتة */
.fixed-filters-bar {
  background: white;
  border-radius: var(--border-radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 25px;
  border: 1px solid var(--light-gray);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  align-items: end;
}

@media (max-width: 992px) {
  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.filter-group {
  margin-bottom: 0;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--primary-blue);
  font-size: 0.95rem;
}

.filter-group label i {
  color: var(--accent-blue);
  font-size: 0.9rem;
}

.filter-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--light-gray);
  border-radius: 10px;
  font-family: "Tajawal", sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  background: white;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23256D85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px;
  padding-left: 40px;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 109, 133, 0.1);
}

.sort-options {
  grid-column: span 2;
}

.sort-buttons-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sort-btn {
  flex: 1;
  min-width: 120px;
  background: var(--bg-color);
  color: var(--gray-text);
  border: 2px solid var(--light-gray);
  padding: 10px 15px;
  border-radius: 10px;
  font-family: "Tajawal", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sort-btn:hover {
  background: var(--light-gray);
  color: var(--primary-blue);
}

.sort-btn.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

/* إضافة خيار نوع الاختبار */
.type-filter-options {
  grid-column: span 2;
}

/* فلتر السنة */
.year-filter-options {
  grid-column: span 2;
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary-custom {
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--accent-blue) 100%
  );
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: "Tajawal", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 43, 91, 0.25);
}

.btn-outline-custom {
  background: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  padding: 12px 20px;
  border-radius: 10px;
  font-family: "Tajawal", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
}

.btn-outline-custom:hover {
  background: var(--primary-blue);
  color: white;
}

/* ===== شبكة الاختبارات - محسنة ===== */
.explorer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 15px;
  margin: 25px 0;
}

@media (min-width: 480px) {
  .explorer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}
@media (min-width: 640px) {
  .explorer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}
@media (min-width: 768px) {
  .explorer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
  }
}
@media (min-width: 1024px) {
  .explorer-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
  }
}
@media (min-width: 1200px) {
  .explorer-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
  }
}

/* ===== تصميم البطاقة المحسن - ذكي وأنيق ===== */
.explorer-card {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  /* تم إزالة max-width لحل مشكلة الفراغ على الهواتف */
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  border: none;
  box-shadow: none;
  padding: 0;
}

.explorer-card:hover {
  transform: translateY(-15px);
  z-index: 10;
}

/* رابط البطاقة */
.exam-link-wrapper {
  text-decoration: none;
  display: block;
  color: inherit;
  width: 100%;
}

.exam-card {
  perspective: 1800px;
  margin-bottom: 10px;
  width: 100%;
  /* تحديد عرض الاختبار بشكل متناسق */
  max-width: min(100%, 250px);
  margin-left: auto;
  margin-right: auto;
}

.exam-3d {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.5;
  transform-style: preserve-3d;
}

/* صفحات الاختبار - محسنة للـ RTL */
.exam-pages {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to right,
    #f5f5f5 0px 2px,
    #eeeeee 2px 4px,
    #e8e8e8 4px 6px
  );
  border: 1px solid #b0bec5;
  border-radius: 15px 3px 3px 15px;
  box-shadow:
    inset 4px 0 8px rgba(0, 0, 0, 0.1),
    0 6px 12px rgba(0, 0, 0, 0.15);
  z-index: 1;
  transform: translateZ(-2px);
}

/* غلاف الاختبار - محسن للـ RTL */
.exam-cover {
  position: absolute;
  inset: 0;
  border-radius: 15px 3px 3px 15px;
  transform-origin: right center;
  transform: rotateY(0deg) translateZ(2px);
  transition:
    transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    box-shadow 0.6s ease;
  overflow: hidden;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.25),
    3px 3px 8px rgba(0, 0, 0, 0.15);
}

/* حاوية الصورة */
.cover-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 15px 3px 3px 15px;
  overflow: hidden;
}

.cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.exam-link-wrapper:hover .cover-container img {
  transform: scale(1.05);
}

/* ===== الحل الذكي: محتوى الغلاف ===== */
/* استراتيجية جديدة: تقليل التشويش مع الحفاظ على المعلومات */

.cover-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 12px 6px;
  color: white;
  z-index: 3;
  pointer-events: none;
  /* تدرج أخف بكثير - يسمح برؤية الغلاف */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.35) 25%,
    rgba(0, 0, 0, 0.1) 50%,
    transparent 70%
  );
  border-radius: 15px 3px 3px 15px;
}

/* ===== العنوان - أنيق وبسيط ===== */
.exam-title {
  font-size: clamp(0.8rem, 3.2vw, 0.95rem);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 98%;
  color: #ffffff;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 1px 2px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.2px;
  word-break: break-word;
  position: relative;
  z-index: 4;
}

.exam-title.long-title {
  font-size: clamp(0.75rem, 2.8vw, 0.85rem);
}

/* ===== حاوية الشارات - مصغرة وذكية ===== */
.exam-badges-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  width: 100%;
  flex-wrap: wrap;
}

/* ===== سنة النشر: مخفية بصرياً ولكن متاحة لـ SEO ===== */
.exam-year {
  /* إخفاء بصري مع الحفاظ على البيانات لـ SEO */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  /* البيانات متاحة لقارئات الشاشة ومحركات البحث */
  clip-path: inset(50%);
}

/* ===== شارة المنهج - صغيرة وأنيقة ===== */
.curriculum-badge {
  font-size: clamp(0.55rem, 2vw, 0.65rem);
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(192, 57, 43, 0.85) 0%,
    rgba(231, 76, 60, 0.85) 100%
  );
  padding: 2px 8px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.1px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  max-width: 90px;
  transition: all 0.3s ease;
}

.curriculum-badge span {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
}

.explorer-card:hover .curriculum-badge {
  background: linear-gradient(
    135deg,
    rgba(192, 57, 43, 1) 0%,
    rgba(231, 76, 60, 1) 100%
  );
  box-shadow: 0 3px 6px rgba(192, 57, 43, 0.3);
}

/* ===== الإحصائيات: ذكية - تظهر عند التحويم فقط ===== */
.exam-stats-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(30, 40, 50, 0.8) 100%
  );
  padding: 3px 10px;
  border-radius: 15px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;

  /* الإخفاء الذكي: شفافة جداً افتراضياً */
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تظهر الإحصائيات عند التحويم على البطاقة */
.explorer-card:hover .exam-stats-overlay {
  opacity: 1;
  transform: translateY(0);
}

.exam-stats-overlay span {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  font-size: 0.6rem;
}

.exam-stats-overlay i {
  font-size: 0.6rem;
  color: #fbbf24;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.exam-stats-overlay span:first-child::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  margin-right: 5px;
  margin-left: 2px;
}

/* ===== تحسينات متقدمة للعنوان ===== */
.exam-title-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 4px;
}

.exam-title-wrapper::before {
  content: "";
  position: absolute;
  bottom: -2px;
  right: 50%;
  transform: translateX(50%);
  width: 40px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5) 30%,
    rgba(255, 215, 0, 0.7) 70%,
    transparent 100%
  );
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.explorer-card:hover .exam-title-wrapper::before {
  opacity: 1;
}

/* العمود الفقري - تم إصلاحه للـ RTL */
.exam-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 12px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.15),
    rgba(255, 255, 255, 0.08) 30%,
    rgba(0, 0, 0, 0.08) 70%
  );
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
  z-index: 5;
  box-shadow: inset 1px 0 2px rgba(0, 0, 0, 0.08);
}

/* شارة الصف الدراسي - أنيقة وغير معيقة */
.exam-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  background: rgba(0, 43, 91, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  font-size: clamp(0.55rem, 2vw, 0.65rem);
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.2px;
  text-align: center;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
  max-width: 85%;
  transition: all 0.3s ease;
}

.exam-badge i {
  font-size: 0.55rem;
  color: #fbbf24;
}

.explorer-card:hover .exam-badge {
  background: rgba(0, 43, 91, 0.9);
  box-shadow: 0 6px 12px rgba(0, 43, 91, 0.3);
}

/* شارة نوع الاختبار - محدثة للـ RTL */
.exam-type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--accent-blue) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 15px;
  font-size: clamp(0.5rem, 1.8vw, 0.6rem);
  color: white;
  font-weight: 600;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(2px);
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}

.explorer-card:hover .exam-type-badge {
  box-shadow: 0 4px 8px rgba(0, 43, 91, 0.25);
}

/* شارة الحل - محدثة للـ RTL */
.solution-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  background: linear-gradient(135deg, var(--success) 0%, #0d8c4b 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  font-size: clamp(0.45rem, 1.5vw, 0.55rem);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 2px;
  backdrop-filter: blur(2px);
  transition: all 0.3s ease;
}

.solution-badge i {
  font-size: clamp(0.45rem, 1.5vw, 0.55rem);
  color: white;
}

.explorer-card:hover .solution-badge {
  box-shadow: 0 3px 6px rgba(13, 140, 75, 0.3);
}

/* حاوية زر التحميل */
.download-btn-container {
  width: 100%;
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-size: clamp(0.75rem, 2.5vw, 0.85rem);
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  width: 100%;
  backdrop-filter: blur(2px);
  letter-spacing: 0.2px;
  background: var(--btn-exam);
}

.download-btn i {
  font-size: 0.85rem;
}

.download-btn:hover {
  background: var(--btn-exam-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(150, 56, 5, 0.35);
}

/* تأثير لمعان خفيف - تم إصلاحه للـ RTL */
.exam-cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.03) 40%,
    rgba(255, 255, 255, 0) 80%
  );
  z-index: 4;
  pointer-events: none;
  opacity: 0.25;
  border-radius: 15px 3px 3px 15px;
}

/* حركة الاختبار عند التحويم - تم إصلاحها للـ RTL */
.exam-link-wrapper:hover .exam-cover {
  transform: rotateY(22deg) translateZ(4px);
  box-shadow:
    -12px 18px 28px rgba(0, 0, 0, 0.28),
    4px 0 12px rgba(0, 0, 0, 0.18);
}

/* ===== حالة عدم وجود نتائج ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--light-gray);
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  width: 100%;
  box-sizing: border-box;
}

.empty-state i {
  font-size: 2rem;
  color: #ccc;
  margin-bottom: 12px;
  opacity: 0.7;
}

.empty-state h2,
.empty-state h3 {
  color: var(--primary-blue);
  margin-bottom: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  max-width: 100%;
}

.empty-state p {
  color: var(--gray-text);
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.4;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state strong {
  color: var(--primary-blue);
  font-weight: 600;
}

.empty-state-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
  max-width: 280px;
}

.empty-state .btn-primary-custom {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: "Tajawal", sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.8rem;
  height: 36px;
  text-decoration: none;
  flex: 1;
  min-width: 120px;
}

.empty-state .btn-primary-custom:hover {
  background: var(--secondary-blue);
}

.empty-state .btn-outline-custom {
  background: white;
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: "Tajawal", sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
  height: 36px;
  text-decoration: none;
  flex: 1;
  min-width: 120px;
}

.empty-state .btn-outline-custom:hover {
  background: rgba(0, 43, 91, 0.05);
}

.empty-state .btn-primary-custom i,
.empty-state .btn-outline-custom i {
  font-size: 0.7rem;
  margin-left: 4px;
}

/* ===== البطاقات المدمجة للإعلانات ===== */
.ad-card-native {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: var(--border-radius-sm);
  border: 2px dashed var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  min-height: 450px;
  transition: var(--transition);
  box-shadow: var(--shadow);
  height: 100%;
  grid-column: span 1;
}

.ad-card-native:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-blue);
}

.ad-card-native .ad-label {
  font-size: 0.7rem;
  color: var(--gray-text);
  margin-bottom: 10px;
  display: block;
}

.ad-space-wrapper {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(248, 250, 252, 0.9)
  );
  border-radius: var(--border-radius-sm);
  padding: 20px;
  border: 1px solid var(--light-gray);
  box-shadow: var(--shadow-sm);
  margin-bottom: 25px;
  text-align: center;
}

.ad-space-wrapper .ad-label {
  font-size: 0.75rem;
  color: var(--gray-text);
  margin-bottom: 10px;
  display: block;
  font-weight: 500;
}

/* الترقيم - محسّن */
.pagination-container {
  display: flex;
  justify-content: center;
  margin: 40px 0 30px;
}

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.page-item {
  margin: 0;
}

.page-link {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--primary-blue);
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  transition: var(--transition);
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 40px;
  text-align: center;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-link:hover {
  background: var(--bg-color);
  color: var(--primary-blue);
  transform: translateY(-1px);
}

.page-item.active .page-link {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: white;
  border-color: var(--primary-blue);
  box-shadow: var(--shadow);
}

.page-item.disabled .page-link {
  color: var(--light-gray);
  background: var(--bg-color);
  cursor: not-allowed;
  transform: none;
}

.page-item:not(.active):not(.disabled) .page-link:hover {
  box-shadow: var(--shadow-sm);
}

/* ===== تحسينات للهواتف ===== */
@media (max-width: 768px) {
  :root {
    --poster-height-mobile: 280px;
  }

  /* على الهواتف: البطاقة تأخذ عرض العمود بالكامل */
  .explorer-card {
    width: 100%;
  }

  .exam-card {
    max-width: min(100%, 180px);
  }

  .explorer-hero {
    min-height: 260px;
    padding: 60px 12px 25px;
    margin-bottom: 20px;
  }

  .hero-content {
    padding: 0 15px;
    margin-bottom: 20px;
  }

  .hero-icon {
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
    margin-bottom: 12px;
  }

  .hero-content h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    max-width: 90%;
    line-height: 1.3;
  }

  .hero-content p {
    font-size: 0.95rem;
    margin-bottom: 15px;
    max-width: 90%;
    line-height: 1.5;
  }

  .explorer-hero-content {
    max-width: 90%;
    margin-top: 10px;
  }

  .explorer-hero-search {
    max-width: 90%;
    margin: 0.8rem auto 0;
  }

  .search-input-wrapper {
    border-radius: 45px;
    padding: 5px;
    max-width: 95%;
  }

  .search-icon {
    padding: 0 12px 0 10px;
    font-size: 1rem;
    min-width: 45px;
  }

  .explorer-hero-search-input {
    padding: 14px 10px;
    font-size: 1rem;
  }

  .explorer-hero-search-input::placeholder {
    font-size: 0.95rem;
  }

  .filter-btn-main {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-width: 90px;
    height: 46px;
    margin-left: 5px;
    gap: 6px;
  }

  .breadcrumb-container {
    top: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
  }

  .breadcrumb {
    font-size: 0.8rem;
  }

  .breadcrumb a {
    padding: 4px 6px;
  }

  .type-tabs-container {
    gap: 6px;
    margin: 10px 0 12px;
    padding: 10px;
    border-radius: 12px;
  }

  .type-tab {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 20px;
    gap: 5px;
    min-height: 36px;
  }

  .type-tab i {
    font-size: 0.8rem;
  }

  .fixed-filters-bar {
    display: none;
  }

  .mobile-filter-btn {
    display: flex;
  }

  .explorer-grid {
    gap: 15px;
  }

  /* على الهواتف: الإحصائيات تظهر دائماً بحجم أصغر */
  .exam-stats-overlay {
    opacity: 0.85;
    transform: translateY(0);
    padding: 2px 8px;
    font-size: 0.55rem;
  }

  .exam-stats-overlay span {
    font-size: 0.55rem;
  }

  .exam-stats-overlay i {
    font-size: 0.55rem;
  }

  .exam-badge {
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    font-size: clamp(0.5rem, 1.8vw, 0.6rem);
  }

  .exam-type-badge {
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    font-size: clamp(0.45rem, 1.5vw, 0.55rem);
    max-width: 50%;
  }

  .solution-badge {
    bottom: 6px;
    right: 6px;
    padding: 2px 5px;
    font-size: clamp(0.4rem, 1.3vw, 0.5rem);
  }

  .exam-title {
    font-size: clamp(0.7rem, 2.8vw, 0.8rem);
  }

  .curriculum-badge {
    font-size: clamp(0.5rem, 1.8vw, 0.6rem);
    padding: 2px 6px;
    max-width: 80px;
  }

  .curriculum-badge span {
    max-width: 60px;
  }

  .cover-content {
    padding: 10px 5px;
  }

  .download-btn {
    padding: 7px 12px;
    font-size: clamp(0.7rem, 2.2vw, 0.8rem);
  }

  .ad-card-native {
    min-height: 380px;
    grid-column: 1 / -1;
    padding: 15px;
  }

  .empty-state {
    padding: 40px 15px;
  }

  .empty-state i {
    font-size: 3rem;
  }

  .empty-state h2,
  .empty-state h3 {
    font-size: 1.3rem;
  }

  .empty-state p {
    font-size: 0.9rem;
  }

  .empty-state-actions {
    flex-direction: column;
    align-items: center;
  }

  .empty-state .btn-primary-custom,
  .empty-state .btn-outline-custom {
    width: 100%;
    max-width: 250px;
  }
}

@media (max-width: 480px) {
  :root {
    --poster-height-mobile: 260px;
  }

  .exam-card {
    max-width: min(100%, 160px);
  }

  .explorer-hero {
    min-height: 220px;
    padding: 50px 10px 20px;
  }

  .hero-content h1 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .hero-content p {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }

  .hero-icon {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
    margin-bottom: 10px;
  }

  .filter-btn-main {
    padding: 8px 12px;
    font-size: 0.85rem;
    min-width: 70px;
    height: 42px;
    gap: 4px;
  }

  .filter-btn-main span {
    font-size: 0.8rem;
  }

  .explorer-grid {
    gap: 12px;
  }

  .exam-3d {
    aspect-ratio: 1 / 1.48;
  }

  .cover-content {
    padding: 8px 4px;
  }

  .exam-title {
    font-size: clamp(0.65rem, 2.5vw, 0.75rem);
  }

  .curriculum-badge {
    font-size: clamp(0.45rem, 1.5vw, 0.55rem);
    padding: 1px 5px;
    max-width: 70px;
  }

  .curriculum-badge span {
    max-width: 55px;
  }

  .exam-stats-overlay {
    gap: 4px;
    padding: 2px 6px;
    font-size: 0.5rem;
  }

  .exam-stats-overlay span {
    font-size: 0.5rem;
    gap: 2px;
  }

  .exam-stats-overlay i {
    font-size: 0.5rem;
  }

  .exam-stats-overlay span:first-child::after {
    height: 5px;
    margin-right: 3px;
  }

  .exam-badge {
    padding: 2px 6px;
    font-size: clamp(0.45rem, 1.5vw, 0.55rem);
    gap: 3px;
  }

  .exam-type-badge {
    padding: 1px 5px;
    font-size: clamp(0.4rem, 1.3vw, 0.5rem);
  }

  .solution-badge {
    padding: 1px 4px;
    font-size: clamp(0.35rem, 1.2vw, 0.45rem);
  }

  .download-btn {
    padding: 6px 10px;
    font-size: clamp(0.65rem, 2vw, 0.75rem);
  }

  .download-btn i {
    font-size: 0.75rem;
  }

  .ad-card-native {
    min-height: 350px;
    grid-column: 1 / -1;
  }
}

@media (max-width: 360px) {
  :root {
    --poster-height-mobile: 240px;
  }

  .exam-card {
    max-width: min(100%, 145px);
  }

  .explorer-grid {
    gap: 10px;
  }

  .type-tab {
    padding: 5px 10px;
    font-size: 0.7rem;
    min-height: 32px;
  }

  .filter-btn-main {
    padding: 6px 10px;
    min-width: 50px;
    height: 38px;
    gap: 3px;
  }

  .filter-btn-main span {
    display: none;
  }

  .filter-btn-main i {
    font-size: 0.9rem;
    margin: 0;
  }

  .exam-title {
    font-size: clamp(0.6rem, 2.2vw, 0.7rem);
  }

  .curriculum-badge {
    max-width: 60px;
  }

  .curriculum-badge span {
    max-width: 45px;
  }

  .exam-badges-container {
    flex-direction: column;
    gap: 2px;
  }

  .download-btn {
    padding: 5px 8px;
    font-size: clamp(0.6rem, 1.8vw, 0.7rem);
  }

  .ad-card-native {
    min-height: 320px;
  }
}

/* ===== تحسينات للهواتف الصغيرة جداً ===== */
@media (max-width: 320px) {
  .exam-card {
    max-width: min(100%, 130px);
  }

  .explorer-hero {
    min-height: 200px;
    padding: 45px 8px 18px;
  }

  .hero-content h1 {
    font-size: 1.15rem;
  }

  .hero-content p {
    font-size: 0.85rem;
  }

  .hero-icon {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }

  .search-input-wrapper {
    padding: 4px;
  }

  .filter-btn-main {
    padding: 5px 8px;
    min-width: 40px;
    height: 36px;
  }

  .type-tabs-container {
    padding: 8px;
    gap: 5px;
  }

  .type-tab {
    padding: 4px 8px;
    font-size: 0.65rem;
    min-height: 28px;
  }

  .explorer-grid {
    gap: 8px;
  }

  .exam-spine {
    width: 10px;
  }

  .exam-badge {
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    font-size: 0.5rem;
  }

  .exam-type-badge {
    top: 4px;
    right: 4px;
    padding: 1px 4px;
    font-size: 0.45rem;
  }

  .solution-badge {
    bottom: 4px;
    right: 4px;
    padding: 1px 4px;
    font-size: 0.4rem;
  }

  .exam-title {
    font-size: 0.65rem;
  }

  .curriculum-badge {
    padding: 1px 4px;
    font-size: 0.45rem;
  }

  .exam-stats-overlay {
    padding: 1px 5px;
    font-size: 0.45rem;
  }

  .exam-stats-overlay span {
    font-size: 0.45rem;
  }

  .exam-stats-overlay i {
    font-size: 0.45rem;
  }

  .download-btn {
    padding: 4px 6px;
    font-size: 0.6rem;
  }

  .download-btn i {
    font-size: 0.65rem;
  }
}

/* ===== الدرج السفلي للموبايل ===== */
.bottom-sheet-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80vh;
  max-height: 80vh;
  background: white;
  border-radius: 25px 25px 0 0;
  z-index: 2001;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bottom-sheet.active {
  transform: translateY(0);
}

.sheet-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.sheet-header::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
}

.sheet-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-top: 10px;
}

.close-sheet {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 5px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.close-sheet:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 120px;
}

/* زر الفلترة للموبايل */
.mobile-filter-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--accent-blue) 100%
  );
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 30px;
  font-family: "Tajawal", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(0, 43, 91, 0.3);
  transition: var(--transition);
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-filter-btn:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 43, 91, 0.4);
}

/* تأثيرات التحميل */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* تحسين إمكانية الوصول */
.type-tab:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* تمييز كلمات البحث */
.highlight-search {
  background-color: #fff3cd;
  color: #856404;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}

.search-highlight-wrapper {
  background-color: rgba(255, 243, 205, 0.3);
  border-left: 3px solid #ffc107;
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
}

/* ===== تحسين خاص للبطاقات في وضع التحويم ===== */
.explorer-card:hover .exam-title {
  text-shadow:
    0 4px 8px rgba(0, 0, 0, 0.7),
    0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ===== إضافة تأثير لمعان للعنوان عند التحويم ===== */
@keyframes titleGlow {
  0% {
    text-shadow:
      0 2px 4px rgba(0, 0, 0, 0.6),
      0 1px 2px rgba(0, 0, 0, 0.4);
  }
  50% {
    text-shadow:
      0 4px 8px rgba(0, 43, 91, 0.7),
      0 2px 4px rgba(255, 255, 255, 0.15),
      0 1px 2px rgba(0, 0, 0, 0.4);
  }
  100% {
    text-shadow:
      0 2px 4px rgba(0, 0, 0, 0.6),
      0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

.explorer-card:hover .exam-title {
  animation: titleGlow 2s ease infinite;
}

/* ===== دعم تحسين محركات البحث (SEO) ===== */
/* البيانات المخفية بصرياً متاحة لقارئات الشاشة ومحركات البحث */
@media not screen and (prefers-reduced-motion) {
  .exam-year {
    clip-path: inset(50%);
  }
}

/* تأكد من أن البيانات المخفية متاحة للروبوتات */
.exam-year,
.exam-stats-overlay {
  /* محركات البحث يمكنها قراءة المحتوى حتى لو كان مخفياً بصرياً */
  speak: normal;
}
/* Ad Spaces Styling */
.ad-label {
  font-size: 0.8rem;
  color: #888;
  display: block;
  margin-bottom: 5px;
}
.ad-space-wrapper {
  overflow: hidden;
  width: 100%;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}
.ad-sidebar-wrapper {
  margin-top: 1rem;
  text-align: center;
}
.ad-native-wrapper {
  overflow: hidden;
  margin: 30px 0;
  border-radius: 12px;
  background: #f9f9f9;
  border: 1px dashed #ccc;
  padding: 15px;
  text-align: center;
}
article.ad-native-wrapper.explorer-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}
article.ad-native-wrapper.explorer-card .book-card,
article.ad-native-wrapper.explorer-card .exam-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #f9f9f9;
  border: 1px dashed #ccc;
  padding: 15px;
}
article.ad-native-wrapper.explorer-card .book-card .ad-label,
article.ad-native-wrapper.explorer-card .exam-card .ad-label {
  margin-bottom: 10px;
}
.modal-ad-container {
  margin-top: 20px;
  text-align: center;
  overflow: hidden;
  border-radius: 8px;
}
.modal-ad-container .ad-label {
  font-size: 0.75rem;
}
