/*
Theme Name: YouTube Video Theme
Theme URI: https://example.com/youtube-video-theme
Author: Manus AI
Author URI: https://manus.im
Description: A professional, SEO-friendly, and fast-loading WordPress video theme inspired by YouTube.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: video, responsive, custom-background, custom-colors, custom-header, custom-menu, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, translation-ready, two-columns
Text Domain: youtube-video-theme
*/

/* ============================================
   ROOT VARIABLES & GLOBAL STYLES
   ============================================ */

:root {
	/* Primary Colors */
	--color-primary: #ff0000;
	--color-primary-dark: #cc0000;
	--color-primary-light: #ff4444;
	
	/* Dark Mode (Default) */
	--color-bg-dark: #0f0f0f;
	--color-bg-secondary: #1a1a1a;
	--color-bg-tertiary: #272727;
	--color-text-primary: #f1f1f1;
	--color-text-secondary: #aaaaaa;
	--color-border: #303030;
	--color-hover: #3a3a3a;
	
	--font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--transition-speed: 0.2s;
	--max-width: 1280px;
}

/* Light Mode */
body.light-mode {
	--color-bg-dark: #ffffff;
	--color-bg-secondary: #f9f9f9;
	--color-bg-tertiary: #f0f0f0;
	--color-text-primary: #030303;
	--color-text-secondary: #606060;
	--color-border: #e0e0e0;
	--color-hover: #f0f0f0;
}

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

html {
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	background-color: var(--color-bg-dark);
	color: var(--color-text-primary);
	font-family: var(--font-family);
	font-size: 14px;
	line-height: 1.6;
	font-weight: 400;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
	font-weight: 500;
	line-height: 1.2;
	margin-bottom: 0.5em;
}

h1 {
	font-size: 2rem;
}

h2 {
	font-size: 1.75rem;
}

h3 {
	font-size: 1.5rem;
}

h4 {
	font-size: 1.25rem;
}

h5 {
	font-size: 1.1rem;
}

h6 {
	font-size: 1rem;
}

p {
	margin-bottom: 1em;
}

a {
	color: var(--color-primary);
	text-decoration: none;
	transition: color var(--transition-speed) ease;
}

a:hover {
	color: var(--color-primary-dark);
}

/* ============================================
   SITE STRUCTURE
   ============================================ */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1;
	max-width: var(--max-width);
	margin: 0 auto;
	width: 100%;
	padding: 20px;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.site-header {
	background-color: var(--color-bg-secondary);
	border-bottom: 1px solid var(--color-border);
	padding: 15px 20px;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 15px;
}

.site-branding .custom-logo {
	max-width: 40px;
	height: auto;
}

.site-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0;
}

.site-title a {
	color: var(--color-text-primary);
}

.site-description {
	font-size: 0.875rem;
	color: var(--color-text-secondary);
	margin: 0;
}

.main-navigation {
	display: flex;
	align-items: center;
}

.main-navigation ul {
	list-style: none;
	display: flex;
	gap: 30px;
	flex-wrap: wrap;
}

.main-navigation a {
	color: var(--color-text-primary);
	font-weight: 500;
	padding: 8px 0;
	border-bottom: 2px solid transparent;
	transition: border-color var(--transition-speed) ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
	border-bottom-color: var(--color-primary);
}

.theme-toggle {
	background: none;
	border: none;
	color: var(--color-text-primary);
	font-size: 1.3rem;
	cursor: pointer;
	padding: 8px 12px;
	transition: color var(--transition-speed) ease;
	margin-right: 15px;
}

.theme-toggle:hover {
	color: var(--color-primary);
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	color: var(--color-text-primary);
	font-size: 1.5rem;
	cursor: pointer;
	padding: 5px;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
	background-color: var(--color-bg-secondary);
	border-top: 1px solid var(--color-border);
	padding: 30px 20px;
	margin-top: 40px;
	text-align: center;
	color: var(--color-text-secondary);
	font-size: 0.875rem;
}

.site-info {
	max-width: var(--max-width);
	margin: 0 auto;
}

/* ============================================
   VIDEO GRID & CARDS
   ============================================ */

