/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-header: #0a0a0a;
  --text: #e0e0e0;
  --text-muted: #999;
  --accent: #ff3366;
  --accent-hover: #ff5c85;
  --border: #2a2a2a;
  --radius: 8px;
  --max-width: 1400px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ========== Header ========== */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: -0.5px;
}

/* ========== Search ========== */
.search-box {
  flex: 1;
  display: flex;
  max-width: 500px;
}

.search-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.search-input:focus { border-color: var(--accent); }

.search-btn {
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 14px;
}

/* ========== Language Selector ========== */
.lang-selector { position: relative; }
.lang-current {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 12px; cursor: pointer; font-size: 13px;
  white-space: nowrap;
}

.lang-current:hover { border-color: var(--accent); }

.flag-icon { width: 20px; height: 14px; border-radius: 2px; }
.arrow { font-size: 10px; color: var(--text-muted); }

.lang-dropdown {
  display: none;
  position: absolute; top: 100%; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 180px;
  max-height: 360px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
}

.lang-dropdown.open { display: block; }

.lang-option {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px;
  transition: background 0.15s;
}

.lang-option:hover { background: rgba(255,51,102,0.15); }
.lang-option.active { color: var(--accent); font-weight: 600; }

/* ========== Breadcrumbs ========== */
.breadcrumbs {
  max-width: var(--max-width); margin: 0 auto;
  padding: 10px 20px; font-size: 13px; color: var(--text-muted);
  display: flex; gap: 6px;
}

.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span::before { content: '/'; margin-right: 6px; }
.breadcrumbs a:first-child::before { content: ''; margin: 0; }

/* ========== Main ========== */
.site-main { max-width: var(--max-width); margin: 0 auto; padding: 20px; }

/* ========== Hero ========== */
.hero { text-align: center; padding: 30px 0 10px; }
.hero h1 { font-size: 28px; font-weight: 700; color: var(--text); }

/* ========== Section Title ========== */
.section-title {
  font-size: 20px; font-weight: 700;
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ========== Category Grid ========== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.cat-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16/9; background: var(--bg-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(255,51,102,0.2); }

.cat-thumb { width: 100%; height: 100%; position: relative; }
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cat-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.8));
  display: flex; align-items: flex-end; padding: 16px;
}

.cat-name {
  font-size: 20px; font-weight: 700; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* ========== Video Grid ========== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.video-card {
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.2s;
}

.video-card:hover { transform: translateY(-3px); }

.video-thumb { position: relative; aspect-ratio: 16/9; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }

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

.video-info { padding: 10px 12px; }

.video-title {
  font-size: 14px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 4px;
}

.video-views { font-size: 12px; color: var(--text-muted); }

/* ========== Category Header ========== */
.category-header { margin-bottom: 24px; }
.category-header h1 { font-size: 28px; font-weight: 700; }
.category-header p { color: var(--text-muted); margin-top: 4px; }

/* ========== Detail Page ========== */
.video-detail { margin-bottom: 32px; }

.player-wrapper {
  background: #000; border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px;
  aspect-ratio: 16/9;
}

.video-player { width: 100%; height: 100%; }

.video-meta { padding: 0 4px; }

.video-detail-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }

.video-stats {
  display: flex; gap: 16px; align-items: center;
  color: var(--text-muted); font-size: 14px;
}

.video-category-tag {
  background: var(--accent); color: #fff;
  padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}

.video-category-tag:hover { background: var(--accent-hover); }

/* ========== Related ========== */
.related-section { margin-top: 40px; }
.related-grid { margin-top: 16px; }

/* ========== Pagination ========== */
.pagination {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 32px;
}

.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg-card); border-radius: var(--radius);
  font-size: 14px; transition: background 0.15s;
}

.page-link:hover { background: var(--border); }
.page-link.active { background: var(--accent); color: #fff; font-weight: 700; }

/* ========== Footer ========== */
.site-footer {
  text-align: center; padding: 24px;
  color: var(--text-muted); font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .search-box { order: 3; max-width: 100%; flex: 100%; }
  .logo { font-size: 18px; }

  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .hero h1 { font-size: 20px; }
  .video-detail-title { font-size: 18px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .cat-grid, .video-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* ========== Category Placeholder ========== */
.cat-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
