/* ===================================
   VideoCMS Default Template - CSS
   Dark theme, modern design
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:       #0a0a0f;
  --surface:  #13131a;
  --surface2: #1c1c28;
  --border:   #2a2a3a;
  --text:     #e8e8f0;
  --muted:    #6b6b80;
  --accent:   #7c6fff;
  --accent2:  #ff6b9d;
  --success:  #22c55e;
  --danger:   #ef4444;
  --thumb-ratio: 56.25%; /* 16:9 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- HEADER ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 1300px; margin: 0 auto;
  padding: 0 16px; height: 58px;
  display: flex; align-items: center; gap: 24px;
}
.site-logo {
  font-size: 20px; font-weight: 700; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}
.header-nav { display: flex; gap: 2px; }
.header-nav a { padding: 6px 12px; border-radius: 6px; font-size: 13px; color: var(--muted); transition: all 0.2s; }
.header-nav a:hover, .header-nav a.active { background: var(--surface2); color: var(--text); }

.search-form { flex: 1; max-width: 400px; margin-left: auto; display: flex; }
.search-form input {
  flex: 1; padding: 8px 14px; background: var(--surface2);
  border: 1px solid var(--border); border-right: none;
  border-radius: 8px 0 0 8px; color: var(--text); font-size: 13px;
}
.search-form input:focus { outline: none; border-color: var(--accent); }
.search-form button {
  padding: 8px 14px; background: var(--accent); color: #fff;
  border: none; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 14px;
}

/* ---- LAYOUT ---- */
.container { max-width: 1300px; margin: 0 auto; padding: 0 16px; }
.page-content { padding: 24px 0; min-height: calc(100vh - 58px - 60px); }

/* ---- SECTION HEADER ---- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; display: block; width: 3px; height: 18px; background: linear-gradient(var(--accent), var(--accent2)); border-radius: 2px; }
.view-all { font-size: 12px; color: var(--muted); padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px; transition: all 0.2s; }
.view-all:hover { border-color: var(--accent); color: var(--accent); }

/* ---- VIDEO GRID ---- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.video-card { background: var(--surface); border-radius: 10px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.video-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }
.video-thumb { position: relative; padding-top: var(--thumb-ratio); overflow: hidden; background: var(--surface2); }
.video-thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.video-card:hover .video-thumb img { transform: scale(1.05); }
.video-thumb .duration { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.8); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.video-thumb .quality { position: absolute; top: 6px; right: 6px; background: var(--accent); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 700; }
.video-thumb .play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0); background: rgba(124,111,255,0.9); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: transform 0.2s; }
.video-card:hover .play-btn { transform: translate(-50%,-50%) scale(1); }
.video-info { padding: 10px 12px; }
.video-title { font-size: 13px; font-weight: 500; line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.2s; }
.video-card:hover .video-title { color: var(--accent); }
.video-meta { display: flex; gap: 10px; font-size: 11px; color: var(--muted); }
.video-meta span { display: flex; align-items: center; gap: 3px; }

/* ---- NICHE GRID ---- */
.niche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.niche-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  transition: all 0.2s;
}
.niche-card:hover { border-color: var(--accent); background: var(--surface2); }
.niche-name { font-size: 13px; font-weight: 500; }
.niche-count { font-size: 11px; color: var(--muted); }

/* ---- PAGINATION ---- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; transition: all 0.2s; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ---- VIDEO PAGE ---- */
.video-page { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 900px) { .video-page { grid-template-columns: 1fr; } }
.video-player { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; width: 100%; }
.video-player iframe, .video-player embed { width: 100%; height: 100%; border: none; }
.video-page-title { font-size: 20px; font-weight: 700; margin: 16px 0 8px; line-height: 1.3; }
.video-page-meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.video-page-meta span { display: flex; align-items: center; gap: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { background: var(--surface2); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-size: 12px; color: var(--muted); transition: all 0.2s; }
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* Sidebar */
.sidebar-widget { background: var(--surface); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.widget-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.related-video { display: flex; gap: 10px; margin-bottom: 12px; }
.related-thumb { width: 96px; height: 60px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--surface2); }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-info .title { font-size: 12px; font-weight: 500; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-info .meta { font-size: 11px; color: var(--muted); }

/* ---- SEARCH ---- */
.search-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 32px 0; margin-bottom: 24px; }
.search-hero .big-search { display: flex; max-width: 600px; margin: 0 auto; }
.search-hero input { flex: 1; padding: 13px 18px; background: var(--bg); border: 2px solid var(--border); border-right: none; border-radius: 10px 0 0 10px; color: var(--text); font-size: 15px; }
.search-hero input:focus { outline: none; border-color: var(--accent); }
.search-hero button { padding: 13px 24px; background: var(--accent); color: #fff; border: none; border-radius: 0 10px 10px 0; font-size: 15px; cursor: pointer; font-weight: 600; }
.search-title { text-align: center; font-size: 15px; color: var(--muted); margin-top: 20px; }

/* ---- SPONSOR BANNER ---- */
.sponsor-banner { text-align: center; margin: 20px 0; }
.sponsor-banner img { max-width: 100%; border-radius: 8px; }

/* ---- 404 ---- */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 .code { font-size: 80px; font-weight: 800; color: var(--surface2); margin-bottom: 16px; }
.page-404 h2 { font-size: 24px; margin-bottom: 8px; }
.page-404 p { color: var(--muted); margin-bottom: 24px; }
.btn-home { display: inline-block; padding: 12px 24px; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 600; }

/* ---- FOOTER ---- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 20px 0; margin-top: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.site-footer a { color: var(--accent); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .niche-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
