/* ─── CSS Variables ─────────────────────────────────── */
:root {
  --bg:       #0f172a;
  --surface:  #1e293b;
  --border:   #334155;
  --text:     #f1f5f9;
  --muted:    #94a3b8;
  --accent:   #f97316;
  --accent2:  #fb923c;
  --radius:   12px;
  --shadow:   0 4px 24px rgba(0,0,0,.45);
  --font:     'Sora', sans-serif;
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky; top: 0; z-index: 100;
}
.site-logo { font-size: 1.35rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.header-ad-wrap { flex: 1; max-width: 728px; margin: 0 auto; overflow: hidden; }

/* ─── Ad Slots ───────────────────────────────────────── */
.ad-slot { width: 100%; overflow: hidden; line-height: 0; }
.ad-banner-top    { min-height: 90px;  background: transparent; }
.ad-banner-bottom { min-height: 90px;  background: transparent; margin-top: 1rem; }
.ad-sidebar       { min-height: 250px; background: transparent; }
.ad-interstitial  { min-height: 250px; background: transparent; margin: 1rem 0; }

/* ─── Layout ─────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .page-grid { grid-template-columns: 1fr; } }

/* ─── Product Grid ───────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card img   { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.product-card .no-img {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.card-body   { padding: 1rem; flex: 1; }
.card-title  { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
.card-desc   { font-size: .85rem; color: var(--muted); }
.card-footer { padding: .75rem 1rem; border-top: 1px solid var(--border); }
.btn-download {
  display: block; text-align: center;
  background: var(--accent); color: #fff;
  padding: .55rem 1rem; border-radius: 8px;
  font-weight: 600; font-size: .9rem;
  text-decoration: none; transition: background .2s;
}
.btn-download:hover { background: var(--accent2); }

/* ─── Download Timer Page ────────────────────────────── */
.timer-wrap {
  max-width: 680px; margin: 3rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}
.timer-product-img { width: 100%; max-height: 240px; object-fit: cover; }
.timer-body   { padding: 2rem; }
.timer-title  { font-size: 1.4rem; font-weight: 700; margin-bottom: .5rem; }
.timer-desc   { color: var(--muted); margin-bottom: 1.5rem; }

.timer-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0%, #334155 0%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2rem; font-weight: 700;
  position: relative;
  transition: background .3s;
}
.timer-circle::after {
  content: ''; position: absolute;
  width: 78px; height: 78px;
  border-radius: 50%; background: var(--surface);
}
.timer-num { position: relative; z-index: 1; }

.timer-label { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }

.btn-get {
  display: inline-block; padding: .8rem 2.5rem;
  background: var(--accent); color: #fff;
  border-radius: 10px; font-weight: 700; font-size: 1.05rem;
  text-decoration: none; transition: background .2s, transform .1s;
  cursor: pointer; border: none;
}
.btn-get:hover  { background: var(--accent2); transform: scale(1.03); }
.btn-get:disabled,
.btn-get.disabled { background: #475569; cursor: not-allowed; transform: none; }

/* ─── Sidebar ────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.sidebar-box h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem; }

/* ─── Admin ──────────────────────────────────────────── */
.admin-wrap {
  display: flex; min-height: 100vh;
}
.admin-sidebar {
  width: 220px; background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}
.admin-sidebar .logo { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 1.5rem; display: block; }
.admin-nav a {
  display: block; padding: .55rem .75rem;
  color: var(--muted); text-decoration: none;
  border-radius: 8px; font-size: .9rem; margin-bottom: .25rem;
  transition: background .15s, color .15s;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(249,115,22,.15); color: var(--accent); }
.admin-content { flex: 1; padding: 2rem; overflow-x: auto; }
.admin-content h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

/* ─── Tables ─────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { background: var(--border); padding: .6rem .9rem; text-align: left; }
.data-table td { padding: .6rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,.03); }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-on  { background: rgba(34,197,94,.2); color: #4ade80; }
.badge-off { background: rgba(239,68,68,.2);  color: #f87171; }

/* ─── Forms ──────────────────────────────────────────── */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; max-width: 640px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: .6rem .85rem;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px;
  font-family: inherit; font-size: .95rem;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--accent); }
.form-group textarea { min-height: 120px; resize: vertical; }
.btn { display: inline-block; padding: .6rem 1.4rem; border-radius: 8px; font-weight: 600; cursor: pointer; border: none; font-family: inherit; font-size: .95rem; text-decoration: none; transition: opacity .15s; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }

/* ─── Login ──────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 380px;
}
.login-box h1 { font-size: 1.6rem; margin-bottom: 1.5rem; text-align: center; }
.alert { padding: .7rem 1rem; border-radius: 8px; font-size: .9rem; margin-bottom: 1rem; }
.alert-error   { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.4); color: #86efac; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .admin-sidebar { display: none; }
  .timer-wrap { margin: 1rem; }
}
