/*
Theme Name: Bashell Premium Tube
Theme URI: https://bashell.com
Author: Bashell
Author URI: https://bashell.com
Description: The Ultimate SEO Tube Theme. Cyberpunk aesthetic with Deep Obsidian Black, Electric Blue, and Neon Pink. Zero-CLS layout, vanilla JS, 100% accessible, smart sticky navigations, auto-legal pages, and full bashell-* ecosystem support.
Version: 2.3.0
License: GNU General Public License v2 or later
Tested up to: 6.9
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: bashell-premium
Tags: custom-theme, video-tube, premium, dark, cyberpunk, seo-optimized
*/

/* =========================================
   1. Design Tokens & Variables
   ========================================= */
:root {
    --bg-base: #0a0a0a;          /* Obsidian Black */
    --bg-surface: #141414;       /* Slightly lighter for cards */
    --bg-glass: rgba(20, 20, 20, 0.75);
    --border-glass: rgba(255, 255, 255, 0.08);

    --accent-blue: #00F0FF;      /* Electric Blue */
    --accent-pink: #FF007F;      /* Neon Pink */
    
    --text-primary: #f5f5f5;
    --text-muted: #a0a0a0;

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Layout */
    --container-max: 1400px;
    --header-height: 64px;
    --sidebar-width: 300px;
}

/* =========================================
   2. CSS Reset & Typography
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    font-family: var(--font-ui);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover, a:focus {
    color: var(--accent-blue);
}
img, video {
    max-width: 100%;
    height: auto;
    display: block;
}
ul {
    list-style: none;
}
button, input {
    font: inherit;
}

/* =========================================
   3. Global Layout & Structure
   ========================================= */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.site-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: calc(var(--header-height) + 24px) 16px 80px 16px;
    width: 100%;
    flex: 1;
}
@media (min-width: 1024px) {
    .site-main {
        grid-template-columns: 1fr;
        padding-bottom: 40px;
    }
    .main-content {
        min-width: 0;
    }
}

/* =========================================
   4. Header & Navigation (Glassmorphism)
   ========================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #00f0ff, #ff007f) 1;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-fast);
}
/* Auto-hide header class managed by JS */
.site-header.is-hidden {
    transform: translateY(-100%);
}
.header-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
}
.header-row-bottom {
    display: flex;
    justify-content: flex-end;
    padding: 8px 16px 12px;
}
.header-left {
    display: flex;
    align-items: center;
}
.site-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.site-logo span {
    color: var(--accent-pink);
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
}
.header-right {
    display: flex;
    align-items: center;
}
.primary-nav {
    display: none;
}
.nav-list {
    display: flex;
    align-items: center;
}
.nav-list li {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-list li:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-list a {
    display: block;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    transition: all var(--transition-fast);
}
.nav-list a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.nav-list .current-menu-item > a {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}
.search-bar {
    display: flex;
    width: 100%;
    max-width: 400px;
}
.search-bar input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-right: none;
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 30px 0 0 30px;
    transition: border-color var(--transition-fast);
}
.search-bar input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0,0,0,0.4);
}
.search-submit {
    background: linear-gradient(135deg, #00f0ff, #ff007f);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 0 30px 30px 0;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.search-submit:hover {
    background: linear-gradient(135deg, #ff007f, #00f0ff);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), 0 0 15px rgba(255, 0, 127, 0.4);
}
@media (min-width: 1024px) {
    .primary-nav.desktop-only {
        display: block;
    }
}
/* Update Site Main padding for taller header */
.site-main {
    padding-top: 130px; /* Accounts for taller two-row header */
}

/* =========================================
   5. Mobile Sticky Bottom Nav
   ========================================= */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 1024px) {
    .mobile-nav {
        display: none;
    }
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
}
.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--accent-blue);
}
.mobile-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    fill: currentColor;
}

/* =========================================
   6. Video Grid & Cards (Zero CLS)
   ========================================= */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}
@media (min-width: 1400px) {
    .video-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
}

.video-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
    border: 1px solid var(--border-glass);
    position: relative;
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border-color: rgba(0, 240, 255, 0.3);
}
.video-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Zero CLS Engine */
    background: #000;
    overflow: hidden;
}
.video-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-bounce);
}
.video-card:hover .video-thumb-wrap img {
    transform: scale(1.05);
}
.video-meta-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}
.video-cat-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent-pink);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.video-info {
    padding: 12px;
}
.video-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================================
   7. Sidebar (Trending/Popular)
   ========================================= */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
}
.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}
.widget-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--accent-pink);
    border-radius: 2px;
}
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.trending-item {
    display: flex;
    gap: 12px;
    align-items: center;
}
.trending-thumb {
    width: 100px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.trending-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   8. Single Post / Video Player
   ========================================= */
.single-video-header {
    margin-bottom: 16px;
}
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.breadcrumbs a:hover {
    color: var(--accent-pink);
}
.single-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}
.player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border: 1px solid var(--border-glass);
}
/* Make bashell-poster fluid inside */
.player-wrapper iframe, .player-wrapper .bashell-player-container {
    width: 100% !important;
    height: 100% !important;
    border: none;
}
.single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.single-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 24px;
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

/* =========================================
   9. Footer & Legal
   ========================================= */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-glass);
    padding: 40px 16px;
    text-align: center;
    margin-bottom: 60px; /* Space for mobile nav */
}
@media (min-width: 1024px) {
    .site-footer {
        margin-bottom: 0;
    }
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}
.footer-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer-links a:hover {
    color: var(--accent-blue);
}
.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* =========================================
   10. Legal Pages / Content Box
   ========================================= */
.legal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    line-height: 1.7;
}
@media (min-width: 768px) {
    .legal-content {
        padding: 40px;
    }
}
.legal-content h1 {
    color: var(--accent-pink);
    margin-bottom: 24px;
}
.legal-content h2, .legal-content h3 {
    color: var(--accent-blue);
    margin-top: 24px;
    margin-bottom: 12px;
}
.legal-content p {
    margin-bottom: 16px;
}

/* =========================================
   11. Pagination
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    font-weight: 600;
    transition: all var(--transition-fast);
}
.pagination a:hover {
    background: var(--accent-blue);
    color: var(--bg-base);
    border-color: var(--accent-blue);
}
.pagination .current {
    background: var(--accent-pink);
    color: #fff;
    border-color: var(--accent-pink);
}

/* =========================================
   10. Cyberpunk Concept Art Overrides
   ========================================= */
.video-card {
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 2px;
    background: linear-gradient(135deg, #00f0ff, #ff007f);
    border: none;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1), 0 0 10px rgba(255, 0, 127, 0.1);
}
.video-info {
    background: var(--bg-surface);
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
    height: calc(100% - 56.25%); /* ensure it stretches if needed, though padding does this naturally */
}
.video-card:hover {
    transform: translateY(-5px) scale(1.02);
    z-index: 2;
    background: linear-gradient(135deg, #00f0ff, #ff007f);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 20px rgba(255, 0, 127, 0.3);
}

.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-glass);
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.stat-item svg {
    stroke: url(#neon-grad) !important;
    /* Fallback if url fails */
    color: #00f0ff;
}
.video-thumb-wrap {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
}

/* Fix overly wide Telegram Buttons on desktop */
.tg-neon-btn-container {
    max-width: 800px;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
    clear: both !important;
}
