/* ============================================================
   SOKO VIDEO — design tokens
   Signature: price tags rendered as torn ticket stubs (perforated
   edge + notches), echoing the mobile-money receipt at the heart
   of every sale here.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root{
  --usiku:#14161F;      /* deep indigo-black (dark theme bg only) */
  --usiku-2:#1E2130;    /* raised surface on dark */
  --karatasi:#FFFFFF;   /* pure white */
  --karatasi-2:#F6F3EC; /* soft off-white surface */
  --dhahabu:#E8B340;    /* gold — value / money */
  --dhahabu-ink:#5C3F0A;
  --nyekundu:#C23B37;   /* red — energy / accent */
  --nyekundu-ink:#7A211E;
  --baharini:#C23B37;   /* kept as alias so existing rules stay red-accented */
  --ink:#1B1A17;
  --paper-ink:#FBF6EC;
  --muted:#8A8578;
  --muted-dark:#8D93AE;
  --danger:#C23B37;

  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', monospace;

  --radius: 14px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--body);
  color:var(--ink);
  background:var(--karatasi);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.display{ font-family:var(--display); font-weight:600; letter-spacing:-.01em; }
a{color:inherit}
button,input,select,textarea{font-family:inherit;font-size:1rem}
.container{max-width:1120px;margin:0 auto;padding:0 20px}

