/*
Theme Name: VideoTube
Theme URI: https://example.com/videotube
Author: VideoTube Team
Author URI: https://example.com
Description: Lightweight, SEO-optimized video tube theme with mobile-first design, dark/light mode, and schema.org markup.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: videotube
Tags: video, tube, responsive, mobile-first, seo, schema-markup, dark-mode

VideoTube WordPress Theme - A fast, SEO-friendly video tube theme.
*/

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --accent-color: #ff6b00;
    --accent-hover: #ff8533;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --header-bg: #ffffff;
    --footer-bg: #1a1a1a;
    --footer-text: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --duration-bg: rgba(0, 0, 0, 0.8);
    --mobile-nav-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --border-color: #333333;
    --card-bg: #1a1a1a;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --header-bg: #1a1a1a;
    --footer-bg: #0f0f0f;
    --footer-text: #ffffff;
    --mobile-nav-bg: #1a1a1a;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    height: 100%;
    height: -webkit-fill-available;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100%;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin: 0 0 1rem;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.site-content {
    flex: 1;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   Header
   ========================================================================== */

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

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Burger Menu Button */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--text-primary);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background-color: var(--bg-secondary);
}

.menu-toggle-icon {
    width: 24px;
    height: 24px;
}

.menu-toggle[aria-expanded="true"] .icon-menu {
    display: none;
}

.menu-toggle[aria-expanded="false"] .icon-close,
.menu-toggle .icon-close {
    display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

/* Logo */
.site-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.logo-link:hover {
    color: var(--text-primary);
}

.logo-accent {
    color: var(--accent-color);
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--accent-color);
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    margin-right: 0.25rem;
}

.site-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* Mobile Header Tags */
.mobile-header-tags {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
    margin-left: 0.5rem;
}

