/* ============================================================
   NextScout — dashboard.css
   Player dashboard — dark theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-light: #22c55e;
  --green-dim: rgba(22, 163, 74, 0.12);
  --black: #000000;
  --bg: #0c0c0c;
  --bg-card: #141414;
  --bg-card2: #1a1a1a;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --gray-600: #3d3d3d;
  --gray-400: #6b6b6b;
  --gray-300: #9a9a9a;
  --gray-200: #d4d4d4;
  --white: #ffffff;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --transition: 0.18s ease;
}

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; font-family: var(--font-body); }
img { display: block; max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.dash-topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.dash-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.dash-logo-next { color: var(--white); }
.dash-logo-scout {
  color: var(--black);
  background: var(--green);
  padding: 1px 6px;
  margin-left: 1px;
  border-radius: 3px;
}
.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-selector-dash {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(255,255,255,0.04);
  border-radius: 7px;
  border: 1px solid var(--border);
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  transition: all var(--transition);
  letter-spacing: 0.04em;
  background: none;
}
.lang-btn:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.lang-btn.active { background: var(--green); color: var(--white); }
.lang-btn .flag { font-size: 0.9rem; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-plan-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--green);
  color: var(--green);
}
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--white);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.topbar-avatar:hover { border-color: var(--green); }

/* ── Sidebar ──────────────────────────────────────────────────── */
.dash-sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: 16px 12px 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  transition: all var(--transition);
  cursor: pointer;
}
.sidebar-link svg { flex-shrink: 0; }
.sidebar-link:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: var(--white); background: rgba(255,255,255,0.07); }
.sidebar-link.active svg { color: var(--green); }
.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sidebar-upgrade {
  background: var(--green-dim);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.sidebar-upgrade p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
  line-height: 1.5;
}
.sidebar-upgrade .btn-upgrade {
  width: 100%;
  padding: 8px;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background var(--transition);
}
.sidebar-upgrade .btn-upgrade:hover { background: var(--green-dark); }

/* ── Main content ─────────────────────────────────────────────── */
.dash-main {
  padding: 32px;
  overflow-y: auto;
}

/* ── Welcome bar ─────────────────────────────────────────────── */
.dash-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.dash-welcome-text h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.dash-welcome-text h1 span { color: var(--green); }
.dash-welcome-text p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
}
.dash-welcome-actions { display: flex; gap: 8px; }

/* ── Stats cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-delta {
  font-size: 0.75rem;
  color: var(--green-light);
}
.stat-delta.neutral { color: rgba(255,255,255,0.3); }

/* ── Content grid ─────────────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

/* ── Profile completion ───────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.card-action {
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 500;
  transition: opacity var(--transition);
}
.card-action:hover { opacity: 0.75; }

/* Progress bar */
.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  height: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  border-radius: 100px;
  transition: width 1s ease;
}
.progress-pct {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green);
}
.profile-tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.profile-task {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}
.profile-task:hover { border-color: var(--border-hover); color: var(--white); }
.profile-task.done { color: rgba(255,255,255,0.3); }
.profile-task.done .task-check { color: var(--green); }
.task-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-task.done .task-check {
  border-color: var(--green);
  background: var(--green-dim);
}

/* ── Videos card ─────────────────────────────────────────────── */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.video-slot {
  aspect-ratio: 9/16;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.3);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}
.video-slot:hover { border-color: var(--green); color: var(--green); }
.video-slot svg { transition: transform var(--transition); }
.video-slot:hover svg { transform: scale(1.15); }
.video-slot.has-video {
  border: none;
  background: var(--bg-card2);
}
.video-slot.has-video img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.video-slot.has-video:hover .video-play-overlay { opacity: 1; }

/* ── Plan card sidebar ─────────────────────────────────────────── */
.plan-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.plan-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.plan-info-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--green);
}
.plan-limits { display: flex; flex-direction: column; gap: 12px; }
.plan-limit-item { display: flex; flex-direction: column; gap: 6px; }
.plan-limit-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  display: flex;
  justify-content: space-between;
}
.plan-limit-label span { color: rgba(255,255,255,0.65); }
.plan-limit-bar {
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  height: 5px;
  overflow: hidden;
}
.plan-limit-fill {
  height: 100%;
  background: var(--green);
  border-radius: 100px;
}
.btn-upgrade-full {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition);
}
.btn-upgrade-full:hover { background: var(--green-dark); }

/* ── Activity feed ─────────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  margin-top: 6px;
}
.activity-dot.blue { background: #3b82f6; }
.activity-dot.yellow { background: #eab308; }
.activity-text { font-size: 0.85rem; color: rgba(255,255,255,0.6); line-height: 1.5; }
.activity-time { font-size: 0.75rem; color: rgba(255,255,255,0.2); margin-top: 2px; }

/* ── Profile form section ─────────────────────────────────────── */
.profile-section { display: none; }
.profile-section.active { display: block; }
.form-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-section-title:first-child { margin-top: 0; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--white);
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--green); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,0.18); }
.form-group select { appearance: none; cursor: pointer; }
.form-group select option { background: #1a1a1a; }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
}
.form-checkbox input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }
.btn-save {
  padding: 12px 28px;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background var(--transition);
}
.btn-save:hover { background: var(--green-dark); }
.save-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.save-msg { font-size: 0.85rem; color: var(--green-light); opacity: 0; transition: opacity 0.3s; }
.save-msg.visible { opacity: 1; }

/* ── Tabs ─────────────────────────────────────────────────────── */
.dash-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
}
.dash-tab {
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  transition: all var(--transition);
  background: none;
}
.dash-tab:hover { color: rgba(255,255,255,0.8); }
.dash-tab.active {
  background: var(--bg-card);
  color: var(--white);
  border: 1px solid var(--border);
}

/* ── Loading overlay ─────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dash-layout { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  .dash-sidebar { display: none; }
  .dash-main { padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .form-row { grid-template-columns: 1fr; }
  .dash-tabs { width: 100%; overflow-x: auto; }
}
