/* ==========================================================================
   Smart Course Cover V7.9
   More than one cover design + global default + per-course override
   ========================================================================== */

.smart-course-cover{
  --sc-a:#1d4ed8;
  --sc-b:#7c3aed;
  --sc-c:#06b6d4;
  width:100%;
  height:100%;
  min-height:100%;
  position:relative;
  overflow:hidden;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:14px;
  color:#fff;
  text-align:right;
  background:
    radial-gradient(circle at 86% 12%,color-mix(in srgb,var(--sc-c) 48%,transparent),transparent 35%),
    radial-gradient(circle at 8% 90%,color-mix(in srgb,var(--sc-b) 45%,transparent),transparent 38%),
    linear-gradient(135deg,var(--sc-a),var(--sc-b) 58%,var(--sc-c));
}
.smart-course-cover::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background:
    linear-gradient(115deg,rgba(255,255,255,.08),transparent 28%,rgba(255,255,255,.04) 48%,transparent 72%),
    radial-gradient(circle at 50% 46%,rgba(255,255,255,.08),transparent 42%);
}
.smart-course-cover::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:inset 0 0 55px rgba(0,0,0,.12);
  pointer-events:none;
}
.smart-cover-art{
  position:absolute; inset:0; width:100%; height:100%; z-index:-1; opacity:.58;
}
.smart-art-circle{fill:rgba(255,255,255,.08)}
.smart-art-circle-b{fill:rgba(255,255,255,.05)}
.smart-art-wave{fill:none;stroke:rgba(255,255,255,.15);stroke-width:2.2}
.smart-art-wave-2{stroke:rgba(255,255,255,.08)}
.smart-art-dots{fill:rgba(255,255,255,.22)}

.smart-cover-top,.smart-cover-bottom{
  position:relative; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:8px;
}
.smart-cover-stage,.smart-cover-brand,.smart-cover-type{
  display:inline-flex; align-items:center; gap:5px; min-width:0;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(15,23,42,.20);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border-radius:999px; color:#fff; line-height:1; box-shadow:0 5px 16px rgba(15,23,42,.10);
}
.smart-cover-stage{padding:6px 9px; font-size:9px; font-weight:900}
.smart-cover-center{
  position:relative; z-index:2; display:flex; flex-direction:column; align-items:flex-start; justify-content:center;
  gap:5px; min-height:0; padding:2px 2px 4px;
}
.smart-cover-icon{
  width:42px; height:42px; display:grid; place-items:center; border-radius:14px;
  border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.13);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  box-shadow:0 9px 24px rgba(15,23,42,.16); font-size:20px; transform:rotate(-3deg);
}
.smart-cover-subject{font-size:9px; font-weight:900; letter-spacing:.02em; opacity:.82}
.smart-course-cover-title{
  width:100%; max-width:95%; color:#fff; font-family:'Cairo',sans-serif; font-weight:1000;
  line-height:1.35; text-shadow:0 5px 18px rgba(15,23,42,.32); overflow:hidden;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
}
.smart-title-lg{font-size:23px}
.smart-title-md{font-size:19px}
.smart-title-sm{font-size:16px}
.smart-title-xs{font-size:14px; line-height:1.45}
.smart-cover-brand{
  max-width:68%; padding:5px 8px; font-size:8px; font-weight:800; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
}
.smart-cover-type{padding:5px 8px; font-size:8px; font-weight:900}

