/* =============================================
   Uni-Course — Main Stylesheet
   ألوان مستوحاة من لوجو Uni-Course
   ============================================= */

:root {
  /* --- Brand Colors (from logo) --- */
  --primary:       #1A6DB5;
  --primary-dark:  #0f4d87;
  --primary-light: #2E8FD9;
  --secondary:     #5A6472;
  --dark-bg:       #1A1A2E;
  --dark-bg2:      #16213E;

  /* --- Neutral --- */
  --ink:        #0d1117;
  --surface:    #fff;
  --muted:      #F5F7FA;
  --border:     #e8edf2;

  /* --- Semantic --- */
  --gold:   #f59e0b;
  --green:  #10b981;
  --red:    #ef4444;
  --purple: #7c3aed;

  /* --- Text --- */
  --text:  #24292f;
  --text2: #57606a;
  --text3: #8c959f;

  /* --- Accent shades --- */
  --accent-light: #e6f1fb;

  /* --- Shapes --- */
  --radius:    12px;
  --radius-sm: 8px;

  /* --- Shadows --- */
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Tajawal', sans-serif;
  background: var(--surface);
  color: var(--text);
  overflow-x: hidden;
}

/* ─── Typography ─── */
h1, h2, h3, h4 { font-family: 'Cairo', sans-serif; }

/* ─── Utility ─── */
.container   { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.d-flex      { display: flex; }
.gap-8       { gap: 8px; }
.gap-10      { gap: 10px; }
.mt-auto     { margin-top: auto; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  border: none;
  font-family: 'Tajawal', sans-serif;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,109,181,.35); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text2); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--muted); color: var(--text); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }

