/* ==========================================================================
   Scadd — Arabic Course Marketplace Design System (Enhanced Layout & Spacing)
   Original design system: indigo/coral palette, RTL-first.
   ========================================================================== */

:root {
  --indigo-900: #241B4E;
  --indigo-700: #3C2E85;
  --indigo-600: #4B3AA4;
  --indigo-500: #5B46C4;
  --coral-500: #F2645A;
  --coral-400: #F6857D;
  --amber-500: #F5A623;
  --ink: #1E1B2E;
  --muted: #6E6B85;
  --line: #E7E4F2;
  --bg: #F7F6FB;
  --card: #FFFFFF;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 8px 24px rgba(36, 27, 78, 0.08);
  --shadow-card-hover: 0 16px 36px rgba(36, 27, 78, 0.14);

  --font-display: 'Tajawal', sans-serif;
  --font-body: 'Tajawal', sans-serif;

  /* Global Spacing Variables */
  --container-max-width: 1280px;
  --container-padding: 20px;
  --section-spacing: 60px;
}

/* ---------- Global Reset & Wrappers ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

.container,
.mk-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--indigo-900);
  line-height: 1.3;
}

/* ---------- Promo bar ---------- */
.promo-bar {
  background: linear-gradient(90deg, var(--coral-500), var(--coral-400));
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
}

.promo-bar strong {
  color: #FFE9A8;
}

/* ---------- Header ---------- */
.mk-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.mk-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
}

.mk-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--indigo-700);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.mk-logo span.dot {
  color: var(--coral-500);
}

.mk-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.mk-search input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px 12px 48px;
  font-size: 14px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s ease;
}

.mk-search input:focus {
  border-color: var(--indigo-500);
}

.mk-search i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.mk-header .actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mk-plus-badge {
  background: var(--indigo-700);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.mk-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--indigo-700);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mk-icon-btn:hover {
  background: #EAE8F5;
}

.mk-cat-nav {
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  /* Firefox */
}

.mk-cat-nav::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.mk-cat-nav .row {
  display: flex;
  gap: 32px;
  padding-block: 12px;
  white-space: nowrap;
}

.mk-cat-nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mk-cat-nav a:hover {
  color: var(--indigo-600);
}

/* ---------- Hero Section ---------- */
.mk-hero-wrapper {
  margin-block-start: 24px;
}

.mk-hero {
  background: linear-gradient(120deg, var(--indigo-900) 0%, var(--indigo-700) 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 32px;
  padding: 48px 40px;
  min-height: 380px;
}

.mk-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  opacity: .6;
  pointer-events: none;
}

.mk-hero-frames {
  display: flex;
  gap: 16px;
  position: relative;
  z-index: 1;
  justify-content: center;
}

.mk-hero-frame {
  width: 150px;
  height: 210px;
  border-radius: 22px;
  overflow: hidden;
  border: 3px solid;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.mk-hero-frame:nth-child(1) {
  border-color: #F2645A;
  transform: translateY(12px);
}

.mk-hero-frame:nth-child(2) {
  border-color: #4FD1E8;
}

.mk-hero-frame:nth-child(3) {
  border-color: #B98CF2;
  transform: translateY(12px);
}

.mk-hero-frame .placeholder-fig {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--indigo-600), var(--indigo-900));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 38px;
}

.mk-hero-copy {
  position: relative;
  z-index: 1;
  text-align: right;
}

.mk-hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.mk-hero-copy h1 {
  color: #fff;
  font-size: 32px;
  line-height: 1.35;
  margin-bottom: 24px;
}

.mk-hero-copy .btn-hero {
  background: var(--coral-500);
  color: #fff;
  font-weight: 800;
  padding: 12px 32px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-block;
  font-size: 15px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mk-hero-copy .btn-hero:hover {
  background: var(--coral-400);
  transform: translateY(-2px);
}

/* ---------- Category Grid ---------- */
.mk-cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-block: var(--section-spacing);
}

.mk-cat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mk-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.mk-cat-card .icon {
  font-size: 28px;
}

.mk-cat-card span {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

/* ---------- Section Headings & Layout ---------- */
.mk-section {
  padding-block: var(--section-spacing);
}

.mk-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.mk-section-head h2 {
  font-size: 24px;
}

.mk-more-link {
  border: 1.5px solid var(--indigo-600);
  color: var(--indigo-600);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 20px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mk-more-link:hover {
  background: var(--indigo-600);
  color: #fff;
}

/* ---------- Course Grid & Cards ---------- */
.mk-course-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.mk-course-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.mk-course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
}

.mk-course-thumb {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-900));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 34px;
}

.mk-course-thumb .duration-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.mk-course-thumb .new-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--amber-500);
  color: #241B4E;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.mk-course-thumb .fav-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--coral-500);
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mk-course-thumb .fav-btn:hover {
  background: #fff;
}