/* ---------- Theme: Giza (dark) ---------- */
body.theme-giza{
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(232,179,64,.10), transparent),
    var(--usiku);
  color:#F2EFE6;
}
.theme-giza .surface{ background:var(--usiku-2); border:1px solid rgba(255,255,255,.07); }
.theme-giza .muted{ color:var(--muted-dark); }
.theme-giza .accent{ color:var(--dhahabu); }
.theme-giza .btn-primary{ background:var(--dhahabu); color:#221703; }
.theme-giza .stub{ background:var(--usiku-2); border-color:rgba(255,255,255,.14); color:#F2EFE6; }
.theme-giza .stub .stub-notch{ background:var(--usiku); }
.theme-giza .topbar{ border-bottom:1px solid rgba(255,255,255,.08); }

/* ---------- Theme: Angavu (bright) ---------- */
body.theme-angavu{ background:var(--karatasi); color:var(--ink); }
.theme-angavu .surface{ background:#fff; border:1px solid rgba(27,26,23,.08); }
.theme-angavu .muted{ color:var(--muted); }
.theme-angavu .accent{ color:var(--baharini); }
.theme-angavu .btn-primary{ background:var(--baharini); color:#fff; }
.theme-angavu .stub{ background:#fff; border-color:rgba(27,26,23,.12); color:var(--ink); }
.theme-angavu .stub .stub-notch{ background:var(--karatasi); }
.theme-angavu .topbar{ border-bottom:1px solid rgba(27,26,23,.08); }

/* ---------- Layout bits ---------- */
.topbar{ padding:18px 0; }
.topbar .container{ display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brandmark{ display:flex; align-items:center; gap:10px; font-family:var(--display); font-weight:700; font-size:1.25rem; }
.brandmark .dot{ width:9px;height:9px;border-radius:50%; background:var(--dhahabu); }

.hero{ padding:56px 0 32px; }
.hero h1{ font-size:clamp(1.8rem,4vw,2.6rem); margin:0 0 10px; line-height:1.1 }
.hero p{ margin:0; max-width:56ch; }

.grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:18px; margin:28px 0 60px; }

/* ---------- The signature: ticket-stub video card ---------- */
.stub{
  border-radius:var(--radius);
  border:1px solid;
  overflow:hidden;
  position:relative;
  display:flex;
  flex-direction:column;
}
.stub-thumb{ aspect-ratio:16/10; background:#000 center/cover no-repeat; position:relative; }
.stub-thumb .play{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:2rem; background:rgba(0,0,0,.15);
}

/* Featured (big) video at the top of the storefront */
.featured-stub{ max-width:100%; }
.featured-thumb{ aspect-ratio:16/8; cursor:pointer; }
.featured-thumb .play{ font-size:3.2rem; }

/* Smaller grid of the remaining videos */
.grid-small{ grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; }
.small-thumb{ aspect-ratio:4/5; cursor:pointer; }
.small-thumb .play{ font-size:1.4rem; }
.stub-small .stub-body{ gap:6px; }
.new-badge{
  position:absolute; top:10px; left:10px; background:var(--dhahabu); color:#221703;
  font-size:.68rem; font-weight:700; letter-spacing:.04em; padding:4px 9px; border-radius:99px;
  z-index:2;
}
.new-banner{
  display:inline-block; font-weight:600; font-size:.86rem; padding:9px 16px;
  border-radius:99px; border:1.5px solid currentColor; margin-bottom:16px;
}
.stub-body{ padding:16px 18px 18px; display:flex; flex-direction:column; gap:8px; flex:1; }
.stub-body h3{ margin:0; font-size:1.05rem; }
.stub-body .desc{ font-size:.86rem; margin:0; }
.stub-foot{
  display:flex; align-items:center; justify-content:space-between;
  border-top:1.5px dashed; border-color:inherit; margin-top:auto; padding-top:12px;
  position:relative;
}
/* perforation notches on the ticket tear-line */
.stub-foot::before,.stub-foot::after{
  content:''; position:absolute; top:-7px; width:14px; height:14px; border-radius:50%;
}
.stub-foot::before{ left:-8px; } .stub-foot::after{ right:-8px; }
.stub .stub-notch{ position:absolute; top:-7px; width:14px; height:14px; border-radius:50%; }
.price-tag{ font-family:var(--mono); font-weight:600; letter-spacing:.02em; }
.price-tag small{ font-family:var(--body); font-weight:500; opacity:.7; margin-left:2px; }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 18px; border-radius:10px; border:none; cursor:pointer;
  font-weight:600; font-size:.92rem; transition:transform .12s ease, opacity .12s ease;
  text-decoration:none;
}
.btn:active{ transform:scale(.97); }
.btn-primary{ }
.btn-ghost{ background:transparent; border:1.5px solid currentColor; color:inherit; opacity:.85 }
.btn-ghost:hover{ opacity:1 }
.btn-sm{ padding:8px 14px; font-size:.82rem; border-radius:8px; }
.btn-danger{ background:var(--danger); color:#fff; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.badge{ display:inline-block; padding:3px 10px; border-radius:99px; font-size:.72rem; font-weight:600; }
.badge-green{ background:#dff5e8; color:#177245; }
.badge-yellow{ background:#fff2d6; color:#8a5a00; }
.badge-red{ background:#fde3e0; color:#a3241b; }
.theme-giza .badge-green{ background:#12351f; color:#6bdb9b; }
.theme-giza .badge-yellow{ background:#3a2c05; color:#f2c14e; }
.theme-giza .badge-red{ background:#3a1310; color:#f28d85; }

.field{ margin-bottom:16px; }
.field label{ display:block; font-size:.82rem; font-weight:600; margin-bottom:6px; }
.field input,.field select,.field textarea{
  width:100%; padding:11px 13px; border-radius:9px; border:1.5px solid rgba(27,26,23,.15);
  background:transparent; color:inherit;
}
.theme-giza .field input,.theme-giza .field select,.theme-giza .field textarea{ border-color:rgba(255,255,255,.16); }
.field .hint{ font-size:.76rem; margin-top:5px; }

.card{ border-radius:var(--radius); padding:22px; }
.empty{ text-align:center; padding:60px 20px; border-radius:var(--radius); border:1.5px dashed rgba(27,26,23,.18); }
.theme-giza .empty{ border-color:rgba(255,255,255,.16); }

/* ---------- Dashboards (utilitarian, not themed) ---------- */
.dash{ min-height:100vh; background:#F5F3EE; color:var(--ink); }
.dash-shell{ display:flex; min-height:100vh; }
.dash-nav{ width:230px; flex-shrink:0; background:var(--usiku); color:#E9E6DC; padding:22px 14px; }
.dash-nav .brandmark{ color:#fff; padding:0 8px 22px; }
.dash-nav a{ display:block; padding:10px 12px; border-radius:8px; text-decoration:none; font-size:.9rem; margin-bottom:2px; color:#C7C4B8; }
.dash-nav a.active,.dash-nav a:hover{ background:rgba(255,255,255,.08); color:#fff; }
.dash-main{ flex:1; padding:30px 34px; max-width:1100px; }
.dash-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.dash-head h1{ font-size:1.5rem; margin:0; }
.stat-row{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px; margin-bottom:26px; }
.stat-card{ background:#fff; border:1px solid rgba(27,26,23,.08); border-radius:12px; padding:16px 18px; }
.stat-card .num{ font-family:var(--mono); font-size:1.5rem; font-weight:600; }
.stat-card .label{ font-size:.78rem; color:var(--muted); margin-top:2px; }
table{ width:100%; border-collapse:collapse; background:#fff; border-radius:12px; overflow:hidden; }
th,td{ text-align:left; padding:11px 14px; font-size:.86rem; border-bottom:1px solid rgba(27,26,23,.07); }
th{ background:#EFEBE2; font-size:.74rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.tabs{ display:flex; gap:6px; margin-bottom:20px; border-bottom:1px solid rgba(27,26,23,.1); flex-wrap:wrap; }
.tabs a{ padding:10px 14px; text-decoration:none; color:var(--muted); font-size:.88rem; font-weight:600; border-bottom:2px solid transparent; }
.tabs a.active{ color:var(--ink); border-color:var(--dhahabu); }
.toast{ position:fixed; bottom:22px; right:22px; background:var(--ink); color:#fff; padding:12px 18px; border-radius:10px; font-size:.88rem; z-index:99; box-shadow:0 8px 24px rgba(0,0,0,.2); }

.modal-back{ position:fixed; inset:0; background:rgba(20,22,31,.72); display:flex; align-items:center; justify-content:center; z-index:80; padding:20px; }
.modal{ background:#fff; color:var(--ink); border-radius:16px; padding:26px; width:100%; max-width:380px; }
.modal h3{ margin:0 0 6px; }
.modal .price{ font-family:var(--mono); font-weight:600; font-size:1.3rem; margin:2px 0 16px; }

.template-pick{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; }
.template-opt{ border-radius:12px; border:2px solid rgba(27,26,23,.1); padding:4px; cursor:pointer; position:relative; }
.template-opt.selected{ border-color:var(--dhahabu); }
.template-opt .prev{ border-radius:9px; height:120px; display:flex; align-items:center; justify-content:center; font-family:var(--display); font-weight:600; }
.template-opt .name{ padding:10px 8px 6px; font-size:.86rem; font-weight:600; }
.template-opt input{ position:absolute; top:10px; right:10px; }

.copylink{ display:flex; gap:8px; align-items:center; background:#fff; border:1px solid rgba(27,26,23,.12); border-radius:10px; padding:8px 10px 8px 14px; font-family:var(--mono); font-size:.82rem; }
.copylink input{ border:none; background:transparent; flex:1; font-family:var(--mono); font-size:.82rem; }

@media (max-width:760px){
  .dash-shell{ flex-direction:column; }
  .dash-nav{ width:auto; display:flex; overflow-x:auto; padding:12px; }
  .dash-nav .brandmark{ display:none; }
  .dash-nav a{ white-space:nowrap; margin-right:4px; margin-bottom:0; }
  .dash-main{ padding:20px 16px; }
}
@media (prefers-reduced-motion:reduce){ *{ transition:none !important; animation:none !important; } }