.site-main {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin-bottom: 40px;
}

.video-card {
	background-color: var(--color-bg-secondary);
	border-radius: 8px;
	overflow: hidden;
	transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
	cursor: pointer;
	border: 1px solid var(--color-border);
}

.video-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.video-thumbnail-wrapper {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* 16:9 aspect ratio */
	background-color: var(--color-bg-tertiary);
	overflow: hidden;
}

.video-thumbnail-link {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
}

.video-thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--transition-speed) ease;
}

.video-card:hover .video-thumbnail {
	transform: scale(1.05);
}

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

.video-info {
	padding: 12px;
}

.entry-header {
	margin-bottom: 8px;
}

.entry-title {
	font-size: 1rem;
	font-weight: 500;
	margin: 0;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.entry-title a {
	color: var(--color-text-primary);
}

.entry-title a:hover {
	color: var(--color-primary);
}

.video-meta {
	display: flex;
	gap: 12px;
	font-size: 0.75rem;
	color: var(--color-text-secondary);
	margin-bottom: 8px;
}

.video-views,
.video-date {
	display: flex;
	align-items: center;
	gap: 4px;
}

.entry-content {
	font-size: 0.875rem;
	color: var(--color-text-secondary);
	margin-bottom: 8px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.entry-footer {
	font-size: 0.75rem;
	color: var(--color-text-secondary);
}

.cat-links,
.tags-links {
	display: flex;
	align-items: center;
	gap: 4px;
}

.cat-links a,
.tags-links a {
	color: var(--color-primary);
	font-size: 0.75rem;
	margin-right: 4px;
}

/* ============================================
   SINGLE VIDEO PAGE
   ============================================ */

.single-video {
	width: 100%;
}

.video-player-wrapper {
	width: 100%;
	margin-bottom: 30px;
	border-radius: 8px;
	overflow: hidden;
	background-color: var(--color-bg-secondary);
}

.video-embed-container {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
}

.video-embed-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}

.video-thumbnail-single {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
}

.single-video-info {
	background-color: var(--color-bg-secondary);
	padding: 20px;
	border-radius: 8px;
	border: 1px solid var(--color-border);
}

.single-video-info .entry-header {
	margin-bottom: 15px;
}

.single-video-info .entry-title {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0 0 15px 0;
}

.video-stats {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 0;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 15px;
}

.views-likes {
	display: flex;
	gap: 20px;
}

.single-video-info .entry-content {
	color: var(--color-text-primary);
	-webkit-line-clamp: unset;
	overflow: visible;
	margin-bottom: 20px;
}

.single-video-info .entry-footer {
	padding-top: 15px;
	border-top: 1px solid var(--color-border);
}

/* ============================================
   SIDEBAR
   ============================================ */

.widget-area {
	background-color: var(--color-bg-secondary);
	padding: 20px;
	border-radius: 8px;
	border: 1px solid var(--color-border);
	margin-top: 30px;
}

.widget {
	margin-bottom: 20px;
}

.widget:last-child {
	margin-bottom: 0;
}

.widget-title {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--color-primary);
}

.widget ul {
	list-style: none;
}

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

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

.widget ul li a {
	color: var(--color-text-secondary);
	transition: color var(--transition-speed) ease;
}

.widget ul li a:hover {
	color: var(--color-primary);
}

/* ============================================
   TRENDING VIDEOS SECTION
   ============================================ */

.trending-section {
	margin: 60px 0 40px 0;
}

.section-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 3px solid var(--color-primary);
	color: var(--color-text-primary);
}

.trending-videos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

/* ============================================
   RECOMMENDED VIDEOS SECTION
   ============================================ */

.recommended-section {
	margin-top: 50px;
	padding-top: 30px;
	border-top: 1px solid var(--color-border);
}

.recommended-videos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 15px;
}

.recommended-video-card {
	background-color: var(--color-bg-secondary);
	border-radius: 6px;
	overflow: hidden;
	transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
	border: 1px solid var(--color-border);
}

.recommended-video-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.recommended-thumbnail {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	background-color: var(--color-bg-tertiary);
	overflow: hidden;
}

