/*
Theme Name: Movie16 YouTube
Theme URI: https://www.movie16.online
Author: Movie16 Team
Author URI: https://www.movie16.online
Description: A YouTube-style custom streaming site theme built specifically for Movie16.online
Version: 2.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.2
Text Domain: movie16
*/

:root {
  --yt-bg: #0f0f0f;
  --yt-surface: #272727;
  --yt-surface-hover: #3f3f3f;
  --yt-text-primary: #f1f1f1;
  --yt-text-secondary: #aaaaaa;
  --yt-border: #3f3f3f;
  --yt-brand: #ff0000;
  
  --header-height: 56px;
  --sidebar-width: 240px;
  --font-main: 'Roboto', 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--yt-bg);
  color: var(--yt-text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #717171; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }

/* HEADER */
.yt-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--yt-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.yt-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.yt-menu-btn {
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.yt-menu-btn:hover { background-color: var(--yt-surface); }

.yt-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.yt-header-center {
  flex: 0 1 720px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.yt-search-form {
  display: flex;
  flex: 1;
  align-items: center;
  height: 40px;
}

.yt-search-input {
  flex: 1;
  height: 100%;
  background-color: #121212;
  border: 1px solid var(--yt-border);
  border-radius: 40px 0 0 40px;
  padding: 0 16px;
  color: var(--yt-text-primary);
  font-size: 1rem;
}
.yt-search-input:focus {
  outline: none;
  border-color: #1c62b9;
}

.yt-search-btn {
  height: 100%;
  padding: 0 20px;
  background-color: var(--yt-surface);
  border: 1px solid var(--yt-border);
  border-left: none;
  border-radius: 0 40px 40px 0;
}
.yt-search-btn:hover { background-color: var(--yt-surface-hover); }

.yt-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.yt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

/* LAYOUT */
.yt-layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* SIDEBAR */
.yt-sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  background-color: var(--yt-bg);
  padding: 12px;
  overflow-y: auto;
}

.yt-nav-link {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}
.yt-nav-link:hover, .yt-nav-link.active {
  background-color: var(--yt-surface);
}

.yt-sidebar-divider {
  height: 1px;
  background-color: var(--yt-border);
  margin: 12px 0;
}

/* MAIN CONTENT */
.yt-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
}

/* CATEGORY PILLS */
.yt-pills {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.yt-pills::-webkit-scrollbar { height: 4px; display: none; }
.yt-pill {
  padding: 6px 12px;
  background-color: var(--yt-surface);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.yt-pill:hover, .yt-pill.active {
  background-color: var(--yt-text-primary);
  color: var(--yt-bg);
}

/* VIDEO GRID */
.yt-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px 16px;
}

.yt-video-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

.yt-thumbnail-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--yt-surface);
}

.yt-thumbnail-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.yt-video-card:hover .yt-thumbnail-wrapper img {
  transform: scale(1.05);
}

.yt-video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 3px 4px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.yt-video-info-wrapper {
  display: flex;
  gap: 12px;
}

.yt-channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--yt-brand);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.yt-video-text {
  display: flex;
  flex-direction: column;
}

.yt-video-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yt-video-meta {
  font-size: 0.875rem;
  color: var(--yt-text-secondary);
}

/* SINGLE VIDEO PLAYER */
.yt-watch-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  max-width: 1800px;
  margin: 0 auto;
}
@media (max-width: 1000px) {
  .yt-watch-layout {
    grid-template-columns: 1fr;
  }
}

.yt-player-container {
  width: 100%;
  position: relative;
  padding-bottom: 56.25%;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.yt-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.yt-watch-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 12px;
}

.yt-watch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.yt-watch-channel {
  display: flex;
  align-items: center;
  gap: 12px;
}
.yt-watch-subscribe {
  background-color: var(--yt-text-primary);
  color: var(--yt-bg);
  padding: 10px 16px;
  border-radius: 20px;
  font-weight: 500;
  margin-left: 12px;
}
.yt-watch-subscribe:hover { opacity: 0.9; }

.yt-watch-buttons {
  display: flex;
  gap: 8px;
}
.yt-watch-btn {
  background-color: var(--yt-surface);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}
.yt-watch-btn:hover { background-color: var(--yt-surface-hover); }

.yt-watch-description {
  background-color: var(--yt-surface);
  padding: 12px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* COMPACT VIDEO CARD (FOR RELATED VIDEOS) */
.yt-compact-video {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.yt-compact-thumb {
  width: 168px;
  height: 94px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background-color: var(--yt-surface);
  flex-shrink: 0;
}
.yt-compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.yt-compact-info {
  display: flex;
  flex-direction: column;
}
.yt-compact-title {
  font-size: 0.875rem;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.yt-compact-meta {
  font-size: 0.75rem;
  color: var(--yt-text-secondary);
}

/* PAGINATION */
.yt-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}
.yt-pagination a, .yt-pagination button {
  padding: 10px 20px;
  background-color: var(--yt-surface);
  border-radius: 20px;
  font-weight: 500;
}
.yt-pagination a:hover { background-color: var(--yt-surface-hover); }
.yt-pagination button[disabled] { opacity: 0.5; cursor: not-allowed; }

/* RESPONSIVE */
/* Large Tablets & Small Desktops */
@media (max-width: 1200px) {
  .yt-video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* Tablets */
@media (max-width: 1000px) {
  .yt-watch-layout {
    grid-template-columns: 1fr;
  }
  .yt-watch-secondary {
    margin-top: 24px;
  }
  .yt-compact-video {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* Small Tablets & Large Phones */
@media (max-width: 800px) {
  .yt-sidebar {
    display: none;
  }
  .yt-main {
    margin-left: 0;
    padding: 16px;
  }
  .yt-header-center {
    flex: 1;
    margin: 0 16px;
  }
}

/* Mobile Phones */
@media (max-width: 600px) {
  .yt-video-grid {
    grid-template-columns: 1fr;
    gap: 24px 0;
  }
  .yt-main {
    padding: 16px 0;
  }
  .yt-thumbnail-wrapper {
    border-radius: 0;
  }
  .yt-video-info-wrapper {
    padding: 0 16px;
  }
  .yt-pills {
    padding: 0 16px;
  }
  
  /* Header Adjustments */
  .yt-header {
    padding: 0 8px;
  }
  .yt-header-left {
    gap: 4px;
  }
  .yt-header-center {
    margin: 0 8px;
  }
  .yt-search-input {
    width: 100%;
    padding: 0 12px;
  }
  .yt-search-btn {
    padding: 0 12px;
  }
  .yt-header-right {
    gap: 4px;
  }
  .yt-header-right > .yt-menu-btn {
    display: none; /* Hide Create & Notifications on small mobile */
  }
  
  /* Watch Page Adjustments */
  .yt-player-container {
    border-radius: 0;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
  }
  .yt-watch-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .yt-watch-buttons {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .yt-watch-btn {
    white-space: nowrap;
  }
  
  /* Compact Videos for Mobile */
  .yt-compact-thumb {
    width: 120px;
    height: 68px;
  }
}