/*
Theme Name: VidFlux Enhanced
Theme URI: https://vidflux.com/
Author: VidFlux Development
Author URI: https://vidflux.com/
Description: A high-performance, SEO-optimized video hosting theme with custom players and advanced filtering.
Version: 1.8.0
Requires at least: 5.8
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: vidflux
Tags: video, dark, grid-layout, custom-colors, translation-ready, sticky-post

VidFlux Enhanced is a custom-built solution for premium video platforms.
*/

:root {
    /* Colors */
    --color-primary: #33b8cb;
    --color-primary-hover: #29a3b5;
    --color-primary-active: #1f8e9e;
    --color-background: #fcfcf9;
    --color-surface: #ffffff;
    --color-text: #13424b;
    --color-text-secondary: #626c71;
    --color-border: rgba(94, 82, 64, 0.2);
    --color-teal-500-rgb: 51, 184, 203;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-md: 8px;
}

/* Global Reset */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Geist", "Inter", -apple-system, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* ===== HEADER ===== */
.vf-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.vf-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.4rem 1.5rem;
    /* COMPACT */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vf-logo-image {
    max-height: 40px;
    width: auto;
    display: block;
}

.vf-logo-text .vf-site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

/* ===== SEARCH BAR ===== */
.vf-search-box {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
}

.vf-search-form {
    position: relative;
    width: 100%;
}

.vf-search-input {
    width: 100%;
    padding: 0.6rem 3rem 0.6rem 1.2rem;
    border: 2px solid var(--color-border);
    border-radius: 50px;
    background: var(--color-background);
    color: var(--color-text);
    transition: all 0.3s;
}

.vf-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(51, 184, 203, 0.1);
}

.vf-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.vf-search-btn:hover {
    background: var(--color-primary-hover);
}

/* Mobile Search Trigger (Hidden on Desktop) */
.vf-mobile-search-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    padding: 0.5rem;
    cursor: pointer;
}

/* Mobile Search Overlay (Popup Style) */
.vf-mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Transparent backdrop */
    z-index: 2000;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    /* Slight blur for focus */
}

.vf-mobile-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.vf-mobile-search-container {
    width: 100%;
    max-width: 500px;
    background: var(--color-surface);
    padding: 2rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: 10vh;
    /* Position slightly down from top */
    position: relative;
}

.vf-mobile-search-overlay.active .vf-mobile-search-container {
    transform: scale(1) translateY(0);
}

.vf-search-close {
    position: absolute;
    top: -3rem;
    /* Position above the card */
    right: 0;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.vf-mobile-search-form {
    position: relative;
    width: 100%;
}

.vf-mobile-search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--color-border);
    background: var(--color-background);
    color: var(--color-text);
    border-radius: 50px;
}

.vf-mobile-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.vf-mobile-search-submit {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-primary);
    padding: 0;
    display: flex;
    align-items: center;
}

/* Hamburger Menu (Right) */

/* ===== VIDEO GRID & CARDS ===== */
.vf-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.vf-video-card {
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--color-border);
}

.vf-video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.vf-video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    background: #000;
}

.vf-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vf-video-info {
    padding: 12px;
}

.vf-video-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: var(--color-text) !important;
    /* FORCED VISIBILITY */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== PAGINATION (STRAIGHT) ===== */
.vf-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 3rem 0;
}

.vf-pagination a,
.vf-pagination span {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 8px !important;
    /* FORCED STRAIGHT */
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.vf-pagination .current,
.vf-pagination a:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ===== DIRECTORY GRID (Categories/Models) ===== */
.vf-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.vf-cat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.vf-cat-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

.vf-cat-name {
    color: var(--color-text);
    font-weight: 600;
    margin: 0;
}

.vf-cat-count {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vf-header-container {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    /* Hide standard search on mobile */
    .vf-search-box {
        display: none;
    }

    /* Show mobile search trigger */
    .vf-mobile-search-btn {
        display: block;
        margin-left: auto;
        /* Push to right next to hamburger */
        margin-right: 0.5rem;
    }

    .vf-logo-text .vf-site-title {
        font-size: 1.4rem;
    }

    .vf-logo-image {
        max-height: 40px !important;
    }

    .vf-site-slogan {
        display: none;
        /* Hide slogan on mobile to save space */
    }
}

@media (max-width: 480px) {}

/* 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 !important;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link: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: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

.vf-ad-footer {
    padding: 20px 0;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-secondary {
    color: var(--color-text-secondary) !important;
}

.fw-bold {
    font-weight: 600 !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.align-center {
    align-items: center !important;
}

.justify-end {
    justify-content: flex-end !important;
}

.mb-1 {
    margin-bottom: 1rem !important;
}

.mb-2 {
    margin-bottom: 2rem !important;
}

.mb-3 {
    margin-bottom: 3rem !important;
}

.mt-1 {
    margin-top: 1rem !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.w-100 {
    width: 100% !important;
}

.max-w-800 {
    max-width: 800px !important;
}

.badge-primary {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.vf-info-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.vf-info-link:hover {
    background: var(--color-primary-hover);
    color: white;
    transform: translateY(-2px);
}

/* Hide default WP widgets that might persist in cache or old configs */
.widget_archive,
.widget_categories,
.widget_meta,
.widget_recent_entries,
.widget_recent_comments {
    display: none !important;
}

/* ===== SEO Breadcrumbs (Visually Hidden) ===== */
.breadcrumbs-area {
    display: none !important;
}

/* Description Toggle Feature */
.vf-description-wrapper {
    position: relative;
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.vf-description-wrapper.expanded {
    max-height: 2000px;
}

.vf-description-wrapper:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--color-background));
    pointer-events: none;
}

.vf-toggle-btn {
    display: inline-block;
    margin-top: 10px;
    background: rgba(var(--color-teal-500-rgb), 0.1);
    border: 1px solid rgba(var(--color-teal-500-rgb), 0.2);
    color: var(--color-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vf-toggle-btn:hover {
    background: rgba(var(--color-teal-500-rgb), 0.2);
    border-color: var(--color-primary);
}