/* Subject palettes */
.smart-cover-arabic{--sc-a:#064e3b;--sc-b:#0f766e;--sc-c:#f59e0b}
.smart-cover-math{--sc-a:#312e81;--sc-b:#4f46e5;--sc-c:#06b6d4}
.smart-cover-science{--sc-a:#064e3b;--sc-b:#059669;--sc-c:#84cc16}
.smart-cover-english{--sc-a:#581c87;--sc-b:#7c3aed;--sc-c:#ec4899}
.smart-cover-islamic{--sc-a:#0f172a;--sc-b:#0f766e;--sc-c:#d4a72c}
.smart-cover-computer{--sc-a:#111827;--sc-b:#1d4ed8;--sc-c:#06b6d4}
.smart-cover-social{--sc-a:#78350f;--sc-b:#c2410c;--sc-c:#f59e0b}
.smart-cover-general{--sc-a:#172554;--sc-b:#2563eb;--sc-c:#8b5cf6}

/* Variants */
.smart-variant-aurora{}

.smart-variant-glass{
  background:
    radial-gradient(circle at 85% 15%,rgba(255,255,255,.20),transparent 32%),
    linear-gradient(135deg,color-mix(in srgb,var(--sc-a) 72%,white 20%),color-mix(in srgb,var(--sc-b) 72%,white 25%) 60%,color-mix(in srgb,var(--sc-c) 72%,white 18%));
}
.smart-variant-glass::before{
  background:
    linear-gradient(120deg,rgba(255,255,255,.28),transparent 24%,rgba(255,255,255,.12) 46%,transparent 68%),
    radial-gradient(circle at 20% 15%,rgba(255,255,255,.18),transparent 20%);
}
.smart-variant-glass .smart-cover-stage,
.smart-variant-glass .smart-cover-brand,
.smart-variant-glass .smart-cover-type,
.smart-variant-glass .smart-cover-icon{
  background:rgba(255,255,255,.16);
  border-color:rgba(255,255,255,.26);
  box-shadow:0 10px 24px rgba(255,255,255,.08),0 8px 18px rgba(15,23,42,.12);
}

.smart-variant-academy{
  background:linear-gradient(135deg,var(--sc-a),color-mix(in srgb,var(--sc-b) 84%,black 6%) 65%,var(--sc-c));
}
.smart-variant-academy::before{
  background:
    repeating-linear-gradient(135deg,rgba(255,255,255,.05) 0 10px,transparent 10px 20px),
    linear-gradient(90deg,rgba(255,255,255,.08),transparent 35%);
}
.smart-variant-academy::after{
  border:2px solid rgba(255,255,255,.18);
  box-shadow:inset 0 0 0 7px rgba(255,255,255,.04);
}
.smart-variant-academy .smart-cover-stage,
.smart-variant-academy .smart-cover-type{ border-radius:12px; }
.smart-variant-academy .smart-cover-icon{ border-radius:10px; transform:none; }
.smart-variant-academy .smart-cover-subject{ letter-spacing:.08em; text-transform:uppercase; }

.smart-variant-bold{
  background:linear-gradient(135deg,var(--sc-a),var(--sc-b) 55%,var(--sc-c));
}
.smart-variant-bold::before{
  background:
    linear-gradient(145deg,rgba(255,255,255,.10) 0 8%,transparent 8% 18%,rgba(255,255,255,.05) 18% 22%,transparent 22% 100%),
    linear-gradient(320deg,rgba(0,0,0,.12),transparent 34%);
}
.smart-variant-bold::after{
  border:0;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.14), inset 0 -40px 60px rgba(0,0,0,.12);
}
.smart-variant-bold .smart-cover-stage,
.smart-variant-bold .smart-cover-type{ background:rgba(0,0,0,.20); border-radius:10px; }
.smart-variant-bold .smart-cover-icon{ border-radius:10px; transform:skewX(-8deg); }
.smart-variant-bold .smart-art-wave{ stroke:rgba(255,255,255,.10); }

/* Card integration */
.course-thumb > .smart-course-cover{ position:absolute; inset:0; }
.stage-course-cover > .smart-course-cover{ width:100%; min-height:100%; }
.course-card:hover .smart-course-cover .smart-cover-icon{ transform:rotate(0deg) scale(1.06); }
.course-card:hover .smart-variant-bold .smart-cover-icon{ transform:skewX(-8deg) scale(1.06); }
.course-card:hover .smart-variant-academy .smart-cover-icon{ transform:scale(1.04); }
.course-card:hover .smart-course-cover{ filter:saturate(1.05); }
.smart-course-cover,.smart-cover-icon{ transition:transform .35s ease,filter .35s ease; }

/* Compact */
.smart-cover-compact{ padding:12px; }
.smart-cover-compact .smart-cover-icon{ width:36px; height:36px; border-radius:12px; font-size:17px; }
.smart-cover-compact .smart-title-lg{ font-size:20px; }
.smart-cover-compact .smart-title-md{ font-size:17px; }
.smart-cover-compact .smart-title-sm{ font-size:15px; }
.smart-cover-compact .smart-title-xs{ font-size:13px; }

/* Preview */
.course-cover-preview-panel{
  margin-top:13px; padding:12px; border:1px solid var(--border-color);
  border-radius:18px; background:var(--bg-color-alt);
}
.course-cover-preview-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px;
}
.course-cover-preview-head strong{ display:block; color:var(--text-dark); font-size:13px; }
.course-cover-preview-head strong i{ color:var(--admin-theme,var(--main-theme,#2563eb)); margin-left:5px; }
.course-cover-preview-head small{ display:block; margin-top:3px; color:var(--text-muted); font-size:10px; line-height:1.7; }

.course-cover-live-preview{
  width:min(100%,390px); aspect-ratio:16/9; margin:0 auto; overflow:hidden; border-radius:17px;
  box-shadow:0 14px 34px rgba(15,23,42,.16); background:#0f172a;
}
.course-cover-live-preview > .smart-course-cover{ width:100%; height:100%; }

.admin-course-image-preview{ width:100%; height:100%; position:relative; overflow:hidden; }
.admin-course-image-preview img{ width:100%; height:100%; object-fit:cover; display:block; }
.admin-course-image-preview span{
  position:absolute; right:10px; bottom:10px; padding:6px 9px; border-radius:999px; color:#fff;
  background:rgba(15,23,42,.70); backdrop-filter:blur(8px); font-size:9px; font-weight:900;
}

/* Galleries */
.smart-cover-style-gallery-wrap,
.course-style-gallery-wrap{
  margin-top:14px; padding:14px; border:1px solid var(--border-color); border-radius:18px; background:var(--bg-color-alt);
}
.smart-cover-style-gallery-head,
.course-style-gallery-head{ margin-bottom:12px; }
.smart-cover-style-gallery-head strong,
.course-style-gallery-head strong{
  display:block; color:var(--text-dark); font-size:14px; font-weight:900;
}
.smart-cover-style-gallery-head small,
.course-style-gallery-head small{
  display:block; margin-top:4px; color:var(--text-muted); font-size:11px; font-weight:700;
}
.smart-cover-style-gallery,
.course-style-gallery{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px;
}
.smart-style-card{
  width:100%; padding:8px; border:1px solid var(--border-color); background:var(--card-bg); border-radius:18px;
  text-align:right; cursor:pointer; transition:var(--transition); box-shadow:var(--shadow-sm);
}
.smart-style-card:hover{
  transform:translateY(-4px); box-shadow:0 12px 24px rgba(15,23,42,.10);
  border-color:color-mix(in srgb,var(--main-theme) 32%,var(--border-color));
}
.smart-style-card.selected{
  border-color:var(--main-theme);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--main-theme) 16%,transparent),0 12px 24px rgba(15,23,42,.12);
}
.smart-style-card-preview{
  width:100%; aspect-ratio:16/9; border-radius:14px; overflow:hidden; background:#0f172a;
}
.smart-style-card-preview .smart-course-cover{ width:100%; height:100%; }
.smart-style-card-meta{ padding:9px 4px 4px; display:flex; flex-direction:column; gap:2px; }
.smart-style-card-meta strong{ font-size:12px; font-weight:900; color:var(--text-dark); }
.smart-style-card-meta span{ font-size:10px; font-weight:800; color:var(--text-muted); line-height:1.6; }

/* Theme-specific treatment preserved */
html[data-platform-theme="girls"] .smart-course-cover{ border-radius:24px; }
html[data-platform-theme="girls"] .smart-cover-icon{ border-radius:50% 50% 42% 58% / 52% 44% 56% 48%; }
html[data-platform-theme="action"] .smart-course-cover{ clip-path:polygon(0 0,94% 0,100% 13%,100% 100%,6% 100%,0 87%); }
html[data-platform-theme="action"] .smart-cover-icon{ border-radius:6px; }
html[data-platform-theme="horror"] .smart-course-cover{ filter:saturate(.82) contrast(1.04); }
html[data-platform-theme="horror"] .smart-cover-stage,
html[data-platform-theme="horror"] .smart-cover-brand{ border-radius:4px; }

@media(max-width:768px){
  .smart-course-cover{ padding:11px; }
  .smart-cover-stage{ font-size:8px; padding:5px 7px; }
  .smart-cover-icon{ width:36px; height:36px; font-size:17px; border-radius:12px; }
  .smart-title-lg{ font-size:19px; }
  .smart-title-md{ font-size:17px; }
  .smart-title-sm{ font-size:14px; }
  .smart-title-xs{ font-size:12px; }
  .smart-cover-brand,.smart-cover-type{ font-size:7px; }
  .smart-cover-style-gallery,.course-style-gallery{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:430px){
  .smart-cover-stage{ max-width:72%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .smart-cover-center{ gap:4px; }
  .smart-cover-icon{ width:34px; height:34px; font-size:16px; }
  .smart-course-cover-title{-webkit-line-clamp:2}
  .course-cover-preview-head{ flex-direction:column; }
  .smart-cover-style-gallery,.course-style-gallery{ grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce){
  .smart-course-cover,.smart-cover-icon,.smart-style-card{ transition:none !important; }
}
