/* GMY TV — تصميم أصلي */
:root {
  --bg: #0c0e14;
  --bg2: #131722;
  --card: #171c29;
  --card-hover: #1e2534;
  --text: #f2f4f8;
  --muted: #8b93a5;
  --accent: #ffb020;
  --accent2: #ff5e3a;
  --line: #232a3a;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  direction: rtl;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12,14,20,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 20px;
}
.logo {
  font-size: 26px; font-weight: 900; letter-spacing: .5px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.logo .gmy {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo .tv-badge {
  font-size: 12px; font-weight: 800; color: #141414;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  border-radius: 8px; padding: 3px 8px; letter-spacing: 1px;
}
nav.cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
nav.cats::-webkit-scrollbar { display: none; }
nav.cats a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
  color: var(--muted); white-space: nowrap; transition: .15s;
}
nav.cats a:hover { color: var(--text); background: var(--card); }
nav.cats a.active { color: #141414; background: var(--accent); }
.search-box { position: relative; }
.search-box input {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); padding: 9px 40px 9px 16px; width: 200px;
  font-family: inherit; font-size: 14px; outline: none; transition: .15s;
}
.search-box input:focus { border-color: var(--accent); width: 240px; }
.search-box .sicon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; font-size: 14px;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1240px; margin: 22px auto 0; padding: 0 20px;
}
.hero-card {
  position: relative; border-radius: 20px; overflow: hidden;
  background: linear-gradient(135deg, #1b2233 0%, #10141f 60%), var(--bg2);
  border: 1px solid var(--line);
  min-height: 300px; display: flex; align-items: flex-end;
}
.hero-card::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 85% 20%, rgba(255,176,32,.18), transparent 60%),
    radial-gradient(500px 260px at 15% 90%, rgba(255,94,58,.14), transparent 60%);
}
.hero-content { position: relative; padding: 36px; max-width: 640px; }
.hero-kicker {
  display: inline-block; font-size: 13px; font-weight: 800; color: var(--accent);
  border: 1px solid rgba(255,176,32,.4); border-radius: 999px;
  padding: 4px 12px; margin-bottom: 14px;
}
.hero-title { font-size: 34px; font-weight: 900; line-height: 1.25; margin-bottom: 10px; }
.hero-sub { color: var(--muted); font-size: 15px; line-height: 1.8; margin-bottom: 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; font-weight: 800; font-size: 15px;
  border: none; cursor: pointer; transition: .15s; font-family: inherit;
}
.btn-primary { background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #141414; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: rgba(255,255,255,.07); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- Sections ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 10px 20px 60px; }
.section { margin-top: 40px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--line);
}
.section-title { font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.section-title .bar {
  width: 5px; height: 24px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
}
.section-count { color: var(--muted); font-size: 13px; }
.row {
  display: grid; grid-auto-flow: column; gap: 16px;
  grid-auto-columns: 200px; overflow-x: auto; padding: 4px 2px 14px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.row::-webkit-scrollbar { height: 6px; }
.row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ---------- Card ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  scroll-snap-align: start; transition: transform .18s, background .18s;
}
.card:hover { transform: translateY(-5px); background: var(--card-hover); }
.thumb {
  position: relative; aspect-ratio: 16/10; display: flex;
  align-items: center; justify-content: center; font-size: 44px;
}
.thumb .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.28); opacity: 0; transition: .18s;
}
.card:hover .thumb .play { opacity: 1; }
.play span {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,176,32,.95); color: #141414;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.thumb .dur {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0,0,0,.75); color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}
.card-body { padding: 12px 14px 14px; }
.card-title { font-size: 15px; font-weight: 800; margin-bottom: 6px; line-height: 1.4; }
.card-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; }

