/*
Theme Name: RetroTube Lite
Theme URI: https://github.com/razifijazi
Author: Razifi
Author URI: https://github.com/razifijazi
Description: Dark video streaming WordPress theme inspired by RetroTube. Grid layout, video player, sidebar ads support.
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: retrotube-lite
Tags: dark, video, streaming, grid, responsive
*/

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

:root {
  --accent: #FF3565;
  --accent-dark: #cc1a47;
  --bg: #0d0d0d;
  --bg2: #1a1a1a;
  --bg3: #222222;
  --nav-bg: #151515;
  --card-bg: #1a1a1a;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-muted: #888888;
  --text-dark: #555555;
  --white: #ffffff;
  --font: 'Open Sans', sans-serif;
  --radius: 4px;
  --radius-lg: 8px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* =====================
   CONTAINER
   ===================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

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

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo span { color: var(--accent); }
.site-logo img { max-height: 36px; width: auto; }

.header-search {
  flex: 1;
  max-width: 500px;
}

.header-search form {
  display: flex;
  background: var(--bg3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.header-search input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.header-search input[type="text"]::placeholder { color: var(--text-muted); }

.header-search button {
  padding: 10px 16px;
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--white);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}

.header-search button:hover { background: var(--accent-dark); }

/* =====================
   NAVIGATION
   ===================== */
.site-nav {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav ul li {
  position: relative;
}

.site-nav ul li a {
  display: block;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.site-nav ul li a:hover {
  color: var(--white);
  border-bottom-color: var(--accent);
}

.site-nav ul li.current-menu-item > a,
.site-nav ul li.current-menu-ancestor > a {
  color: var(--white);
  border-bottom-color: var(--accent);
}

/* =====================
   CONTENT AREA
   ===================== */
.content-area {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  gap: 20px;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* =====================
   SECTION TITLE
   ===================== */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

/* =====================
   VIDEO GRID
   ===================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

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

.video-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.video-thumb {
  position: relative;
  display: block;
  padding-bottom: 56.25%;
  background: var(--bg3);
  overflow: hidden;
}

.video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.video-item:hover .video-thumb img {
  transform: scale(1.05);
}

.video-info {
  padding: 10px;
}

.video-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-title a { color: inherit; }
.video-title a:hover { color: var(--accent); }

.video-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.video-meta:empty { display: none; }
.video-meta .views { color: var(--text-muted); }
.video-meta .date { color: var(--text-muted); }
.video-meta .separator { color: var(--text-dark); }

/* =====================
   VIDEO PLAYER PAGE
   ===================== */
.video-player-page {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.player-container {
  position: relative;
  background: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  padding: 16px;
  line-height: 1.4;
}

.player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 16px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.player-description {
  padding: 0 16px 16px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

/* =====================
   RELATED VIDEOS
   ===================== */
.related-section {
  margin-top: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.related-item {
  display: flex;
  gap: 10px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 8px;
  transition: background 0.2s;
}

.related-item:hover {
  background: var(--bg3);
}

.related-thumb {
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg3);
}

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

.related-info {
  flex: 1;
  min-width: 0;
}

.related-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.related-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  width: 280px;
  flex-shrink: 0;
}

.widget {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.widget ul li {
  border-bottom: 1px solid var(--border);
}

.widget ul li:last-child {
  border-bottom: none;
}

.widget ul li a {
  display: block;
  padding: 8px 0;
  color: var(--text);
  font-size: 0.85rem;
  transition: color 0.2s, padding-left 0.2s;
}

.widget ul li a:hover {
  color: var(--accent);
  padding-left: 4px;
}

/* =====================
   CATEGORIES
   ===================== */
.category-section {
  margin-bottom: 32px;
}

.category-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.category-title a { color: inherit; }
.category-title a:hover { color: var(--accent); }

/* =====================
   PAGINATION
   ===================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 24px 0;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.pagination a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  padding: 24px 16px;
  margin-top: 32px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =====================
   ADS
   ===================== */
.ad-container {
  margin-bottom: 16px;
}

.ad-container img {
  border-radius: var(--radius);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 1023px) {
  .content-area {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .site-nav ul li a {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .header-search {
    max-width: 100%;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .related-item {
    flex-direction: column;
  }

  .related-thumb {
    width: 100%;
  }
}

/* =====================
   PLAYER INFO EXTRA
   ===================== */
.player-info {
  padding: 0;
}

.player-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.player-meta .meta-item i {
  color: var(--accent);
  font-size: 0.8rem;
}

.player-meta .category-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg3);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 4px;
  transition: background 0.2s;
}

.player-meta .category-tag:hover {
  background: var(--accent);
  color: var(--white);
}

.player-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg3);
  color: var(--text-muted);
  font-size: 1rem;
}

/* =====================
   SIDEBAR VIDEO GRID (2x3)
   ===================== */
.sidebar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-video-item {
  flex: 0 0 calc(50% - 4px);
  max-width: calc(50% - 4px);
  text-decoration: none;
  box-sizing: border-box;
}

.sidebar-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 4px;
}

.sidebar-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.sidebar-video-item:hover .sidebar-thumb img {
  transform: scale(1.05);
}

.sidebar-video-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-video-item:hover .sidebar-video-title {
  color: var(--accent);
}

/* =====================
   VIEW ALL LINK
   ===================== */
.category-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-all-link {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.view-all-link:hover {
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
}

/* =====================
   VIEW ALL WRAPPER
   ===================== */
.view-all-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  margin-bottom: 16px;
}

/* =====================
   FOOTER BOTTOM
   ===================== */
.footer-bottom {
  text-align: center;
  margin-top: 16px;
}

.footer-bottom p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* =====================
   AD BANNERS
   ===================== */
.rtl-ad-banner {
  margin: 16px 0;
  text-align: center;
}

.rtl-ad-banner img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.rtl-ad-sidebar_top,
.rtl-ad-sidebar_bottom {
  margin: 12px 0;
}

.rtl-ad-after_cat_1,
.rtl-ad-after_cat_2,
.rtl-ad-after_cat_3 {
  margin: 24px 0;
  padding: 0;
}
