/*
Theme Name: مصفوفات لايف | Masfofat Live
Theme URI: https://masfofat.com
Author: مصفوفات التقنية
Description: ثيم بث حي قابل للتعديل لعرض منتج OnePage حسب نوع النشاط (عقار، قرطاسية، متجر، شخصي، علامة تجارية، عمل حر) أو منتج تلاوين.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: masfofat-live
*/

:root {
  --ml-ink: #07141c;
  --ml-ink-2: #0c2230;
  --ml-line: rgba(79, 212, 255, 0.2);
  --ml-cyan: #4fd4ff;
  --ml-cyan-deep: #1aa6d4;
  --ml-text: #edf7fb;
  --ml-muted: #9bb6c4;
  --ml-wa: #25d366;
  --ml-warn: #ffc857;
  --ml-font: "Cairo", "IBM Plex Sans Arabic", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.masfofat-live {
  margin: 0;
  color: var(--ml-text);
  font-family: var(--ml-font);
  background:
    radial-gradient(1100px 560px at 85% -8%, rgba(79, 212, 255, 0.18), transparent 55%),
    linear-gradient(180deg, var(--ml-ink), var(--ml-ink-2) 50%, #061018);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img, iframe, video { max-width: 100%; height: auto; display: block; }
iframe { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--ml-font); line-height: 1.25; margin: 0; }

.ml-wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
.ml-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem); max-width: 1180px; margin: 0 auto;
}
.ml-brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; }
.ml-brand img { height: 34px; width: auto; filter: brightness(0) invert(1); }
.ml-brand span { color: var(--ml-cyan); border-inline-start: 1px solid var(--ml-line); padding-inline-start: 0.7rem; }
.ml-nav { display: flex; gap: 1rem; color: var(--ml-muted); font-size: 0.92rem; }
.ml-nav a:hover { color: var(--ml-cyan); }

.ml-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--ml-cyan), var(--ml-cyan-deep));
  color: #04212c; font-weight: 800; border: 0; border-radius: 999px;
  padding: 0.85rem 1.4rem; font-family: var(--ml-font);
  box-shadow: 0 10px 28px rgba(79, 212, 255, 0.28);
}
.ml-btn-wa { background: linear-gradient(135deg, #2fe077, #1ebe57); color: #04210f; box-shadow: 0 10px 28px rgba(37, 211, 102, 0.28); }
.ml-btn-ghost { background: transparent; color: var(--ml-text); border: 1px solid var(--ml-line); box-shadow: none; }
.ml-btn-sm { padding: 0.55rem 1rem; font-size: 0.9rem; }

.ml-hero {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 1.5rem; align-items: center;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 2.5rem; max-width: 1180px; margin: 0 auto;
}
.ml-kicker { color: var(--ml-cyan); font-weight: 700; margin: 0 0 0.6rem; }
.ml-hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin-bottom: 0.8rem; }
.ml-lede { color: var(--ml-muted); margin: 0 0 1rem; max-width: 38ch; }
.ml-price { margin: 0 0 1.2rem; color: var(--ml-muted); }
.ml-price b { font-size: 2rem; color: var(--ml-text); margin-inline-end: 0.3rem; }
.ml-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.ml-phone { margin: 0.9rem 0 0; color: var(--ml-muted); }
.ml-phone a { color: var(--ml-wa); font-weight: 700; direction: ltr; display: inline-block; }

.ml-live {
  position: relative; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--ml-line); background: #000;
  box-shadow: 0 24px 60px rgba(0,0,0,.4); aspect-ratio: 16/9;
}
.ml-live iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ml-live-badge {
  position: absolute; z-index: 2; top: 0.8rem; inset-inline-start: 0.8rem;
  background: #e11d48; color: #fff; font-weight: 800; font-size: 0.78rem;
  padding: 0.28rem 0.6rem; border-radius: 999px; letter-spacing: 0.04em;
}
.ml-live-badge::before {
  content: ""; display: inline-block; width: 0.45rem; height: 0.45rem;
  border-radius: 50%; background: #fff; margin-inline-end: 0.35rem;
  vertical-align: middle; animation: ml-pulse 1.2s infinite;
}
@keyframes ml-pulse { 50% { opacity: 0.35; } }

.ml-section { padding: clamp(2.5rem, 7vh, 4.5rem) 0; }
.ml-section h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 0.6rem; }
.ml-section-lede { color: var(--ml-muted); margin: 0 0 1.4rem; max-width: 48ch; }

.ml-types {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem;
}
.ml-type {
  border: 1px solid var(--ml-line); border-radius: 16px; padding: 1rem 1.1rem;
  background: rgba(7, 20, 28, 0.45); cursor: default;
}
.ml-type.is-active { border-color: rgba(79, 212, 255, 0.65); background: rgba(79, 212, 255, 0.1); }
.ml-type strong { display: block; margin-bottom: 0.25rem; }
.ml-type span { color: var(--ml-muted); font-size: 0.92rem; }

