/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0f1115;
  color: #e6e8ee;
  line-height: 1.5;
}
a { color: #6aa7ff; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ─── HEADER ───────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #151821;
  border-bottom: 1px solid #252836;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.brand:hover { text-decoration: none; }

.search-form {
  flex: 1;
  display: flex;
  gap: 8px;
  max-width: 600px;
}
.search-form input {
  flex: 1;
  padding: 9px 14px;
  font-size: 15px;
  background: #0f1115;
  color: #e6e8ee;
  border: 1px solid #2a2f3d;
  border-radius: 20px;
}
.search-form input:focus { outline: 2px solid #6aa7ff; outline-offset: -1px; }
.search-form button {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
}
.search-form button:hover { background: #1d4ed8; }

/* ─── MAIN ─────────────────────────────────────────────────── */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 16px; color: #9aa3b2; font-weight: 600; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { margin: 0; }
.link-btn {
  background: transparent;
  border: 0;
  color: #6aa7ff;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
}
.link-btn:hover { text-decoration: underline; }

/* ─── VIDEO GRID ───────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.video-card {
  background: #1a1d27;
  border: 1px solid #252836;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
}
.video-card:hover {
  transform: translateY(-2px);
  border-color: #3a4152;
  text-decoration: none;
}
.video-card .thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.video-card .duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.video-card .info { padding: 12px 14px 14px; }
.video-card .title {
  font-size: 15px;
  font-weight: 600;
  color: #e6e8ee;
  margin: 0 0 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card .card-meta {
  font-size: 13px;
  color: #9aa3b2;
  display: flex;
  gap: 10px;
}

/* ─── WATCH PAGE ───────────────────────────────────────────── */
.watch-main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .watch-main { grid-template-columns: 1fr; }
}
.watch video {
  width: 100%;
  max-height: 70vh;
  background: #000;
  border-radius: 10px;
}
.watch h1 { margin-top: 20px; }
.meta {
  display: flex;
  gap: 14px;
  font-size: 14px;
  color: #9aa3b2;
  margin-bottom: 14px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.tag {
  background: #252836;
  color: #c0c8d7;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
}
.description {
  white-space: pre-wrap;
  color: #c0c8d7;
  background: #1a1d27;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #252836;
}

.related .video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.related .video-card .thumb-wrap { aspect-ratio: 16 / 9; }

/* ─── STATUS & FOOTER ──────────────────────────────────────── */
.status {
  background: #1a1d27;
  border: 1px solid #252836;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  color: #9aa3b2;
}
.status.error { border-color: #7f1d1d; color: #fca5a5; }
footer {
  max-width: 1400px;
  margin: 40px auto 0;
  padding: 20px;
  border-top: 1px solid #252836;
  color: #6e778a;
  font-size: 13px;
  text-align: center;
}
