/* ============================================================
   Dota 2 SkinChanger — Dark Dota theme (RTL Arabic)
   ============================================================ */
:root {
  --bg0: #07080c;
  --bg1: #0d1017;
  --bg2: #10141e;
  --panel: #141926;
  --panel2: #1a2032;
  --line: #232c41;
  --red: #d63a2f;
  --red-hot: #ff5a45;
  --red-dark: #8f1f16;
  --gold: #c8aa6e;
  --gold-bright: #f0d9a8;
  --text: #e9e6df;
  --muted: #98a0ae;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --font-display: "Cairo", "Tajawal", sans-serif;
  --font-body: "Tajawal", "Cairo", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden must always win over component display rules */
[hidden] { display: none !important; }

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

body {
  font-family: var(--font-body);
  background: var(--bg1);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
b, strong { color: var(--gold-bright); font-weight: 700; }
code {
  background: var(--panel2); border: 1px solid var(--line);
  padding: .1em .5em; border-radius: 6px; font-size: .9em;
  direction: ltr; unicode-bidi: embed; color: var(--gold-bright);
}

.container { width: min(1180px, 92%); margin-inline: auto; }
.container-narrow { width: min(860px, 92%); }

/* ---------- Accessibility ---------- */
.skip-link {
  position: fixed; top: -60px; right: 16px; z-index: 200;
  background: var(--red); color: #fff; padding: 10px 18px;
  border-radius: 8px; transition: top .2s;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- Gradient text helpers ---------- */
.grad-red {
  background: linear-gradient(120deg, var(--red-hot), var(--red-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.grad-gold {
  background: linear-gradient(120deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  background: rgba(10, 13, 20, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.navbar.scrolled { border-bottom-color: var(--line); background: rgba(10, 13, 20, .94); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(214, 58, 47, .5)); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: .3px; }
.brand-name b { color: var(--red-hot); }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  display: block; padding: 10px 14px; border-radius: 8px;
  color: var(--muted); font-weight: 500; font-size: .95rem;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-links a.active { color: var(--gold-bright); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: 10px;
}
.nav-toggle span { width: 24px; height: 2.5px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(214, 58, 47, .16), transparent 60%),
    radial-gradient(800px 500px at 10% 110%, rgba(200, 170, 110, .10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 70%);
  overflow: hidden;
  padding-top: 68px;
}
#embers { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8; }
.hero-glow {
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 58, 47, .14), transparent 65%);
  top: -200px; inset-inline-start: -150px; pointer-events: none;
  animation: pulse 7s ease-in-out infinite alternate;
}
@keyframes pulse { from { opacity: .6; transform: scale(1); } to { opacity: 1; transform: scale(1.15); } }

.hero-inner { position: relative; z-index: 2; padding-block: 80px; }

.badge {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  border: 1px solid rgba(200, 170, 110, .35);
  background: rgba(200, 170, 110, .08);
  color: var(--gold-bright); font-size: .85rem; font-weight: 500;
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.15; margin-bottom: 18px;
  text-shadow: 0 6px 40px rgba(0, 0, 0, .5);
}
.hero-sub {
  max-width: 620px; color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 34px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 54px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 24px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 1rem; font-family: var(--font-body);
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--red-hot), var(--red-dark));
  color: #fff;
  box-shadow: 0 8px 28px rgba(214, 58, 47, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { box-shadow: 0 10px 36px rgba(214, 58, 47, .55); transform: translateY(-2px); }

.btn-ghost {
  background: rgba(255, 255, 255, .04);
  border-color: var(--line); color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-bright); transform: translateY(-2px); }

.btn-big { padding: 15px 30px; font-size: 1.08rem; }
.btn-block { width: 100%; }

/* ---------- Hero stats ---------- */
.hero-stats {
  display: flex; flex-wrap: wrap; gap: clamp(20px, 5vw, 64px);
}
.stat-num {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem); color: var(--gold-bright);
  unicode-bidi: plaintext; /* "~1.5 GB" keeps LTR order inside RTL layout */
}
.stat-label { color: var(--muted); font-size: .9rem; }

.hero-fade {
  position: absolute; bottom: 0; inset-inline: 0; height: 120px;
  background: linear-gradient(180deg, transparent, var(--bg1));
  pointer-events: none;
}

/* ============================================================
   Sections
   ============================================================ */
.section { padding-block: 90px; }
.section-alt {
  background:
    radial-gradient(900px 400px at 50% 0%, rgba(214, 58, 47, .05), transparent 70%),
    var(--bg2);
  border-block: 1px solid var(--line);
}
.section-head { text-align: center; margin-bottom: 52px; }
.section-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.8rem, 4.5vw, 2.7rem); margin-bottom: 10px;
}
.section-sub { color: var(--muted); max-width: 560px; margin-inline: auto; }

/* ============================================================
   Features
   ============================================================ */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.feature-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.feature-card:hover {
  transform: translateY(-6px); border-color: rgba(200, 170, 110, .4);
  box-shadow: var(--shadow);
}
.feature-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  font-size: 1.5rem; border-radius: 12px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(214, 58, 47, .18), rgba(200, 170, 110, .12));
  border: 1px solid var(--line);
}
.feature-card h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: .95rem; }

