/* Animation */
.fade-in { animation: fadeIn 0.4s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* === SKELETON LOADING === */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #f0f2f5;     /* ✅ نهاري */
  animation: none;         /* ✅ لا نحرك الخلفية نفسها */
  border-radius: 6px;
}

/* ✅ ليلي: قاعدة داكنة */
.dark .skeleton{
  background: rgba(255,255,255,0.08);
}

/* ✅ shimmer overlay */
.skeleton::after{
  content:"";
  position:absolute;
  inset:0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    transparent 0,
    rgba(255,255,255,0.55) 50%,
    transparent 100%
  );
  animation: shimmer 1.2s linear infinite; /* ✅ نفس اسم الأنيميشن */
}

/* ✅ shimmer أخف في الوضع الليلي حتى لا يظهر أبيض */
.dark .skeleton::after{
  background-image: linear-gradient(
    90deg,
    transparent 0,
    rgba(255,255,255,0.12) 50%,
    transparent 100%
  );
}

@keyframes shimmer { 100% { transform: translateX(100%); } }

/* View Toggle Styles */
.active-mode {
  background-color: white;
  color: #00607e !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.dark .active-mode { background-color: #374151; color: #38bdf8 !important; }

/* Utilities */
.card-img { width: 100%; height: 100%; object-fit: cover; display:block; }
.truncate-1 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }

.badge-new {
  position: absolute; top: 6px; left: 6px;
  background: #f39200; color: white;
  font-size: 10px; padding: 2px 6px; border-radius: 6px;
  z-index: 5; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ✅ FREE badge (same style as .badge-new, but top-right + RED) */
.badge-free{
  position: absolute; top: 6px; right: 6px; left: auto;
  background: #dc2626; color: white; /* red-600 */
  font-size: 10px; padding: 2px 6px; border-radius: 6px;
  z-index: 5; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  font-weight: 700; /* تثبيت نفس وزن “جديد” */
}

/* Live badge */
.live-badge-pulse {
  display: inline-flex; align-items: center; gap: 6px;
  color: #ef4444; font-weight: 800; font-size: 10px;
  background: transparent; /* ✅ بدون خلفية */
  padding: 0;             /* ✅ بدون حشو */
}
.live-dot {
  width: 6px; height: 6px; background: #ef4444; border-radius: 50%;
  animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Countdown live-now state */
.countdown.live-now span{
  color: #ef4444;
  font-weight: 800;
}

/* ===========================
   GRID VIEW (Fixed width)
   =========================== */
.view-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, 145px);
  justify-content: center;
  gap:16px;
  padding-bottom:40px;
}
@media (max-width: 640px){
  .view-grid{
    grid-template-columns: repeat(2, 145px);
    justify-content: center;
    gap:10px;
  }
}
@media (max-width: 340px){
  .view-grid{ grid-template-columns: 145px; }
}

