﻿:root {
  color-scheme: light dark;
  --bg: #f3f5ff;
  --bg-dark: #10131f;
  --card: rgba(255, 255, 255, 0.72);
  --card-dark: rgba(17, 20, 33, 0.82);
  --text: #1e2436;
  --text-dark: #f2f5ff;
  --muted: #6a7388;
  --muted-dark: #9aa4be;
  --accent: #4c6fff;
  --accent-2: #6d8bff;
  --border: rgba(112, 132, 211, 0.25);
  --shadow: 0 24px 60px rgba(45, 62, 115, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at 15% 15%, #dbe4ff 0%, var(--bg) 45%, #eaf0ff 100%);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(720px, 100%);
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(76, 111, 255, 0.16);
  color: #2d47b8;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
}

h1 {
  margin: 14px 0 8px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1;
}

.subtitle {
  margin: 0 0 22px;
  color: var(--muted);
}

.video-section {
  margin: 0 0 22px;
}

.user-section {
  margin: 0 0 22px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

h2 {
  margin: 0;
  font-size: 20px;
}

.muted-note {
  font-size: 12px;
  color: var(--muted);
}

.json-view {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  max-height: 260px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.video-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.video-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 62, 115, 0.2);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #10131f;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
}

.play-icon::before {
  content: "";
  border-left: 12px solid white;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  margin-left: 3px;
}

.duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
}

.video-meta {
  padding: 10px;
}

.video-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.checkbox-row span {
  font-size: 14px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 111, 255, 0.16);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
}

.btn-secondary {
  background: #e7ecff;
  color: #233572;
}

.btn-ghost {
  background: transparent;
  color: #2f478e;
  border: 1px dashed rgba(59, 88, 187, 0.45);
}

@media (prefers-color-scheme: dark) {
  body {
    background: radial-gradient(circle at 15% 15%, #1d2748 0%, var(--bg-dark) 55%, #0d111e 100%);
    color: var(--text-dark);
  }

  .card {
    background: var(--card-dark);
  }

  .badge {
    color: #c7d5ff;
    background: rgba(111, 141, 255, 0.2);
  }

  .subtitle,
  .muted-note,
  .field span,
  .checkbox-row span {
    color: var(--muted-dark);
  }

  .video-card {
    background: rgba(18, 25, 42, 0.68);
  }

  .json-view {
    background: rgba(18, 25, 42, 0.78);
  }

  input,
  textarea {
    background: rgba(18, 25, 42, 0.85);
    color: var(--text-dark);
  }

  .btn-secondary {
    background: rgba(106, 132, 236, 0.2);
    color: #c5d4ff;
  }

  .btn-ghost {
    color: #c8d5ff;
    border-color: rgba(139, 163, 255, 0.5);
  }
}