/* ============================================================
   Videos
   ============================================================ */
.videos-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-bottom: 34px;
}
.search-box {
  position: relative; flex: 1 1 300px; max-width: 440px;
}
.search-box svg {
  position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.search-box input {
  width: 100%; padding: 12px 44px 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-family: inherit; font-size: .98rem;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 170, 110, .15);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 18px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line);
  transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--gold); }
.chip.active {
  background: linear-gradient(135deg, var(--red-hot), var(--red-dark));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(214, 58, 47, .35);
}

.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.video-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.video-card:hover {
  transform: translateY(-6px); border-color: rgba(214, 58, 47, .45);
  box-shadow: var(--shadow);
}

.thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--panel2); cursor: pointer; border: 0; padding: 0; width: 100%;
  display: block; text-align: inherit;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.video-card:hover .thumb img { transform: scale(1.06); }

.thumb .play-ico {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(5, 6, 10, .25); transition: background .25s;
}
.video-card:hover .play-ico { background: rgba(5, 6, 10, .45); }
.play-ico span {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(214, 58, 47, .92); color: #fff;
  box-shadow: 0 6px 24px rgba(214, 58, 47, .6);
  font-size: 1.3rem; padding-inline-start: 4px;
  transition: transform .25s;
}
.video-card:hover .play-ico span { transform: scale(1.12); }

.duration {
  position: absolute; bottom: 10px; inset-inline-start: 10px;
  background: rgba(0, 0, 0, .78); color: #fff;
  padding: 3px 9px; border-radius: 6px; font-size: .8rem;
  direction: ltr;
}
.cat-badge {
  position: absolute; top: 10px; inset-inline-end: 10px;
  padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: rgba(200, 170, 110, .92); color: #1a1408;
}
.cat-badge.cat-tutorial { background: rgba(90, 170, 255, .92); color: #061626; }
.cat-badge.cat-update  { background: rgba(120, 210, 130, .92); color: #07230b; }
.cat-badge.cat-fix     { background: rgba(255, 170, 60, .95); color: #241300; }

.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.video-title { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.5; }
.video-meta {
  display: flex; align-items: center; gap: 14px;
  color: var(--muted); font-size: .85rem; margin-top: auto;
}
.video-meta .stars { color: var(--gold); letter-spacing: 1px; }

.videos-empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 1.1rem; }

/* ============================================================
   Modal player
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 5, 9, .85); backdrop-filter: blur(4px); }
.modal-dialog {
  position: relative; width: min(940px, 94%);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  animation: modal-in .25s ease;
}
@keyframes modal-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-close {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; border: 1px solid rgba(255,255,255,.15);
  font-size: 1rem;
  transition: background .2s;
}
.modal-close:hover { background: var(--red); }

.player-wrap { aspect-ratio: 16 / 9; background: #000; }
.player-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-placeholder {
  height: 100%; display: grid; place-items: center; text-align: center;
  color: var(--muted); padding: 24px;
}
.player-info { padding: 18px 22px 22px; }
.player-info h3 { font-family: var(--font-display); margin-bottom: 6px; }
.player-info p { color: var(--muted); font-size: .95rem; }

/* ============================================================
   Download
   ============================================================ */
.dl-grid {
  display: grid; grid-template-columns: 380px 1fr; gap: 26px; align-items: start;
}

.dl-card {
  background: linear-gradient(160deg, var(--panel2), var(--panel));
  border: 1px solid rgba(200, 170, 110, .3);
  border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow);
  position: sticky; top: 90px;
}
.dl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dl-version {
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
  color: var(--gold-bright);
}
.dl-fresh { font-size: .82rem; color: var(--muted); }
.dl-title { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 18px; direction: ltr; text-align: end; }

.dl-facts { display: grid; gap: 10px; margin-bottom: 22px; }
.dl-facts li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 14px; background: rgba(0, 0, 0, .22);
  border: 1px solid var(--line); border-radius: 10px; font-size: .92rem;
}
.dl-facts span { color: var(--muted); }
.dl-facts b { unicode-bidi: plaintext; } /* keep "1.5 GB" ordered correctly inside RTL */
.dl-sha {
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-sha.has-sha { direction: ltr; font-family: monospace; font-size: .8rem; }
.dl-card .btn + .btn { margin-top: 10px; }
.dl-note { margin-top: 16px; font-size: .85rem; color: var(--muted); line-height: 1.8; }

.install-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}
.install-title { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 18px; }

