@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #08080a;
  --bg-elevated: #0f0f13;
  --card: #16161c;
  --card-border: #26262f;
  --text: #f2f2f5;
  --text-dim: #9a9aa6;
  --pink: #ff0055;
  --cyan: #00e5ff;
  --gold: #ffd54a;
  --green: #10b981;
  --red: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --gradient: linear-gradient(135deg, var(--pink), var(--cyan));
  --shadow-glow: 0 0 40px rgba(255, 0, 85, 0.15);
  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(255, 0, 85, 0.12), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(0, 229, 255, 0.10), transparent 40%);
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 8px; line-height: 1.15; }
p { color: var(--text-dim); line-height: 1.6; }
a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(8, 8, 10, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.nav-inner { max-width: 1180px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; margin-right: auto; }
.brand img { height: 34px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 22px; font-weight: 600; font-size: 0.95rem; }
.nav-links a { color: var(--text-dim); transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--card-border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 24px rgba(255, 0, 85, 0.28); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 32px rgba(255, 0, 85, 0.4); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--card-border); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
}
.glass {
  background: rgba(22, 22, 28, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}
.hero p { max-width: 560px; margin: 0 auto 30px; font-size: 1.1rem; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-challenges { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-feed { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------- Category card ---------- */
.cat-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background-size: cover;
  background-position: center;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.cat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(8,8,10,0.92));
  z-index: 0;
}
.cat-card > * { position: relative; z-index: 1; }
.cat-card .tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.12); margin-bottom: 8px; width: fit-content; }

/* ---------- Challenge card ---------- */
.ch-card { display: flex; flex-direction: column; gap: 10px; transition: transform 0.2s ease; }
.ch-card:hover { transform: translateY(-3px); }
.prize-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 213, 74, 0.14); color: var(--gold);
  padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 0.8rem; width: fit-content;
}

/* ---------- Difficulty meter ---------- */
.difficulty { display: flex; align-items: center; gap: 8px; }
.difficulty-bars { display: flex; gap: 3px; }
.difficulty-bars span { width: 6px; height: 14px; border-radius: 2px; background: #2a2a33; }
.difficulty-bars span.on { background: var(--gradient); }
.difficulty-label { font-size: 0.78rem; color: var(--text-dim); font-weight: 600; }

/* ---------- Studio (recording) ---------- */
.studio-video { width: 100%; border-radius: 12px; background: #000; transform: scaleX(-1); aspect-ratio: 4/3; object-fit: cover; }
.yt-hidden { display: none; }
.studio-controls { display: flex; gap: 10px; margin-top: 16px; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); animation: pulse 1.2s infinite; margin-right: 6px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- Feed item ---------- */
.feed-item { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--card-border); background: #000; }
.feed-item video { width: 100%; height: 200px; object-fit: cover; background: #000; }
.feed-info { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feed-user { font-weight: 700; font-size: 0.88rem; display: flex; align-items: center; gap: 6px; }
.vote-btn { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.06); border: 1px solid var(--card-border); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.82rem; cursor: pointer; color: var(--text); }
.vote-btn.voted { background: rgba(255,0,85,0.18); color: var(--pink); border-color: rgba(255,0,85,0.4); }
.vote-btn:disabled { cursor: not-allowed; opacity: 0.6; }

/* ---------- Badges ---------- */
.badge-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 0.85rem; margin: 14px 0 6px; color: var(--text-dim); }
input, textarea, select {
  width: 100%; padding: 12px 14px; background: var(--bg-elevated);
  border: 1px solid var(--card-border); color: var(--text); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--pink); }
input[type="color"] { padding: 4px; height: 44px; }
input[type="range"] { padding: 0; }

/* ---------- Tables (admin) ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.88rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--card-border); text-align: left; vertical-align: middle; }
th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; }
tr:hover td { background: rgba(255,255,255,0.02); }
td video { width: 130px; height: 80px; object-fit: cover; border-radius: 8px; background: #000; }

/* ---------- Tabs (admin) ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.tab-btn { padding: 10px 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--card-border); color: var(--text-dim); font-weight: 600; cursor: pointer; font-size: 0.88rem; }
.tab-btn.active { background: var(--gradient); color: #fff; border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Status pills ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.pill-active, .pill-approved, .pill-success { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.pill-pending { background: rgba(255,213,74,0.15); color: var(--gold); }
.pill-closed, .pill-rejected, .pill-failed { background: rgba(239,68,68,0.15); color: #fca5a5; }
.pill-skipped_not_configured { background: rgba(255,255,255,0.08); color: var(--text-dim); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-dim); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 60px 20px 30px; color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Section header ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 50px 0 20px; flex-wrap: wrap; gap: 12px; }

/* ---------- Login providers ---------- */
.login-card { max-width: 380px; margin: 90px auto; text-align: center; }
.provider-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 12px; }

@media (max-width: 860px) {
  .nav-links { display: none; }
}