.view-grid .card-item{
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
  transition: all 0.2s ease;
}
.dark .view-grid .card-item{ background:#1f2937; border-color:#374151; }

.view-grid .card-item:hover{
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.view-grid .card-img-wrapper{
  width:100%;
  aspect-ratio:3/4;
  position:relative;
  overflow:hidden;
  background:#f3f4f6;
}

.view-grid .card-body{
  padding:8px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

/* ✅ Grid live footer: same card color + top border separator */
.view-grid .card-footer{
  padding:10px 8px;
  background: transparent;                 /* ✅ نفس البطاقة */
  border-top: 1px solid rgba(229,231,235,0.9); /* ✅ فاصل */
  cursor:pointer;
  text-align:center;
  transition: background 0.2s ease, transform 0.15s ease;
  user-select:none;

  /* ✅ محاذاة منتصف القسم */
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.dark .view-grid .card-footer{ border-top-color: rgba(55,65,81,0.8); }

.view-grid .card-footer:hover{
  background: rgba(0,96,126,0.04); /* ✅ تمييز خفيف */
  transform: translateY(-1px);
}
.dark .view-grid .card-footer:hover{
  background: rgba(56,189,248,0.08);
}

/* ===========================
   LIST VIEW (Aligned layout)
   =========================== */
.view-list{ display:flex; flex-direction:column; gap:12px; }

.view-list .card-item{
  display:flex;
  flex-direction: row;
  align-items: stretch;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
  height: 112px;
  transition: all 0.2s ease;
}
.dark .view-list .card-item{ background:#1f2937; border-color:#374151; }

.view-list .card-item:hover{
  transform: translateX(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.view-list .card-img-wrapper{
  width:112px;
  height:100%;
  flex: 0 0 112px;
  background:#f3f4f6;
  overflow:hidden;
}

.view-list .card-body{
  flex:1;
  padding:10px 12px;
  display:flex;
  flex-direction: row;
  align-items:center;
  justify-content: space-between;
  gap:10px;
  min-width:0;
}

.view-list .info-col{
  flex:1;
  min-width:0;
}

/* ✅ Live column: same card color + vertical separator line */
.view-list .live-col{
  flex: 0 0 155px;
  display:flex;
  flex-direction: column;
  align-items: center;          /* ✅ وسط */
  justify-content: center;      /* ✅ وسط */
  gap: 6px;
  padding: 10px 12px;

  background: transparent;      /* ✅ نفس البطاقة */
  border-right: 2px solid rgba(229,231,235,1); /* ✅ فاصل عمودي واضح */
  cursor: pointer;
  user-select:none;
  transition: background 0.2s ease, transform 0.15s ease;
  text-align:center;
}
.dark .view-list .live-col{
  border-right-color: rgba(55,65,81,1);
}

.view-list .live-col:hover{
  background: rgba(0,96,126,0.04); /* ✅ تمييز خفيف */
  transform: translateX(-2px);
}
.dark .view-list .live-col:hover{
  background: rgba(56,189,248,0.08);
}

/* ===========================
   Mobile fine-tune (LIST ONLY)
   =========================== */
@media (max-width: 640px){

  /* 1) تصغير عرض قسم الحصة المباشرة */
  .view-list .live-col{
    flex: 0 0 120px;        /* كان 155px */
    padding: 8px 8px;       /* كان 10px 12px */
  }

  /* 2) إبقاء الخط الفاصل لكن أقرب لليسار */
  .view-list .live-col{
    border-right-width: 2px;
  }

  /* 3) إعطاء مساحة أكبر لعمود المعلومات */
  .view-list .info-col{
    padding-left: 6px;
  }

  /* 4) السماح بظهور النصوص كاملة */
  .view-list .info-col .truncate-1{
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ===== Live click states ===== */

/* الحصة غير المجانية */
.live-disabled {
  cursor: not-allowed !important;
  opacity: 0.6;
}

/* منع أي تفاعل فعلي */
.live-disabled * {
  pointer-events: none;
}

/* الحصة المجانية */
.live-enabled {
  cursor: pointer;
}

/* ===========================
   ✅ Grade Filter Bar (Guests) - NEW ONLY
   =========================== */
.oa-grade-filter-wrap{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  padding:10px 10px;
  border-radius:14px;
  border:1px solid rgba(229,231,235,1);
  background:#fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.dark .oa-grade-filter-wrap{
  background:#1f2937;
  border-color:#374151;
}

.oa-grade-filter-btn{
  height:32px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(226,232,240,1);
  background:#f8fafc;
  color:#475569;
  font-weight:800;
  font-size:12px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.oa-grade-filter-btn:hover{
  background: rgba(0,96,126,0.06);
  transform: translateY(-1px);
}
.dark .oa-grade-filter-btn{
  background:#111827;
  border-color:#374151;
  color:#cbd5e1;
}
.dark .oa-grade-filter-btn:hover{
  background: rgba(56,189,248,0.10);
}

.oa-grade-filter-btn.is-active{
  background:#00607e;
  border-color:#00607e;
  color:#fff;
}
.dark .oa-grade-filter-btn.is-active{
  background:#00607e;
  border-color:#00607e;
  color:#fff;
}

.oa-grade-filter-hint{
  margin-top:8px;
  font-size:11px;
  color:#94a3b8;
}
.dark .oa-grade-filter-hint{
  color:#94a3b8;
}
/* Schedule Enter Button (Minimal Outline) */
.oa-enter-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;

  height: 36px;
  padding: 0 14px;

  border-radius: 9px;
  border: 1px solid rgba(243,146,0,.35);
  background: rgba(243,146,0,.10);

  color: #b45309;
  font-family: Tajawal, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;

  cursor:pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}

.oa-enter-btn i{
  font-size: 16px;
  line-height: 1;
}

.oa-enter-btn:hover{
  background: rgba(243,146,0,.16);
  border-color: rgba(243,146,0,.55);
  transform: translateY(-1px);
}

.oa-enter-btn:active{ transform: translateY(0); }

.dark .oa-enter-btn{
  background: rgba(243,146,0,.14);
  border-color: rgba(243,146,0,.35);
  color: #f7b44f;
}
.dark .oa-enter-btn:hover{
  background: rgba(243,146,0,.20);
  border-color: rgba(243,146,0,.55);
}
