/* Poruči Video · Snimi — tokeni preuzeti sa porucivideo.rs */
:root {
  --bg: #0a0908;
  --bg-1: #100e0c;
  --bg-2: #161310;
  --surface: rgba(255,255,255,0.045);
  --surface-strong: rgba(255,255,255,0.08);
  --surface-hover: rgba(255,255,255,0.10);
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);
  --text: #f5f3ee;
  --text-muted: rgba(245,243,238,0.66);
  --text-faint: rgba(245,243,238,0.42);
  --gold: #fdf1c9;
  --gold-strong: #f6d98a;
  --red: #f5311f;
  --orange: #ff8e4c;
  --green: #4ade80;
  --grad-brand: linear-gradient(135deg, var(--red) 0%, #fa4a27 45%, var(--orange) 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(245,49,31,0.18), rgba(255,142,76,0.18));
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --ease-out: cubic-bezier(.16,1,.3,1);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.06) inset, 0 20px 50px -20px rgba(0,0,0,0.6);
  --shadow-cta: 0 8px 30px -8px rgba(245,49,31,0.55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(900px 500px at 85% -10%, rgba(245,49,31,0.13), transparent 60%),
              radial-gradient(700px 420px at -10% 110%, rgba(255,142,76,0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font: 600 14px/1 Inter, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s var(--ease-out), box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad-brand); border-color: transparent; box-shadow: var(--shadow-cta); color: #fff; }
.btn-primary:hover { background: var(--grad-brand); filter: brightness(1.06); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { color: #ff9a8f; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- cards & forms ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-muted); }
input[type=text], input[type=password], select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font: 400 15px Inter, system-ui, sans-serif;
}
input:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,142,76,0.18); }
.alert {
  padding: 10px 14px; margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: rgba(245,49,31,0.12);
  border: 1px solid rgba(245,49,31,0.35);
  color: #ffc2bb;
  font-size: 14px;
}
.note {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- login ---------- */
.center-page { display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .field { text-align: left; }
.login-card h1 { margin-bottom: 4px; }
.login-card p.muted { margin-bottom: 20px; }
.login-logo { width: 150px; height: auto; margin: -8px auto 8px; display: block; }

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  background: rgba(10,9,8,0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.topbar .brand img { width: 84px; height: auto; }
.topbar .brand span { font-weight: 700; font-size: 15px; color: var(--text-muted); padding-left: 10px; border-left: 1px solid var(--border); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; }

/* ---------- library ---------- */
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { padding: 10px 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.stat b { display: block; font-size: 20px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--text-faint); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.vcard { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s; }
.vcard:hover { border-color: var(--border-strong); }
.vthumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); display: block; overflow: hidden; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vthumb .dur { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,0.72); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vthumb .badge { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(0,0,0,0.72); }
.vthumb .noposter { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); }
.vbody { padding: 14px 16px 16px; display: grid; gap: 10px; flex: 1; align-content: start; }
.vtitle { font-weight: 700; font-size: 15px; line-height: 1.3; word-break: break-word; }
.vmeta { font-size: 13px; color: var(--text-faint); }
.vviews { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.vviews .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.vviews.seen .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(74,222,128,0.18); }
.vactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.views-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.views-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); }
.views-list .pct { font-weight: 700; font-variant-numeric: tabular-nums; }
details.views summary { cursor: pointer; font-size: 13px; color: var(--text-muted); list-style: none; }
details.views summary::-webkit-details-marker { display: none; }
details.views summary::before { content: "▸ "; }
details.views[open] summary::before { content: "▾ "; }
details.views[open] summary { margin-bottom: 8px; }
.empty { text-align: center; padding: 64px 24px; }
.empty h2 { margin-bottom: 8px; }
.empty .btn { margin-top: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  padding: 12px 18px; border-radius: 999px;
  background: #1d1915; border: 1px solid var(--border-strong);
  font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease-out);
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- recorder ---------- */
.rec-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.rec-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid; place-items: center;
}
.rec-stage video.screen { width: 100%; height: 100%; object-fit: contain; background: #000; }
.rec-stage .placeholder { text-align: center; padding: 24px; color: var(--text-faint); max-width: 440px; }
.rec-stage .placeholder svg { width: 44px; height: 44px; margin-bottom: 10px; opacity: .6; }
.cam-bubble {
  position: absolute; left: 24px; bottom: 24px;
  width: 22%; aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  background: var(--bg-2);
}
.cam-bubble video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.rec-stage.cam-only .cam-bubble { position: static; width: 46%; }
.countdown {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(10,9,8,0.72);
  font-size: 120px; font-weight: 800;
  z-index: 5;
}
.rec-panel { display: grid; gap: 4px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); margin-bottom: 16px; }
.seg button {
  appearance: none; border: 0; border-radius: 10px;
  padding: 10px 6px; min-height: 64px;
  background: transparent; color: var(--text-muted);
  font: 600 12px/1.2 Inter, system-ui, sans-serif;
  cursor: pointer; display: grid; justify-items: center; gap: 6px;
}
.seg button svg { width: 20px; height: 20px; }
.seg button[aria-pressed=true] { background: var(--surface-strong); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong) inset; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-strong); overflow: hidden; margin-top: -8px; margin-bottom: 16px; }
.meter i { display: block; height: 100%; width: 0; background: var(--green); transition: width .08s linear; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.rec-status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); margin-bottom: 12px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: pulse 1.2s ease-in-out infinite; flex: none; }
.rec-status.paused .rec-dot { animation: none; background: var(--gold-strong); }
.rec-time { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.upload-line { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.rec-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rec-buttons .btn-primary { grid-column: 1 / -1; }
.done-link { display: flex; gap: 8px; margin: 12px 0; }
.done-link input { font-size: 14px; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- watch page ---------- */
.watch { max-width: 1040px; margin: 0 auto; padding: 20px 20px 64px; }
.watch-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 20px; }
.watch-top img.logo { width: 96px; height: auto; display: block; }
.player {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8);
  aspect-ratio: 16 / 9;
}
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player .big-play {
  position: absolute; inset: 0; margin: auto;
  width: 88px; height: 88px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--grad-brand);
  box-shadow: var(--shadow-cta);
  display: grid; place-items: center;
  transition: transform .2s var(--ease-out);
}
.player .big-play:hover { transform: scale(1.06); }
.player .big-play svg { width: 34px; height: 34px; margin-left: 5px; fill: #fff; }
.watch-info { display: flex; gap: 16px; align-items: center; margin-top: 22px; }
.watch-info img.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-strong); flex: none; }
.watch-info h1 { font-size: 24px; }
.watch-info .who { margin-top: 4px; font-size: 14px; color: var(--text-muted); }
.cta {
  margin-top: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--grad-brand-soft), var(--bg-1);
  border: 1px solid rgba(255,142,76,0.25);
}
.cta h2 { font-size: 20px; }
.cta p { margin-top: 6px; color: var(--text-muted); max-width: 520px; }
.cta .cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.watch-foot { margin-top: 36px; text-align: center; font-size: 13px; color: var(--text-faint); }
.watch-foot a { color: var(--text-muted); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .rec-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { padding: 10px 16px; }
  .topbar .brand span { display: none; }
  .wrap { padding: 20px 16px 48px; }
  .watch { padding: 12px 16px 48px; }
  .player { border-radius: var(--radius-md); }
  .watch-info h1 { font-size: 20px; }
  .cta { padding: 20px; }
  .cta .cta-actions, .cta .cta-actions .btn { width: 100%; }
  h1 { font-size: 24px; }
}
