/*
Theme Name: My Tube Theme
Description: Premium dark tube theme
Version: 2.0
Author: Copilot
*/

:root {
  --bg-body: #0f0f0f;
  --bg-header: #0f0f0f;
  --bg-search: #121212;
  --bg-card: transparent;
  --text-main: #f1f1f1;
  --text-sec: #aaaaaa;
  --accent: #f6a300; /* Gold/Orange */
  --accent-hover: #ffb700;
  --border-color: #2a2a2a;
  --font-base:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-base);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
}

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

.header-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.site-logo .logo-text {
  color: var(--accent);
  margin-right: 1px;
}

/* Search */
.header-search {
  flex: 1;
  max-width: 600px;
  margin: 0 20px;
}

.search-form {
  display: flex;
  background: #121212;
  border: 1px solid #303030;
  border-radius: 20px;
  overflow: hidden;
}

.search-form:focus-within {
  border-color: #1c62b9; /* YouTube-ish blue focus or use accent */
}

.search-field {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.search-submit {
  background: #222;
  border: none;
  border-left: 1px solid #303030;
  color: #aaa;
  width: 60px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-submit:hover {
  background: #303030;
  color: #eee;
}

/* Nav */
.top-nav {
  display: flex;
  align-items: center;
}

.menu {
  display: flex;
  list-style: none;
  gap: 24px;
  width: 100%;
}

.menu a {
  font-weight: 500;
  font-size: 14px;
  color: #ddd;
}

.menu a:hover {
  color: #fff;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 768px) {
  .header-search {
    display: none;
  }

  .top-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .top-nav.active {
    max-height: 400px;
  }

  .menu {
    flex-direction: column;
    gap: 0;
    padding: 0 24px;
  }

  .menu a {
    display: block;
    padding: 12px 0;
  }

  .menu-toggle {
    display: flex;
  }
}

/* Main Grid */
.site-main {
  padding-top: 24px;
  padding-bottom: 40px;
}

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

@media (min-width: 1200px) {
  .video-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .video-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Video Card */
.video-item {
  cursor: pointer;
}

.video-thumb-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #1a1a1a;
}

.video-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

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

.video-details {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-meta-info {
  color: var(--text-sec);
  font-size: 13px;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Pagination */
.pagination {
  margin-top: 40px;
  text-align: center;
}

.pagination ul,
.pagination .page-numbers {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination li {
  display: inline-block;
  list-style: none;
}

.pagination span {
  display: inline-block;
  padding: 8px 14px;
  background: #222;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  min-width: 40px;
  text-align: center;
  transition: background 0.2s;
}

.pagination .current,
.pagination span.current {
  background: var(--accent) !important;
  color: #000 !important;
  font-weight: 600;
}

.pagination .dots {
  background: transparent !important;
  color: var(--text-sec) !important;
}

.pagination .mobile-text {
  display: none;
}

/* Mobile pagination adjustments */
@media (max-width: 768px) {
  .pagination {
    margin-top: 30px;
  }

  .pagination a,
  .pagination span {
    font-size: 14px;
    min-width: auto;
  }

  .pagination ul,
  .pagination .page-numbers {
    gap: 6px;
  }

  /* Hide all page numbers on mobile except prev, next, and current */
  .pagination li {
    display: none !important;
  }

  .pagination li:has(.prev),
  .pagination li:has(.next),
  .pagination li:has(.current) {
    display: inline-block !important;
  }

  /* Switch to mobile text */
  .pagination .desktop-text {
    display: none;
  }

  .pagination .mobile-text {
    display: inline;
  }
}

/* Single Page */
.single-post {
  padding-bottom: 40px;
}

.single-post .video-player {
  margin: 0 auto 24px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  max-width: 100%;
}

.single-post .video-player video {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
}

.single-post .video-content {
  margin-bottom: 20px;
}

.single-post .video-content h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.meta {
  color: var(--text-sec);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.meta a {
  color: var(--text-sec);
}

.meta a:hover {
  color: var(--accent);
}

.meta-taxonomies {
  margin-top: 8px;
  margin-bottom: 12px;
}

.meta-taxonomies span {
  display: inline-block;
  margin-right: 20px;
  color: var(--text-sec);
  font-size: 14px;
}

.meta-taxonomies a {
  color: var(--accent);
  font-weight: 500;
}

.meta-taxonomies a:hover {
  color: var(--accent-hover);
}

.description {
  margin: 20px 0;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.6;
}

.tags {
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-sec);
}

.tags a {
  color: var(--accent);
  margin-right: 8px;
}

.tags a:hover {
  color: var(--accent-hover);
}

.single-post .related-section {
  margin-top: 0;
  padding-top: 20px;
  border-top: 2px solid var(--border-color);
}

.single-post .related-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

.single-post .related-section .video-grid {
  margin: 0;
}

@media (max-width: 768px) {
  .single-post .video-content h1 {
    font-size: 20px;
  }

  .meta-taxonomies span {
    display: block;
    margin-bottom: 8px;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid #222;
  padding: 40px 0;
  margin-top: 60px;
  text-align: center;
  color: #666;
}

.page-article {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px;
  border-radius: 8px;
}

.page-article h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #fff;
}

.page-content-area {
  line-height: 1.8;
  color: #ddd;
}

.page-content-area h2 {
  font-size: 1.8rem;
  margin-top: 30px;
  margin-bottom: 15px;
  color: #fff;
}

.page-content-area h3 {
  font-size: 1.4rem;
  margin-top: 25px;
  margin-bottom: 12px;
  color: #fff;
}

.page-content-area p {
  margin-bottom: 15px;
}

.page-content-area a {
  color: #e50914;
  text-decoration: underline;
}

.page-content-area a:hover {
  color: #f40612;
}

@media (max-width: 768px) {
  .page-article {
    padding: 20px;
  }

  .page-article h1 {
    font-size: 1.8rem;
  }
}