/* ─── Navigation ─── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 66px;
}
.logo {
  font-family: 'Cairo', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo img { height: 38px; width: auto; }
.logo-mark {
  height: 38px;
  width: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.nav-links a:hover,
.nav-links a.active { background: rgba(46,143,217,.15); color: var(--primary-light); }
.nav-right { display: flex; gap: 10px; align-items: center; }

/* ─── Hero ─── */
.hero {
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-bg2) 55%, var(--dark-bg) 100%);
  padding: 100px 24px 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(26,109,181,.3) 0%, transparent 70%);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-inner { max-width: 1000px; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(26,109,181,.18);
  border: 1px solid rgba(46,143,217,.35);
  color: #93c5fd;
  font-size: .82rem;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 28px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900; color: #fff; line-height: 1.2; margin-bottom: 20px; }
.hero h1 span { color: var(--primary-light); }
.hero p { font-size: 1.1rem; color: #94a3b8; max-width: 560px; margin: 0 auto 40px; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 64px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 2rem; font-weight: 900; color: #fff; }
.hero-stat span { font-size: .85rem; color: #64748b; }

/* ─── Sections ─── */
.section { padding: 80px 24px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 12px;
  letter-spacing: .5px;
}
.section-title { font-size: 2rem; font-weight: 900; color: var(--ink); margin-bottom: 10px; }
.section-sub { color: var(--text2); font-size: .97rem; max-width: 500px; margin: 0 auto; }

/* ─── Category Cards ─── */
.cats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.cat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.cat-icon { font-size: 2.2rem; margin-bottom: 12px; display: block; }
.cat-card h3 { font-weight: 700; font-size: .95rem; color: var(--ink); margin-bottom: 6px; }
.cat-count { font-size: .8rem; color: var(--text3); }

/* ─── Course Cards ─── */
.courses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .25s;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.course-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.course-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--dark-bg2), var(--dark-bg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  overflow: hidden;
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.badge-price { position: absolute; top: 10px; right: 10px; background: var(--gold); color: #fff; font-weight: 700; font-size: .82rem; padding: 3px 12px; border-radius: 20px; }
.badge-free  { position: absolute; top: 10px; right: 10px; background: var(--green); color: #fff; font-weight: 700; font-size: .82rem; padding: 3px 12px; border-radius: 20px; }
.play-btn { position: absolute; bottom: 10px; left: 10px; width: 36px; height: 36px; background: rgba(255,255,255,.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; font-size: .85rem; }
.course-card:hover .play-btn { opacity: 1; }
.course-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.course-cat-label { font-size: .73rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 7px; }
.course-title { font-weight: 700; font-size: 1rem; color: var(--ink); margin-bottom: 8px; line-height: 1.4; }
.course-desc { font-size: .84rem; color: var(--text2); margin-bottom: 12px; flex: 1; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; gap: 10px; font-size: .78rem; color: var(--text3); margin-bottom: 12px; flex-wrap: wrap; }
.stars { color: var(--gold); }
.course-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
.course-price { font-weight: 900; font-size: 1.05rem; }

/* ─── How It Works ─── */
.how-bg { background: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; position: relative; }
.steps::before {
  content: '';
  position: absolute;
  top: 27px;
  right: 10%;
  left: 10%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 1px;
}
.step { text-align: center; position: relative; }
.step-num {
  width: 54px;
  height: 54px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--primary);
  position: relative;
  z-index: 1;
}
.step h3 { font-weight: 700; font-size: .95rem; color: var(--ink); margin-bottom: 8px; }
.step p  { font-size: .84rem; color: var(--text2); line-height: 1.6; }

/* ─── CTA Section ─── */
.cta-section {
  background: linear-gradient(135deg, var(--dark-bg), var(--dark-bg2));
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(26,109,181,.18) 0%, transparent 70%);
}
.cta-inner { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.cta-section h2 { font-size: 2.2rem; font-weight: 900; color: #fff; margin-bottom: 14px; }
.cta-section p { color: #94a3b8; margin-bottom: 32px; }

/* ─── Footer ─── */
footer { background: var(--dark-bg); color: #57606a; padding: 56px 0 24px; }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand h3 { font-size: 1.2rem; font-weight: 900; color: #fff; margin-bottom: 12px; }
.footer-brand p  { font-size: .87rem; line-height: 1.7; }
.footer-col h4   { font-weight: 700; color: #fff; margin-bottom: 16px; font-size: .9rem; }
.footer-col ul   { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a { color: #57606a; text-decoration: none; font-size: .87rem; transition: color .2s; }
.footer-col ul li a:hover { color: var(--primary-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.07); padding: 20px 24px 0; text-align: center; font-size: .82rem; max-width: 1200px; margin: 0 auto; }

/* ─── Modal / Overlay ─── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1000; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 18px; padding: 36px; width: 100%; max-width: 460px; position: relative; box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; top: 16px; left: 16px; width: 32px; height: 32px; background: var(--muted); border: none; border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.modal-close:hover { background: var(--border); }
.modal h2 { font-weight: 800; font-size: 1.3rem; text-align: center; margin-bottom: 6px; color: var(--ink); }
.modal-sub { text-align: center; font-size: .85rem; color: var(--text2); margin-bottom: 24px; }

/* ─── Tabs ─── */
.tab-btns { display: flex; gap: 4px; background: var(--muted); padding: 4px; border-radius: 10px; margin-bottom: 24px; }
.tab-btn { flex: 1; padding: 9px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--text2); transition: all .2s; font-family: 'Tajawal', sans-serif; }
.tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .84rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: 'Tajawal', sans-serif;
  outline: none;
  transition: border .2s;
  color: var(--text);
  background: var(--surface);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }

/* ─── Toast ─── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 13px 18px; border-radius: var(--radius); font-size: .88rem; transform: translateY(80px); opacity: 0; transition: all .35s; z-index: 9999; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ─── Skeleton ─── */
.skeleton { background: linear-gradient(90deg, #e8edf2 25%, #f6f8fa 50%, #e8edf2 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* ─── Fade Animations ─── */
.fade-up { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ─── Page Hero (inner pages) ─── */
.page-hero { background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-bg2) 100%); padding: 48px 24px; }
.page-hero-inner { max-width: 1200px; margin: 0 auto; }
.breadcrumb { font-size: .8rem; color: #64748b; margin-bottom: 14px; }
.breadcrumb a { color: #94a3b8; text-decoration: none; }
.page-hero h1 { font-weight: 900; font-size: 2rem; color: #fff; margin-bottom: 8px; }
.page-hero p  { color: #94a3b8; font-size: .97rem; }

/* ─── Sidebar (dashboard / admin) ─── */
.sidebar {
  width: 240px;
  background: var(--dark-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  border-left: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-logo .logo { font-size: 1.15rem; }
.sidebar-user { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.07); display: flex; gap: 10px; align-items: center; }
.user-av { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--gold)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.user-name { font-size: .85rem; font-weight: 600; color: #fff; }
.user-role { font-size: .72rem; color: #64748b; }
.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-sec { padding: 7px 15px 3px; font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: #4a5568; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 17px; color: #94a3b8; text-decoration: none; font-size: .85rem; font-weight: 500; transition: all .2s; cursor: pointer; border: none; background: transparent; width: 100%; font-family: 'Tajawal', sans-serif; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.nav-item.active { background: rgba(26,109,181,.18); color: var(--primary-light); border-right: 3px solid var(--primary); }
.sidebar-bottom { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.btn-logout { display: flex; align-items: center; gap: 8px; padding: 8px 13px; color: #64748b; border: none; background: transparent; font-family: 'Tajawal', sans-serif; font-size: .84rem; cursor: pointer; border-radius: 8px; width: 100%; transition: all .2s; }
.btn-logout:hover { background: rgba(239,68,68,.1); color: #f87171; }

/* ─── Dashboard Main ─── */
.dash-main { margin-right: 240px; flex: 1; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 40; }
.topbar-title { font-weight: 800; font-size: 1.02rem; color: var(--ink); }
.page-content { padding: 24px; flex: 1; }
.panel { display: none; }
.panel.active { display: block; }

/* ─── Stat Cards ─── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 7px; }
.stat-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.stat-num { font-size: 1.7rem; font-weight: 900; color: var(--ink); }
.stat-label { font-size: .78rem; color: var(--text2); }

/* ─── Cards ─── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-title { font-weight: 700; font-size: .93rem; color: var(--ink); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* ─── Progress Bar ─── */
.prog-bar { height: 5px; background: var(--border); border-radius: 3px; margin-bottom: 5px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.prog-label { font-size: .73rem; color: var(--text3); display: flex; justify-content: space-between; }

/* ─── Empty State ─── */
.empty-state { text-align: center; padding: 44px 20px; }
.empty-state span { font-size: 2.8rem; display: block; margin-bottom: 10px; }
.empty-state h3 { font-size: 1.05rem; color: var(--ink); margin-bottom: 7px; }
.empty-state p { color: var(--text2); font-size: .86rem; }

/* ─── Courses page filters ─── */
.page-layout { max-width: 1200px; margin: 0 auto; padding: 32px 24px; display: grid; grid-template-columns: 256px 1fr; gap: 28px; }
.filter-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.filter-card h3 { font-weight: 700; font-size: .9rem; color: var(--ink); margin-bottom: 14px; }
.filter-item { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 8px; border-radius: 8px; transition: background .15s; }
.filter-item:hover { background: var(--muted); }
.filter-item input[type=checkbox] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.filter-item label { font-size: .86rem; color: var(--text2); cursor: pointer; flex: 1; }
.filter-item .cnt { font-size: .73rem; color: var(--text3); background: var(--muted); padding: 2px 7px; border-radius: 20px; }
.price-radios { display: flex; gap: 6px; flex-wrap: wrap; }
.price-radios label { display: flex; align-items: center; gap: 5px; font-size: .83rem; color: var(--text2); cursor: pointer; padding: 5px 12px; border: 1.5px solid var(--border); border-radius: 20px; transition: all .2s; }
.price-radios input[type=radio] { display: none; }
.price-radios input[type=radio]:checked + label { border-color: var(--primary); background: var(--accent-light); color: var(--primary); font-weight: 600; }
.search-inp { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; font-family: 'Tajawal', sans-serif; outline: none; transition: border .2s; }
.search-inp:focus { border-color: var(--primary); }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .cats-grid    { grid-template-columns: repeat(3, 1fr); }
  .courses-grid { grid-template-columns: repeat(2, 1fr); }
  .steps        { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .page-layout  { grid-template-columns: 1fr; }
  .sidebar      { display: none; }
  .dash-main    { margin-right: 0; }
  .stats-grid   { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .nav-links    { display: none; }
  .cats-grid    { grid-template-columns: repeat(2, 1fr); }
  .courses-grid { grid-template-columns: 1fr; }
  .hero-stats   { gap: 24px; }
  .steps        { grid-template-columns: 1fr; }
  .steps::before { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
}