.recommended-thumbnail img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition-speed) ease;
}

.recommended-video-card:hover .recommended-thumbnail img {
	transform: scale(1.05);
}

.recommended-info {
	padding: 10px;
}

.recommended-title {
	font-size: 0.85rem;
	font-weight: 500;
	margin: 0 0 5px 0;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.recommended-title a {
	color: var(--color-text-primary);
}

.recommended-title a:hover {
	color: var(--color-primary);
}

.recommended-meta {
	font-size: 0.75rem;
	color: var(--color-text-secondary);
}

/* ============================================
   RANDOM TAGS SECTION
   ============================================ */

.random-tags-section {
	margin-top: 30px;
	padding: 20px;
	background-color: var(--color-bg-secondary);
	border-radius: 8px;
	border: 1px solid var(--color-border);
}

.random-tags-title {
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 15px;
	color: var(--color-text-primary);
}

.random-tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.random-tag {
	display: inline-block;
	padding: 6px 12px;
	background-color: var(--color-bg-tertiary);
	border: 1px solid var(--color-border);
	border-radius: 20px;
	color: var(--color-text-secondary);
	font-size: 0.85rem;
	transition: all var(--transition-speed) ease;
}

.random-tag:hover {
	background-color: var(--color-primary);
	border-color: var(--color-primary);
	color: white;
}

.random-tag a {
	color: inherit;
}

/* ============================================
   FLEXIBLE DESCRIPTION
   ============================================ */

.description-wrapper {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.description-content {
	color: var(--color-text-primary);
	line-height: 1.6;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.description-content p {
	margin-bottom: 10px;
}

.description-content p:last-child {
	margin-bottom: 0;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 40px 0;
	flex-wrap: wrap;
}

.page-numbers {
	padding: 8px 12px;
	background-color: var(--color-bg-secondary);
	border: 1px solid var(--color-border);
	border-radius: 4px;
	color: var(--color-text-primary);
	transition: all var(--transition-speed) ease;
}

.page-numbers:hover,
.page-numbers.current {
	background-color: var(--color-primary);
	border-color: var(--color-primary);
	color: white;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
	.site-content {
		padding: 15px;
	}

	.site-header {
		padding: 12px 15px;
	}

	.site-title {
		font-size: 1.25rem;
	}

	.main-navigation ul {
		gap: 15px;
	}

	.menu-toggle {
		display: block;
	}

	.main-navigation ul {
		display: none;
		flex-direction: column;
		width: 100%;
		gap: 0;
		margin-top: 15px;
	}

	.main-navigation ul.toggled {
		display: flex;
	}

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

	.main-navigation a {
		display: block;
		padding: 12px 0;
	}

	.site-main {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 15px;
	}

	.video-card {
		border-radius: 6px;
	}

	.entry-title {
		font-size: 0.9rem;
	}

	.single-video-info .entry-title {
		font-size: 1.5rem;
	}

	h1 {
		font-size: 1.75rem;
	}

	h2 {
		font-size: 1.5rem;
	}

	.widget-area {
		padding: 15px;
	}

	.random-tags-list {
		gap: 8px;
	}

	.random-tag {
		font-size: 0.8rem;
		padding: 5px 10px;
	}

	.video-stats {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 480px) {
	.site-content {
		padding: 10px;
	}

	.site-header {
		padding: 10px;
	}

	.site-title {
		font-size: 1rem;
	}

	.site-main {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.video-meta {
		flex-wrap: wrap;
	}

	.entry-title {
		font-size: 0.85rem;
	}

	.single-video-info .entry-title {
		font-size: 1.25rem;
	}

	h1 {
		font-size: 1.5rem;
	}

	h2 {
		font-size: 1.25rem;
	}

	.site-footer {
		padding: 20px 10px;
	}
}

/* ============================================
   PERFORMANCE & ACCESSIBILITY
   ============================================ */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	font-size: 14px;
	font-size: 0.875rem;
	font-weight: bold;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* Lazy loading optimization */
img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Print styles */
@media print {
	body {
		background: white;
		color: black;
	}

	.site-header,
	.site-footer,
	.widget-area,
	.pagination {
		display: none;
	}
}