.tab-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab-btn {
  padding: 9px 18px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  transition: all .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: linear-gradient(135deg, rgba(200,170,110,.25), rgba(200,170,110,.1));
  color: var(--gold-bright); border-color: rgba(200, 170, 110, .5);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.steps { counter-reset: step; display: grid; gap: 12px; margin-bottom: 14px; list-style: none; padding: 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 12px 52px 12px 16px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  font-size: .95rem;
}
.steps li::before {
  content: counter(step);
  position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; font-weight: 800; font-size: .85rem;
  background: linear-gradient(135deg, var(--red-hot), var(--red-dark)); color: #fff;
}
.tip { font-size: .88rem; color: var(--muted); background: rgba(90,170,255,.07); border: 1px solid rgba(90,170,255,.2); border-radius: 10px; padding: 10px 14px; }

.warn-box {
  margin-top: 20px; padding: 16px 18px;
  background: rgba(214, 58, 47, .07); border: 1px solid rgba(214, 58, 47, .3);
  border-radius: 10px; font-size: .9rem;
}
.warn-box ul { margin-top: 8px; display: grid; gap: 6px; padding-inline-start: 18px; list-style: disc; }
.warn-box li { color: var(--muted); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { display: grid; gap: 12px; }
.faq-item {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  transition: border-color .2s;
}
.faq-item[open] { border-color: rgba(200, 170, 110, .4); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 20px; font-weight: 700; font-family: var(--font-display);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.4rem; color: var(--gold); flex: none;
  transition: transform .25s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 20px 18px; color: var(--muted); font-size: .96rem; }
.faq-body code { font-size: .82em; }

/* ============================================================
   Comments
   ============================================================ */
.rating-summary {
  text-align: center; margin-bottom: 30px;
}
.avg-stars { font-size: 2rem; color: var(--gold); letter-spacing: 4px; }
.rating-summary p { color: var(--muted); font-size: .95rem; }

.comment-form {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin-bottom: 34px;
  display: grid; gap: 16px;
}
.form-row { display: grid; gap: 8px; }
.form-row label, .rate-label { font-weight: 700; font-size: .92rem; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 11px 14px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: .95rem; resize: vertical;
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 170, 110, .13);
}

.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input button {
  background: none; border: 0; font-size: 1.7rem; color: #3a4155;
  transition: color .15s, transform .15s; padding: 2px;
}
.star-input button:hover { transform: scale(1.15); }
.star-input button.lit,
.star-input button:hover,
.star-input button:hover ~ button { color: var(--gold); }

.form-hint { font-size: .8rem; color: var(--muted); }

.comment-list { display: grid; gap: 14px; }
.comment-item {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--red-hot), var(--red-dark));
}
.comment-name { font-weight: 700; }
.comment-stars { color: var(--gold); font-size: .85rem; letter-spacing: 1px; }
.comment-date { color: var(--muted); font-size: .78rem; margin-inline-start: auto; }
.comment-text { color: var(--muted); font-size: .94rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.comments-empty { text-align: center; color: var(--muted); padding: 20px 0; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg0); padding-top: 46px;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between;
  padding-bottom: 30px;
}
.footer-brand { max-width: 520px; }
.footer-brand .brand-name { font-size: 1.15rem; }
.disclaimer { color: var(--muted); font-size: .84rem; margin-top: 10px; line-height: 1.8; }
.footer-links { display: flex; gap: 8px 22px; flex-wrap: wrap; align-items: start; }
.footer-links a { color: var(--muted); font-size: .92rem; transition: color .2s; }
.footer-links a:hover { color: var(--gold-bright); }
.copyright {
  border-top: 1px solid var(--line); padding-block: 18px;
  color: var(--muted); font-size: .82rem; text-align: center;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .dl-grid { grid-template-columns: 1fr; }
  .dl-card { position: static; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 68px; inset-inline: 0;
    flex-direction: column; gap: 2px; padding: 10px 4%;
    background: rgba(10, 13, 20, .97);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 14px; }

  .section { padding-block: 64px; }
  .hero-inner { padding-block: 60px; }
  .hero-stats { gap: 18px 34px; }
  .btn-big { width: 100%; }
  .hero-cta { flex-direction: column; }
  .videos-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
}