/* gradients for placeholder thumbs */
.g1 { background: linear-gradient(135deg,#3a2a6b,#1c1440); }
.g2 { background: linear-gradient(135deg,#0f4c5c,#0a2a33); }
.g3 { background: linear-gradient(135deg,#7a2e3f,#3a1620); }
.g4 { background: linear-gradient(135deg,#2f5d3a,#17301e); }
.g5 { background: linear-gradient(135deg,#6b4a12,#33240a); }
.g6 { background: linear-gradient(135deg,#28436e,#14223c); }

/* ---------- Watch page ---------- */
.watch-wrap { max-width: 1100px; margin: 24px auto; padding: 0 20px 60px; }
.player {
  position: relative; aspect-ratio: 16/9; background: #000;
  border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.player iframe, .player video { width: 100%; height: 100%; border: 0; }
.player .empty { color: var(--muted); text-align: center; padding: 30px; }
.player .empty .big { font-size: 46px; margin-bottom: 10px; }
.watch-title { font-size: 24px; font-weight: 900; margin: 18px 0 6px; }
.watch-meta { color: var(--muted); font-size: 14px; margin-bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.watch-desc { color: #c6ccd9; line-height: 1.9; max-width: 760px; }
.back-link { color: var(--accent); font-weight: 700; font-size: 14px; display: inline-block; margin-top: 18px; }

/* ---------- Empty / search ---------- */
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty-state .big { font-size: 52px; margin-bottom: 12px; }
.grid {
  display: grid; gap: 16px; margin-top: 20px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line); margin-top: 40px;
  padding: 28px 20px 40px; text-align: center; color: var(--muted); font-size: 13.5px;
}
footer .logo { justify-content: center; font-size: 20px; margin-bottom: 8px; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  nav.cats { order: 3; width: 100%; }
  .search-box input { width: 150px; }
  .search-box input:focus { width: 170px; }
  .hero-title { font-size: 24px; }
  .row { grid-auto-columns: 158px; }
}

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes floatBlob { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-30px,20px) scale(1.15); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(255,176,32,.35); } 50% { box-shadow: 0 0 24px 4px rgba(255,176,32,.18); } }

.reveal { opacity: 0; }
.reveal.on { animation: fadeUp .55s cubic-bezier(.2,.7,.3,1) forwards; }
.hero-card { animation: popIn .6s cubic-bezier(.2,.7,.3,1); }
.hero-card::after {
  content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,94,58,.16), transparent 65%);
  top: -80px; left: -60px; animation: floatBlob 9s ease-in-out infinite;
}
.btn-primary { animation: pulseGlow 3s infinite; }
.card { animation: fadeUp .5s both; }
.thumb { transition: .2s; }
.card:hover .thumb { filter: brightness(1.15); }

/* skeleton loading */
.skel {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius); min-height: 190px;
}

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1080px; margin: 26px auto; padding: 0 20px 70px; }
.login-card {
  max-width: 400px; margin: 90px auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; padding: 34px;
  animation: popIn .45s cubic-bezier(.2,.7,.3,1);
}
.login-card h1 { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.login-card p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 800; margin-bottom: 7px; color: #c6ccd9; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 11px 14px; font-family: inherit; font-size: 14.5px; outline: none;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.err { background: rgba(255,80,80,.12); border: 1px solid rgba(255,80,80,.4); color: #ff9c9c;
  border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; display: none; }
.ok { background: rgba(60,220,140,.1); border: 1px solid rgba(60,220,140,.4); color: #7de8b2;
  border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; display: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin: 22px 0 30px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; animation: fadeUp .5s both;
}
.stat .num { font-size: 30px; font-weight: 900; color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }

.tabs { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.tabs button {
  background: var(--card); color: var(--muted); border: 1px solid var(--line);
  padding: 10px 20px; border-radius: 999px; font-family: inherit; font-weight: 800;
  font-size: 14.5px; cursor: pointer; transition: .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--accent); color: #141414; border-color: var(--accent); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; animation: fadeUp .4s both; }
.panel h2 { font-size: 18px; font-weight: 900; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.panel h2 .bar { width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }

.src-toggle { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.src-toggle button {
  flex: 1; min-width: 120px; background: var(--bg2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px;
  font-family: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer; transition: .15s;
}
.src-toggle button.active { border-color: var(--accent); color: var(--accent); background: rgba(255,176,32,.07); }

.progress { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin-top: 10px; display: none; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: right; color: var(--muted); font-size: 12.5px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.badge { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.badge.pub { background: rgba(60,220,140,.13); color: #6fe3a8; }
.badge.draft { background: rgba(255,176,32,.13); color: var(--accent); }
.mini-btn {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 6px 12px; font-family: inherit; font-size: 12.5px;
  font-weight: 700; cursor: pointer; transition: .15s;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }
.mini-btn.danger:hover { border-color: #ff5050; color: #ff7070; }
.icon-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.icon-pick button {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  font-size: 20px; width: 44px; height: 44px; cursor: pointer; transition: .15s;
}
.icon-pick button.active { border-color: var(--accent); background: rgba(255,176,32,.1); transform: scale(1.08); }
.logout { float: left; }
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.admin-top h1 { font-size: 24px; font-weight: 900; }
