/* style.css — single stylesheet, no external font/CDN requests = fastest possible first paint. */

:root {
  --bg: #0f0f10;
  --bg-elevated: #1a1a1c;
  --text: #f2f2f2;
  --text-dim: #a3a3a3;
  --accent: #e63946;
  --accent-hover: #ff4d5e;
  --border: #2b2b2e;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* Big, obvious focus rings — essential for TV remote / keyboard navigation */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, video:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 80px 20px;
  font-size: 1.2rem;
}

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

.video-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.video-card:hover, .video-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.thumb-wrap {
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-sm {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
}
.video-card-body { padding: 14px 16px; }
.video-card-body h2, .video-card-body h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta { margin: 0; color: var(--text-dim); font-size: 0.85rem; }

/* Watch page */
.watch-main { max-width: 1100px; }
.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.player-wrap video { width: 100%; height: auto; display: block; max-height: 80vh; }
.video-title { font-size: 1.6rem; margin: 0 0 6px; }
.video-date { color: var(--text-dim); margin: 0 0 16px; font-size: 0.9rem; }
.video-description { color: var(--text); margin: 0 0 32px; white-space: pre-line; }
.related-heading { font-size: 1.2rem; margin: 0 0 16px; border-top: 1px solid var(--border); padding-top: 24px; }

.site-footer {
  text-align: center;
  color: var(--text-dim);
  padding: 32px;
  font-size: 0.85rem;
}

/* ---- Admin ---- */
.admin-body { background: var(--bg); }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h1 { margin: 0 0 6px; font-size: 1.3rem; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-dim); }
input, textarea, button {
  font-family: inherit;
  font-size: 1rem;
}
input[type="text"], input[type="password"], input[type="file"], textarea {
  background: #0c0c0d;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
}
textarea { resize: vertical; }
button, .link-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 600;
}
button:hover, .link-btn:hover { background: var(--accent-hover); }
.link-btn.danger { background: #444; }
.link-btn.danger:hover { background: #b91c1c; }
.inline-form { display: inline; }
.error { color: #ff6b6b; margin: 0; font-size: 0.9rem; }
.notice { color: #f4a261; margin: 0; font-size: 0.9rem; }
.hint { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 16px; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
}
.admin-header nav a { margin-left: 18px; color: var(--text-dim); }
.admin-header nav a:hover { color: var(--text); }
.admin-main { max-width: 1000px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card h2 { margin: 0 0 6px; font-size: 1.1rem; }
.card form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }

.video-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.video-table th, .video-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.video-table th { color: var(--text-dim); font-weight: 600; }

.progress-wrap {
  background: #0c0c0d;
  border-radius: 6px;
  height: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar {
  background: var(--accent);
  height: 100%;
  width: 0%;
  transition: width 0.15s ease;
}
#uploadProgressText {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
}

/* Large-screen / TV viewing distance adjustments */
@media (min-width: 1600px) {
  .video-card-body h2, .video-card-body h3 { font-size: 1.15rem; }
  .brand { font-size: 1.6rem; }
}