.mk-course-body {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.mk-course-body h4 {
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.45;
  color: var(--ink);
}

.mk-course-body .instructor {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.mk-course-body .btn-subscribe {
  margin-top: auto;
  display: block;
  width: 100%;
  text-align: center;
  background: var(--indigo-600);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mk-course-body .btn-subscribe:hover {
  background: var(--indigo-700);
}

/* ---------- Experts Strip ---------- */
.mk-experts {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

.mk-expert-card {
  flex: 0 0 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, var(--indigo-600), var(--indigo-900));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.mk-expert-card span {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  opacity: .9;
  text-align: center;
}

/* ---------- Certificate Showcase ---------- */
.mk-cert-wrapper {
  background-color: var(--indigo-900);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  margin-block: var(--section-spacing);
}

.mk-cert-section {
  display: flex;
  gap: 48px;
  align-items: center;
  direction: rtl;
}

/* Certificate Card Visual */
.mk-cert-card-wrapper {
  flex: 1;
  min-width: 320px;
  max-width: 480px;
  background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.mk-cert-card-inner {
  background: #fff;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.cert-header-bg {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 64px;
  background: var(--indigo-900);
  border-bottom-left-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-inline: 20px;
  z-index: 1;
}

.cert-header-bg .logo-text {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.cert-top-label {
  text-align: left;
  font-size: 11px;
  color: #888;
  margin-top: 8px;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}

.cert-main-content {
  position: relative;
  z-index: 2;
  margin-top: 16px;
}

.cert-grant-text {
  font-size: 11px;
  color: #888;
  text-align: left;
  margin-bottom: 4px;
}

.cert-student-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--indigo-900);
  text-align: left;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.cert-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 11px;
  text-align: right;
  margin-bottom: 20px;
}

.cert-details-grid .lbl {
  color: #888;
  display: block;
  font-size: 10px;
  margin-bottom: 2px;
}

.cert-details-grid .val {
  font-weight: 700;
  color: #333;
}

.cert-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 16px;
}

.cert-seal {
  width: 60px;
  height: 60px;
  background: var(--amber-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cert-qr {
  width: 52px;
  height: 52px;
  background: #eee;
  padding: 4px;
  border-radius: 6px;
}

.cert-signatures {
  display: flex;
  gap: 16px;
  font-size: 10px;
  text-align: center;
}

.cert-sig-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cert-sig-line {
  width: 48px;
  height: 18px;
  border-bottom: 1px solid #aaa;
  margin-bottom: 4px;
}

/* Certificate Copy Side */
.mk-cert-copy {
  flex: 1.2;
  min-width: 280px;
  color: #fff;
}

.mk-cert-copy h2 {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #fff;
}

.mk-cert-copy p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 28px;
}

.mk-cert-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.mk-cert-logos img,
.mk-cert-logos .badge-placeholder {
  height: 40px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.btn-outline-white {
  display: inline-block;
  border: 1.5px solid #fff;
  color: #fff;
  background: transparent;
  padding: 12px 36px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-outline-white:hover {
  background: #fff;
  color: var(--indigo-900);
}

/* ---------- Trusted-by Section ---------- */
.mk-trusted {
  text-align: center;
  padding-block: 40px;
}

.mk-trusted h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.mk-trusted p {
  color: var(--muted);
  margin-bottom: 32px;
}

.mk-trusted-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.mk-trusted-logos .logo-chip {
  font-weight: 800;
  font-size: 16px;
  color: var(--muted);
  opacity: .6;
  letter-spacing: .02em;
}

/* ---------- Footer ---------- */
.mk-footer {
  background: var(--indigo-900);
  color: rgba(255, 255, 255, 0.75);
  padding-top: 64px;
  padding-bottom: 32px;
  margin-top: 80px;
}

.mk-footer h4 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 20px;
}

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

.mk-footer ul li {
  margin-bottom: 12px;
}

.mk-footer ul li a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.mk-footer ul li a:hover {
  color: #fff;
}

.mk-footer .app-badges {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.mk-footer .app-badges .badge {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.mk-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 48px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}

.mk-footer-bottom .social {
  display: flex;
  gap: 8px;
}

.mk-footer-bottom .social a {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease;
}

.mk-footer-bottom .social a:hover {
  background: var(--coral-500);
}

/* ---------- Media Queries ---------- */
@media (max-width: 1024px) {
  .mk-cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mk-course-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mk-hero {
    grid-template-columns: 1fr;
    padding: 40px 24px;
    text-align: center;
  }

  .mk-hero-copy {
    text-align: center;
  }

  .mk-cert-section {
    flex-direction: column;
    text-align: center;
  }

  .mk-cert-copy {
    text-align: center;
  }

  .mk-cert-logos {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  :root {
    --section-spacing: 40px;
  }

  .mk-cert-wrapper {
    padding: 32px 20px;
  }

  .mk-trusted-logos {
    gap: 24px;
  }
}

@media (max-width: 576px) {
  .mk-cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mk-course-grid {
    grid-template-columns: 1fr;
  }

  .mk-search {
    display: none;
  }

  .mk-hero-frames {
    display: none;
    /* Hide visual cards on small devices for better vertical balance */
  }
}