/*
Theme Name: Sharmutah Stream
Theme URI: https://example.com/
Author: Site Team
Description: A fast Arabic RTL video platform theme built for Sharmutah Core.
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 7.2
Text Domain: sharmutah-stream
*/

:root {
  --ink: #f7f1e8;
  --muted: #aaa3a0;
  --bg: #0b0b0d;
  --panel: #151518;
  --panel-2: #1e1d20;
  --line: rgba(255, 255, 255, 0.1);
  --red: #ff493d;
  --red-deep: #c62620;
  --lime: #d5ff4f;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 73, 61, 0.14), transparent 30rem),
    radial-gradient(circle at 88% 24%, rgba(213, 255, 79, 0.05), transparent 25rem),
    var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  line-height: 1.7;
}
body.gate-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.site-shell { width: min(1460px, calc(100% - 40px)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 13, 0.88);
  backdrop-filter: blur(18px);
}
.header-row { min-height: 76px; display: grid; grid-template-columns: auto minmax(220px, 620px) auto; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { display: grid; width: 38px; aspect-ratio: 1; place-items: center; border-radius: 50% 50% 10% 50%; background: var(--red); color: #fff; transform: rotate(-8deg); }
.brand-text small { display: block; margin-top: -9px; color: var(--muted); font-size: .58rem; font-weight: 500; letter-spacing: .12em; }
.header-search { position: relative; }
.header-search input {
  width: 100%;
  height: 46px;
  padding: 0 48px 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: var(--panel);
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.header-search input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 73, 61, .12); }
.header-search button { position: absolute; inset: 0 7px 0 auto; width: 38px; border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; }
.header-actions { display: flex; align-items: center; gap: 9px; justify-content: flex-end; }
.pill, .button, input[type=submit] {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 700;
  transition: transform .2s, border-color .2s, background .2s;
}
.pill:hover, .button:hover, input[type=submit]:hover { transform: translateY(-2px); border-color: var(--red); }
.pill-primary, .button-primary, input[type=submit] { border-color: var(--red); background: var(--red); color: #fff; }
.age-pill { border-color: rgba(213,255,79,.4); color: var(--lime); }

.group-rail { overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.group-rail::-webkit-scrollbar { display: none; }
.group-list { display: flex; min-height: 50px; align-items: center; gap: 8px; white-space: nowrap; }
.group-link { padding: 5px 13px; border-radius: 999px; color: var(--muted); font-size: .9rem; }
.group-link:hover, .group-link.current { background: var(--ink); color: var(--bg); }

.hero { position: relative; padding: clamp(54px, 8vw, 120px) 0 45px; overflow: hidden; }
.hero::before {
  content: "PLAY";
  position: absolute;
  z-index: -1;
  top: 4%;
  left: 1%;
  color: transparent;
  font-size: clamp(8rem, 25vw, 25rem);
  font-weight: 800;
  line-height: 1;
  -webkit-text-stroke: 1px rgba(255,255,255,.055);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr); align-items: end; gap: 60px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--lime); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--lime); }
.hero h1 { max-width: 850px; margin: 14px 0 18px; font-size: clamp(2.8rem, 7vw, 7.4rem); line-height: .98; letter-spacing: -.075em; }
.hero h1 em { color: var(--red); font-style: normal; }
.hero-copy { max-width: 580px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.18rem); }
.hero-stat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(21,21,24,.7); }
.stat-card strong { display: block; font-size: 2rem; line-height: 1.1; }
.stat-card span { color: var(--muted); font-size: .82rem; }

.ad-slot { display: grid; min-height: 70px; margin-block: 24px; place-items: center; overflow: hidden; border: 1px dashed rgba(255,255,255,.14); border-radius: 12px; }
.ad-slot:empty { display: none; }
.section-head { display: flex; margin: 30px 0 22px; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-head h1, .section-head h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.8rem); line-height: 1.1; letter-spacing: -.045em; }
.section-head p { margin: 7px 0 0; color: var(--muted); }
.sort-tabs { display: flex; gap: 6px; }
.sort-tabs a { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-size: .88rem; }
.sort-tabs a.active { background: var(--ink); color: var(--bg); }