.ml-editable {
  border: 1px dashed var(--ml-line); border-radius: 16px; padding: 1.2rem;
  background: rgba(79, 212, 255, 0.04); color: var(--ml-muted);
}
.ml-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ml-embed { position: relative; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; border: 1px solid var(--ml-line); background: #000; }
.ml-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.ml-socials { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ml-soc {
  border: 1px solid var(--ml-line); border-radius: 999px; padding: 0.5rem 0.9rem;
  background: rgba(79, 212, 255, 0.05);
}
.ml-soc:hover { color: var(--ml-cyan); border-color: var(--ml-cyan); }

.ml-finale {
  text-align: center; padding: clamp(3rem, 9vh, 5rem) 1rem;
  background: radial-gradient(560px 220px at 50% 0%, rgba(79, 212, 255, 0.18), transparent 70%);
}
.ml-finale p { color: var(--ml-muted); margin: 0.7rem auto 1.3rem; max-width: 40ch; }

.ml-legal { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.ml-legal article { border: 1px solid var(--ml-line); border-radius: 16px; padding: 1rem; background: rgba(7,20,28,.4); }
.ml-legal h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.ml-legal p { margin: 0 0 0.5rem; color: var(--ml-muted); font-size: 0.94rem; }
.ml-legal a { color: var(--ml-cyan); text-decoration: underline; text-underline-offset: 3px; }

.ml-foot {
  border-top: 1px solid var(--ml-line); padding: 2rem clamp(1rem,4vw,3rem) 5rem;
  max-width: 1180px; margin: 0 auto; display: grid; gap: 0.9rem;
}
.ml-copy { color: #6f8896; font-size: 0.85rem; margin: 0; }

.ml-wa-float {
  position: fixed; inset-inline-end: 1rem; inset-block-end: 1rem; z-index: 40;
  background: var(--ml-wa); color: #04210f; font-weight: 800;
  padding: 0.85rem 1.15rem; border-radius: 999px;
  box-shadow: 0 12px 30px rgba(37,211,102,.35);
}

.ml-alt { background: linear-gradient(180deg, rgba(16,42,58,.55), rgba(16,42,58,.18)); border-block: 1px solid var(--ml-line); }

.ml-narrow { max-width: 520px; }

/* Linktree-style social stack */
.lt-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--ml-line);
  border-radius: 28px;
  padding: 1.75rem 1.2rem 1.4rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.lt-avatar {
  width: 84px; height: 84px; margin: 0 auto 0.85rem; border-radius: 50%;
  overflow: hidden; border: 2px solid rgba(79,212,255,.45);
  background: #fff; display: grid; place-items: center;
}
.lt-avatar img { width: 70%; height: auto; filter: none; }
.lt-title { font-size: 1.35rem; margin-bottom: 0.35rem; }
.lt-bio { color: var(--ml-muted); margin: 0 0 1.2rem; font-size: 0.95rem; }
.lt-stack { display: grid; gap: 0.7rem; }
.lt-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.65rem;
  min-height: 54px; border-radius: 999px; font-weight: 800;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.92); color: #111;
  transition: transform .2s ease, box-shadow .2s ease;
}
.lt-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.lt-ico {
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 800;
  background: #111; color: #fff;
}
.lt-wa { background: #25d366; color: #04210f; border-color: transparent; }
.lt-wa .lt-ico { background: #04210f; color: #25d366; }
.lt-yt { background: #fff; }
.lt-yt .lt-ico { background: #ff0000; }
.lt-ig { background: linear-gradient(135deg,#f9ce34,#ee2a7b,#6228d7); color: #fff; border: 0; }
.lt-ig .lt-ico { background: rgba(0,0,0,.35); }
.lt-fb .lt-ico { background: #1877f2; }
.lt-mail .lt-ico { background: #0ea5e9; }
.lt-tel .lt-ico { background: #22c55e; }

/* YouTube chrome */
.yt-chrome, .gm-chrome {
  border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.12);
  background: #0f0f0f; box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.yt-top, .gm-top {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.7rem; background: #212121; border-bottom: 1px solid #303030;
}
.yt-dots { display: flex; gap: 0.28rem; }
.yt-dots span { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #555; }
.yt-dots span:nth-child(1) { background: #ff5f56; }
.yt-dots span:nth-child(2) { background: #ffbd2e; }
.yt-dots span:nth-child(3) { background: #27c93f; }
.yt-url, .gm-search {
  flex: 1; min-width: 0; background: #121212; border-radius: 999px;
  padding: 0.35rem 0.7rem; font-size: 0.78rem; color: #aaa;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 0.35rem;
}
.yt-open, .gm-open {
  font-size: 0.75rem; font-weight: 700; color: #fff;
  background: #ff0000; border-radius: 999px; padding: 0.35rem 0.65rem; white-space: nowrap;
}
.gm-open { background: #1a73e8; }
.yt-stage, .gm-stage { position: relative; aspect-ratio: 16/9; background: #000; }
.yt-stage iframe, .gm-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-bottom, .gm-bottom {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: center;
  padding: 0.65rem 0.8rem; background: #181818; color: #ddd; font-size: 0.85rem;
}
.yt-bottom span, .gm-bottom span { color: #9aa0a6; }
.gm-chrome { background: #fff; }
.gm-top { background: #fff; border-bottom: 1px solid #dadce0; }
.gm-logo {
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #fff; background: #1a73e8;
}
.gm-search { background: #f1f3f4; color: #5f6368; flex-direction: column; align-items: flex-start; border-radius: 12px; }
.gm-search strong { color: #202124; font-size: 0.86rem; }
.gm-bottom { background: #fff; color: #202124; border-top: 1px solid #dadce0; }

/* QR series */
.qr-card {
  text-align: center; border: 1px solid var(--ml-line); border-radius: 24px;
  padding: 1.6rem 1.2rem; background: rgba(7,20,28,.55);
}
.qr-box {
  width: fit-content; margin: 1rem auto; padding: 0.85rem; border-radius: 18px;
  background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.qr-box img { display: block; width: 240px; height: 240px; }
.qr-hint { color: var(--ml-muted); margin: 0.75rem 0 1rem; }
.qr-hint a { color: var(--ml-cyan); text-decoration: underline; text-underline-offset: 3px; }

.ml-badge-product {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(79, 212, 255, 0.14);
  border: 1px solid rgba(79, 212, 255, 0.35);
  color: var(--ml-cyan);
  font-weight: 700;
  font-size: 0.9rem;
}

.ml-nav-scroll {
  display: none;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 1rem 0.75rem;
  max-width: 1180px;
  margin: 0 auto;
}
.ml-nav-scroll::-webkit-scrollbar { display: none; }
.ml-nav-scroll a {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--ml-line);
  background: rgba(7, 20, 28, 0.65);
  color: var(--ml-muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

/* Tablet */
@media (max-width: 1024px) {
  .ml-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ml-hero { gap: 1.25rem; }
  .ml-lede { max-width: none; }
}

/* Small tablet / large phone */
@media (max-width: 960px) {
  .ml-top {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }
  .ml-brand { min-width: 0; flex: 1 1 auto; }
  .ml-brand span { font-size: 0.92rem; }
  .ml-nav { display: none; }
  .ml-nav-scroll { display: flex; }
  .ml-btn-sm { padding: 0.6rem 0.95rem; }

  .ml-hero {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 2rem;
  }
  .ml-live { order: -1; width: 100%; }
  .ml-hero h1 { font-size: clamp(1.55rem, 7vw, 2.2rem); }
  .ml-cta { width: 100%; }
  .ml-cta .ml-btn { flex: 1 1 auto; min-height: 48px; }

  .ml-grid-2,
  .ml-legal { grid-template-columns: 1fr; }
  .ml-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .yt-open, .gm-open { display: none; }
  .yt-top, .gm-top { gap: 0.4rem; padding: 0.45rem 0.55rem; }
  .yt-url, .gm-search { font-size: 0.72rem; }

  .ml-section { padding: 2.2rem 0; }
  .ml-wrap { padding: 0 1rem; }
  .ml-narrow { max-width: 100%; }

  .qr-box img { width: min(220px, 70vw); height: auto; aspect-ratio: 1; }

  .ml-wa-float {
    inset-inline-end: max(0.75rem, env(safe-area-inset-right));
    inset-block-end: max(0.75rem, env(safe-area-inset-bottom));
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
  }
  .ml-foot { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
}

/* Phones */
@media (max-width: 640px) {
  .ml-types { grid-template-columns: 1fr; }
  .ml-brand img { height: 28px; }
  .ml-brand span {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ml-price b { font-size: 1.65rem; }
  .lt-card { border-radius: 20px; padding: 1.35rem 0.9rem 1.15rem; }
  .lt-btn { min-height: 52px; font-size: 0.95rem; }
  .yt-dots { display: none; }
  .gm-search span { display: none; }
  .yt-bottom, .gm-bottom { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .ml-finale { padding: 2.5rem 1rem 3rem; }
  .ml-finale .ml-btn { width: 100%; min-height: 50px; }
  .qr-card { padding: 1.25rem 0.9rem; border-radius: 18px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .ml-cta { flex-direction: column; }
  .ml-cta .ml-btn { width: 100%; }
  .ml-top .ml-btn-sm { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