.mobile-header-tags-list {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.mobile-header-tags-list a {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.mobile-header-tags-list a:hover {
    background: var(--accent-color);
    color: #fff;
}

.mobile-header-tags-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mobile-header-tags-more:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Desktop Navigation */
.main-navigation {
    display: none;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0;
}

.nav-top-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-spacer {
    flex: 1;
}

.nav-menu li {
    display: block;
}

.nav-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a:focus {
    background-color: var(--bg-secondary);
    color: var(--accent-color);
}

/* Search in navigation */
.nav-search {
    margin-left: 0.5rem;
}

.nav-search .search-form {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.nav-search .search-field {
    width: 200px;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.nav-search .search-field::placeholder {
    color: var(--text-muted);
}

.nav-search .search-field:focus {
    outline: none;
}

.nav-search .search-submit {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-search .search-submit:hover {
    color: var(--accent-color);
}

/* Header Tags Row - Full Width */
.header-tags-row {
    display: none;
    border-top: 1px solid var(--border-color);
    background: var(--header-bg);
}

.header-tags-container {
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

.header-tags-list {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    overflow: hidden;
    max-height: 2rem;
}

.header-tags-list a {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.header-tags-list a:hover {
    background-color: var(--bg-secondary);
    color: var(--accent-color);
}

.header-tags-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.header-tags-more:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1002;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    padding-top: 4rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-search-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-search-container {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.mobile-search-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-search-overlay .search-form {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.mobile-search-overlay .search-field {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
}

.mobile-search-overlay .search-field::placeholder {
    color: var(--text-muted);
}

.mobile-search-overlay .search-field:focus {
    outline: none;
}

.mobile-search-overlay .search-submit {
    padding: 1rem;
    background: var(--accent-color);
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-search-overlay .search-submit:hover {
    background: var(--accent-hover);
}

/* Mobile Off-Canvas Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 1001;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.mobile-menu.is-open {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.mobile-menu-nav {
    padding: 1rem 0;
}

.mobile-menu-nav a {
    display: block;
    padding: 0.875rem 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-nav a:hover {
    background-color: var(--bg-secondary);
    color: var(--accent-color);
}

.mobile-menu-tags {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.mobile-menu-tags-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.mobile-menu-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    max-height: 300px;
    overflow-y: auto;
}

.mobile-menu-tags a {
    display: inline-block;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.mobile-menu-tags a:hover {
    background: var(--accent-color);
    color: #fff;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Video Grid
   ========================================================================== */

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

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

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

.video-thumbnail {
    display: block;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 fallback for older browsers */
    height: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-tertiary);
}

/* Reset padding-bottom when aspect-ratio is supported */
@supports (aspect-ratio: 16 / 9) {
    .video-thumbnail {
        padding-bottom: 0;
        height: auto;
    }
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Reset position when aspect-ratio is supported */
@supports (aspect-ratio: 16 / 9) {
    .video-thumbnail img {
        position: static;
    }
}

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

/* Thumbnail overlay base styles */
.thumbnail-play,
.thumbnail-views,
.thumbnail-rating,
.video-duration {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
    transition: opacity 0.2s ease;
}

/* Play button - bottom left */
.thumbnail-play {
    bottom: 0.5rem;
    left: 0.5rem;
    background: var(--accent-color);
    color: #fff;
}

.thumbnail-play svg {
    width: 12px;
    height: 12px;
}

.video-card:hover .thumbnail-play {
    opacity: 1;
}

/* Views - top left */
.thumbnail-views {
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
}

.thumbnail-views svg {
    width: 12px;
    height: 12px;
}

/* Rating - top right */
.thumbnail-rating {
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    color: #ffc107;
}

.thumbnail-rating svg {
    width: 12px;
    height: 12px;
}

/* Duration - bottom right */
.video-duration {
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.video-info {
    padding: 0.5rem;
}

.video-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0;
    line-height: 1.4;
}

.video-title a {
    display: block;
    color: var(--text-primary);
    padding: 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

.video-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.video-meta-icon {
    width: 14px;
    height: 14px;
}

.video-rating {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.video-rating .star {
    color: #ffc107;
}

/* ==========================================================================
   Featured Section
   ========================================================================== */

.featured-section {
    margin-bottom: 2rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.featured-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    padding-bottom: 56.25%; /* 16:9 fallback for older browsers */
    height: 0;
    aspect-ratio: 16 / 9;
}

/* Reset padding-bottom when aspect-ratio is supported */
@supports (aspect-ratio: 16 / 9) {
    .featured-card {
        padding-bottom: 0;
        height: auto;
    }
}

.featured-card .video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.featured-card .video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
}

.featured-card .video-title {
    font-size: 1.125rem;
    color: #fff;
}

.featured-card .video-title a {
    color: #fff;
}

/* ==========================================================================
   Page Headers
   ========================================================================== */

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.page-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
}

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

.breadcrumbs-separator {
    color: var(--text-muted);
}

.breadcrumbs-current {
    color: var(--text-primary);
}

/* ==========================================================================
   Single Video Page
   ========================================================================== */

.single-video {
    max-width: 1200px;
    margin: 0 auto;
}

.video-player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.video-player-container iframe,
.video-player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Video Content Wrapper - Description + Download */
.video-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.video-content-wrapper .video-description {
    margin-bottom: 0;
}

/* Download Button */
.video-download-section {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.video-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: #fff;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

.video-download-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
    color: #fff;
}

.video-download-icon {
    width: 20px;
    height: 20px;
}

.video-header {
    margin-bottom: 1.5rem;
}

.video-page-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.video-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.video-page-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.video-page-meta-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Video Tags & Stars */
.video-taxonomies {
    margin-bottom: 1.5rem;
}

.video-taxonomy {
    margin-bottom: 1rem;
}

.video-taxonomy-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.video-taxonomy-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.video-taxonomy-list a {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.video-taxonomy-list a:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Video Description */
.video-description {
    margin-bottom: 2rem;
}

.video-description-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

.video-description-content.is-collapsed {
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.video-description-content.is-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
}

.video-description-toggle {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--accent-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

/* Related Videos */
.related-videos {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-videos-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Responsive related videos count */
/* Tablet (3 columns): show 9 videos */
@media (min-width: 768px) and (max-width: 1023px) {
    .related-videos .video-card:nth-child(n+10) {
        display: none;
    }
}

/* Desktop (4 columns): show 8 videos */
@media (min-width: 1024px) and (max-width: 1199px) {
    .related-videos .video-card:nth-child(n+9) {
        display: none;
    }
}

/* ==========================================================================
   Tags List Page
   ========================================================================== */

.tags-list {
    column-count: 1;
    column-gap: 2rem;
}

.tag-item {
    break-inside: avoid;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.tag-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

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

.tag-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================================================
   Stars Page
   ========================================================================== */

.stars-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.star-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}

.star-card:hover {
    transform: translateY(-2px);
}

.star-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    flex-shrink: 0;
    overflow: hidden;
}

.star-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.star-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.star-name a {
    color: inherit;
}

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

.star-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Single Star Page */
.star-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.star-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-secondary);
    overflow: hidden;
    flex-shrink: 0;
}

.star-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.star-profile-info {
    flex: 1;
}

.star-profile-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.star-profile-bio {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination a {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.pagination a:hover {
    background: var(--accent-color);
    color: #fff;
}

.pagination .current {
    background: var(--accent-color);
    color: #fff;
}

.pagination .dots {
    background: none;
    color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-description {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-description p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    line-height: 1.7;
}

.footer-nav {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.footer-menu a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

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

.footer-copyright {
    text-align: center;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   Mobile Bottom Navigation
   ========================================================================== */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mobile-nav-bg);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.25rem;
    color: var(--text-muted);
    font-size: 0.625rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item.active {
    color: var(--accent-color);
}

.mobile-bottom-nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 0.125rem;
}

body.has-mobile-nav {
    padding-bottom: 70px;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    .site-content {
        padding: 1.5rem;
    }

    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

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

    .tags-list {
        column-count: 2;
    }

    .stars-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .video-page-title {
        font-size: 1.5rem;
    }

    .mobile-bottom-nav {
        display: none;
    }

    body.has-mobile-nav {
        padding-bottom: 0;
    }

    /* Desktop layout for description + download */
    .video-content-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }

    .video-content-wrapper .video-description {
        flex: 1;
        min-width: 0;
    }

    .video-download-section {
        justify-content: flex-start;
    }

    .video-download-btn {
        white-space: nowrap;
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }

    .mobile-header-tags {
        display: none;
    }

    .main-navigation {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .header-tags-row {
        display: block;
    }

    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stars-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Medium Desktop: 1024px - 1199px - adjust search bar width */
@media (min-width: 1024px) and (max-width: 1199px) {
    .nav-search .search-field {
        width: 150px;
    }
}

/* Large Desktop: 1200px+ */
@media (min-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }

    .video-info {
        padding: 1rem;
    }

    .video-title {
        font-size: 0.9375rem;
    }

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

/* Print Styles */
@media print {
    .site-header,
    .mobile-bottom-nav,
    .pagination,
    .related-videos {
        display: none;
    }

    .site-content {
        padding: 0;
    }

    .video-player-container {
        display: none;
    }
}

/* ==========================================================================
   Video Preview Player (k2s, tezfiles, fboom)
   ========================================================================== */

.video-embed-container {
    width: 100%;
    background: #000;
}

.videotube-preview.wrap {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.videotube-preview .sub-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    overflow: hidden;
}

.videotube-preview .poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-size: contain;
}

.videotube-preview .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.videotube-preview .play-btn:hover {
    background: var(--accent-color);
    transform: translate(-50%, -50%) scale(1.1);
}

.videotube-preview .play-btn .play-icon {
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 25px solid #fff;
    margin-left: 5px;
}

.videotube-preview .download-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10;
}

.videotube-preview .download-btn:hover {
    background: var(--accent-color);
}

.videotube-preview .download-btn svg {
    width: 20px;
    height: 20px;
}

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

/* Loading Spinner */
.videotube-loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    z-index: 5;
}

.videotube-loading-spinner.active {
    display: block;
}

.videotube-loading-spinner::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: videotube-spin 1s linear infinite;
}

@keyframes videotube-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Banner */
.error-wrap {
    width: 100%;
    padding-bottom: 56.25%;
    position: relative;
    background: #1a1a1a;
}

.error-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 2rem;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 1rem;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .videotube-preview .play-btn {
        width: 60px;
        height: 60px;
    }

    .videotube-preview .play-btn .play-icon {
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-left: 18px solid #fff;
        margin-left: 3px;
    }

    .videotube-preview .download-btn {
        width: 35px;
        height: 35px;
        bottom: 10px;
        right: 10px;
    }

    .videotube-preview .download-btn svg {
        width: 16px;
        height: 16px;
    }
}