.video-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 16px; padding-bottom: 60px; }
.video-card { min-width: 0; animation: card-in .55s both; animation-delay: calc(var(--index, 0) * 45ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(20px); } }
.card-media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 14px; background: linear-gradient(135deg, #29252b, #121114); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, filter .5s; }
.video-card:hover .card-media img { transform: scale(1.045); filter: brightness(.75); }
.play-mark { position: absolute; inset: 50% auto auto 50%; display: grid; width: 52px; aspect-ratio: 1; place-items: center; border-radius: 50%; background: var(--red); color: #fff; opacity: 0; transform: translate(-50%, -35%); transition: opacity .25s, transform .25s; box-shadow: 0 10px 30px rgba(255,73,61,.35); }
.video-card:hover .play-mark { opacity: 1; transform: translate(-50%, -50%); }
.views-badge { position: absolute; bottom: 9px; left: 9px; padding: 3px 9px; border-radius: 7px; background: rgba(0,0,0,.78); font-size: .72rem; }
.card-fallback { display: grid; width: 100%; height: 100%; place-items: center; color: rgba(255,255,255,.15); font-size: 3.5rem; }
.card-body { padding: 12px 5px 0; }
.card-body h3 { display: -webkit-box; margin: 0 0 6px; overflow: hidden; font-size: 1rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; }

.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; padding-block: 28px 65px; }
.player-column { min-width: 0; }
.player-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #000; box-shadow: var(--shadow); }
.player-frame video { width: 100%; height: 100%; background: #000; }
.vast-layer { position: absolute; z-index: 5; inset: 0; display: none; background: #000; }
.vast-layer.active { display: block; }
.vast-layer video { width: 100%; height: 100%; object-fit: contain; }
.vast-label { position: absolute; top: 12px; right: 12px; padding: 4px 9px; border-radius: 6px; background: rgba(0,0,0,.7); font-size: .7rem; }
.vast-skip { position: absolute; bottom: 18px; left: 18px; padding: 8px 14px; border: 1px solid #fff; border-radius: 8px; background: rgba(0,0,0,.75); color: #fff; }
.watch-info { padding: 25px 5px; border-bottom: 1px solid var(--line); }
.watch-info h1 { max-width: 1000px; margin: 0 0 12px; font-size: clamp(1.65rem, 4vw, 3.2rem); line-height: 1.18; letter-spacing: -.045em; }
.watch-meta, .reaction-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); }
.reaction-row { justify-content: space-between; margin-top: 18px; }
.reaction-buttons { display: flex; gap: 8px; }
.reaction-button.active { border-color: var(--lime); color: var(--lime); }
.watch-description { margin-top: 20px; padding: 22px; border-radius: var(--radius); background: var(--panel); color: #d4ceca; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag-list a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; }
.side-title { margin: 0 0 15px; font-size: 1.15rem; }
.related-list { display: grid; gap: 15px; }
.related-list .video-card { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 11px; }
.related-list .card-media { aspect-ratio: 16/10; }
.related-list .card-body { padding: 2px 0; }
.related-list .card-body h3 { font-size: .86rem; }
.related-list .card-meta { display: none; }

.comments-area { margin-top: 32px; }
.comments-area h2 { font-size: 1.45rem; }
.comment-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.comment-body { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.comment-meta { color: var(--muted); font-size: .8rem; }
.comment-content p { margin-bottom: 0; }
.comment-form { display: grid; gap: 10px; }
.comment-form textarea, .modal-card input, .modal-card select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #101013;
  color: var(--ink);
}
.comment-form textarea:focus, .modal-card input:focus { border-color: var(--red); }
.pagination, .nav-links { display: flex; justify-content: center; gap: 7px; padding: 15px 0 65px; }
.page-numbers { display: grid; min-width: 40px; height: 40px; padding: 0 10px; place-items: center; border-radius: 10px; background: var(--panel); }
.page-numbers.current { background: var(--red); }
.empty-state { grid-column: 1/-1; padding: 70px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }

.site-footer { margin-top: 40px; padding: 38px 0; border-top: 1px solid var(--line); color: var(--muted); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-row .brand { color: var(--ink); }

.modal { position: fixed; z-index: 100; inset: 0; display: none; padding: 20px; place-items: center; background: rgba(0,0,0,.8); backdrop-filter: blur(12px); }
.modal.open { display: grid; }
.modal-card { position: relative; width: min(480px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.modal-card h2 { margin: 0 0 5px; font-size: 1.9rem; }
.modal-card > p { margin-top: 0; color: var(--muted); }
.modal-close { position: absolute; top: 15px; left: 15px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--panel-2); color: #fff; }
.gate-card { text-align: center; }
.gate-card .brand-mark { margin: 0 auto 16px; width: 58px; }
.modal-actions { display: flex; gap: 9px; margin-top: 18px; }
.modal-actions > * { flex: 1; }
.account-tabs { display: flex; gap: 6px; margin: 18px 0; }
.account-tab { flex: 1; padding: 8px; border: 0; border-radius: 9px; background: var(--panel-2); color: var(--muted); }
.account-tab.active { background: var(--ink); color: var(--bg); }
.account-form { display: none; gap: 11px; }
.account-form.active { display: grid; }
.form-message { min-height: 24px; margin: 6px 0 0; color: var(--lime); font-size: .85rem; }
.form-message.error { color: #ff8b84; }
.vip-box { margin-top: 18px; padding: 16px; border: 1px solid rgba(213,255,79,.25); border-radius: 14px; background: rgba(213,255,79,.04); }

@media (max-width: 1100px) {
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .watch-layout { grid-template-columns: minmax(0, 1fr); }
  .watch-sidebar { border-top: 1px solid var(--line); padding-top: 25px; }
  .related-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .site-shell { width: min(100% - 24px, 1460px); }
  .header-row { min-height: 68px; grid-template-columns: 1fr auto; gap: 12px; }
  .header-search { grid-column: 1/-1; grid-row: 2; padding-bottom: 10px; }
  .brand-text small, .age-pill { display: none; }
  .hero { padding-top: 58px; }
  .hero-grid { grid-template-columns: 1fr; gap: 35px; }
  .hero h1 { font-size: clamp(3rem, 17vw, 5rem); }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .watch-layout { padding-top: 14px; }
  .player-frame { margin-inline: -12px; border-radius: 0; }
  .related-list { grid-template-columns: 1fr; }
  .footer-row { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 430px) {
  .video-grid { grid-template-columns: 1fr; }
  .card-media { aspect-ratio: 16/9; }
  .header-actions .account-label { display: none; }
  .hero-stat { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 17px; }
}

/* Retrotube-inspired layout requested for the public site. */
:root {
  --ink: #eeeeee;
  --muted: #aaaaaa;
  --bg: #111111;
  --panel: #181818;
  --panel-2: #282828;
  --line: #333333;
  --red: #e52335;
  --red-deep: #ad1021;
  --lime: #ffca57;
  --radius: 4px;
}
body {
  background:
    radial-gradient(circle at 50% -100px, rgba(229, 35, 53, .19), transparent 500px),
    radial-gradient(circle at 100% 35%, rgba(255, 202, 87, .035), transparent 360px),
    repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 1px, transparent 1px 9px),
    #111;
  color: #ccc;
  font-family: Tahoma, Arial, sans-serif;
}
.site-shell { width: min(1300px, calc(100% - 24px)); }
.top-bar { min-height: 34px; background: #0c0c0c; border-bottom: 1px solid #222; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.top-bar-row { display: flex; min-height: 34px; align-items: center; justify-content: space-between; color: #777; font-size: .78rem; }
.top-bar button { padding: 0; border: 0; background: transparent; color: #bbb; font-size: .78rem; }
.top-bar button:hover { color: var(--red); }
.site-header { position: relative; top: auto; border: 0; background: #161616; backdrop-filter: none; }
.branding-row { display: grid; min-height: 112px; grid-template-columns: minmax(260px, 1fr) 310px; align-items: center; gap: 40px; }
.brand { justify-self: start; font-size: 2rem; }
.brand-mark { width: 52px; border-radius: 5px; background: var(--red); transform: none; }
.brand-text small { margin-top: -6px; color: #777; font-size: .67rem; letter-spacing: 0; }
.header-search { display: flex; height: 40px; }
.header-search input { height: 40px; padding: 0 13px; border: 1px solid #333; border-left: 0; border-radius: 0 4px 4px 0; background: #282828; }
.header-search input:focus { border-color: var(--red); box-shadow: none; background: #333; }
.header-search button { position: static; width: 62px; border: 1px solid var(--red); border-radius: 4px 0 0 4px; background: var(--red); color: #fff; font-size: .82rem; font-weight: 700; }
.main-navigation { overflow-x: auto; border-block: 1px solid #111; background: #222; scrollbar-width: none; }
.main-navigation::-webkit-scrollbar { display: none; }
.group-list { min-height: 50px; gap: 0; }
.group-link { min-height: 50px; padding: 0 18px; border-left: 1px solid #121212; border-radius: 0; color: #ddd; line-height: 50px; font-size: .86rem; }
.group-link:first-child { border-right: 1px solid #121212; }
.group-link:hover, .group-link.current { background: var(--red); color: #fff; }
.page-frame { padding: 16px 18px 35px; background: rgba(0,0,0,.54); box-shadow: 0 0 14px rgba(0,0,0,.55); }
.home-video-section { position: relative; margin-bottom: 28px; }
.retro-section-head {
  position: relative;
  display: flex;
  min-height: 44px;
  margin: 0 5px 10px;
  padding: 8px 13px;
  align-items: center;
  justify-content: space-between;
  border-right: 6px solid var(--red);
  background: #282828;
  box-shadow: 0 8px 17px rgba(0,0,0,.2);
}
.retro-section-head h2 { margin: 0; color: #fff; font-size: 1.06rem; font-weight: 500; }
.retro-section-head > a { padding: 4px 11px; border: 1px solid var(--red); border-radius: 3px; background: var(--red); color: #fff; font-size: .75rem; }
.home-video-section .video-grid { padding-bottom: 0; }
.video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 10px; }
.video-card { animation-duration: .35s; }
.card-media { aspect-ratio: 16/9; border: 1px solid #222; border-radius: 0; box-shadow: 0 4px 10px rgba(0,0,0,.28); }
.card-media img { object-fit: cover; }
.card-shade { position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.85)); pointer-events: none; }
.hd-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
}
.duration-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: .68rem;
}
.views-badge { bottom: 8px; left: 8px; padding: 0; border-radius: 0; background: transparent; color: #eee; font-size: .7rem; }
.rating-badge { position: absolute; right: 8px; bottom: 8px; color: var(--lime); font-size: .7rem; font-weight: 700; }
.rating-line { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: rgba(255,255,255,.2); }
.rating-line i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--lime)); }
.play-mark { width: 48px; background: rgba(229,35,53,.92); font-size: .85rem; }
.video-card:hover .hd-badge { background: var(--red); }
.card-body { padding: 8px 3px 0; }
.card-body h3 { margin: 0; color: #ddd; font-size: .87rem; font-weight: 500; line-height: 1.5; }
.video-card:hover .card-body h3 { color: #fff; }
.card-meta { display: none; }
.home-about { margin: 34px 5px 0; padding: 20px; border-top: 1px solid #2a2a2a; text-align: center; }
.home-about h1 { margin: 0 0 7px; color: #eee; font-size: 1.3rem; }
.home-about p { margin: 0; color: #888; font-size: .9rem; }
.section-head { margin-top: 22px; padding: 10px 14px; border-right: 6px solid var(--red); background: #282828; }
.section-head h1, .section-head h2 { font-size: 1.25rem; letter-spacing: 0; }
.section-head .eyebrow, .hero { display: none; }
.sort-tabs a.active { background: var(--red); color: #fff; }
.pill, .button, input[type=submit] { border-radius: 3px; }
.watch-layout { padding-top: 18px; }
.player-frame { border-radius: 2px; }
.site-footer { margin-top: 0; background: #111; border-top: 3px solid #222; }
.site-footer a { color: #ff7b86; }

@media (min-width: 1200px) {
  .site-shell { width: min(1380px, calc(100% - 40px)); }
  .branding-row { min-height: 118px; grid-template-columns: minmax(360px, 1fr) 360px; }
  .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 12px; }
  .card-body h3 { font-size: .92rem; }
  .watch-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; }
}

@media (max-width: 900px) {
  .branding-row { grid-template-columns: 1fr 280px; }
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-frame { box-shadow: none; }
}
@media (max-width: 680px) {
  body { background: #111; }
  .site-shell { width: calc(100% - 12px); }
  .branding-row { min-height: 128px; grid-template-columns: 1fr; gap: 12px; padding-block: 15px; }
  .brand { justify-self: center; font-size: 1.7rem; }
  .brand-mark { width: 43px; }
  .header-search { width: 100%; grid-column: auto; grid-row: auto; padding: 0; }
  .group-list { width: max-content; }
  .page-frame { padding: 10px 5px 25px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 8px; }
  .retro-section-head { margin-inline: 4px; }
  .retro-section-head h2 { max-width: calc(100% - 42px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .retro-section-head > a span { display: none; }
  .card-body h3 { font-size: .8rem; }
  .watch-layout { width: 100%; }
  .watch-info h1 { font-size: 1.45rem; }
  .reaction-row { align-items: stretch; flex-direction: column; }
  .reaction-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .reaction-button { padding-inline: 8px; }
  .modal-card { padding: 26px 18px; }
  .footer-row { align-items: center; text-align: center; }
}
@media (max-width: 390px) {
  .top-bar-row > span { font-size: .68rem; }
  .top-bar button { font-size: .7rem; }
  .brand { font-size: 1.45rem; }
  .brand-mark { width: 38px; }
  .group-link { padding-inline: 14px; }
  .video-grid { gap-inline: 6px; }
  .views-badge, .rating-badge { font-size: .62rem; }
}
@media (max-width: 330px) {
  .video-grid { grid-template-columns: 1fr; }
}
