/*
Theme Name: TikVideo
Theme URI: https://example.com/tikvideo
Author: Your Name
Author URI: https://example.com
Description: A lightweight, modern WordPress theme designed for displaying video content imported by WP-Script plugin. Features a mobile-first, TikTok-style vertical swiping experience.
Version: 1.0.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: tikvideo
Tags: video, responsive, mobile-first, tiktok-style

*/

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

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

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #fff;
    background-color: #000;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: #fe2c55;
}

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

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    padding: 15px 20px;
}

.site-branding {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

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

.main-navigation a {
    color: #fff;
    font-size: 0.9rem;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.main-navigation a:hover {
    background: rgba(254, 44, 85, 0.8);
}

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

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 15px 20px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===================================
   Swiper Container
   =================================== */

.video-swiper {
    width: 100%;
    height: 100vh;
}

.swiper-slide {
    position: relative;
    overflow: hidden;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===================================
   Video Thumbnail Overlay
   =================================== */

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    transition: opacity 0.3s ease;
}

.thumbnail-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===================================
   Play Button
   =================================== */

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10;
}

.play-btn:hover {
    background: rgba(254, 44, 85, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.thumbnail-overlay.hidden .play-btn {
    opacity: 0;
}

/* ===================================
   Video Player
   =================================== */

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

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

/* ===================================
   Video Meta Information
   =================================== */

.video-meta {
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 20;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    pointer-events: none;
}

.video-meta h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.video-meta .duration,
.video-meta .views {
    display: inline-block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-right: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 12px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

/* ===================================
   Single Post Page
   =================================== */

.single-video-container {
    min-height: 100vh;
    padding: 80px 20px 40px;
    background: #0a0a0a;
}

.single-video-player {
    max-width: 800px;
    margin: 0 auto 30px;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
}

.single-video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.single-video-info {
    max-width: 800px;
    margin: 0 auto;
    background: #161616;
    padding: 25px;
    border-radius: 12px;
}

.single-video-info h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
}

.single-video-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.single-video-meta span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.single-video-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 20px;
}

.single-video-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.single-video-tags a {
    background: rgba(254, 44, 85, 0.2);
    color: #fe2c55;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.single-video-tags a:hover {
    background: rgba(254, 44, 85, 0.8);
    color: #fff;
}

/* ===================================
   Archive Pages (Grid Layout)
   =================================== */

.archive-header {
    padding: 100px 20px 40px;
    text-align: center;
    background: linear-gradient(to bottom, #0a0a0a, #161616);
}

.archive-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #fff;
}

.archive-header p {
    color: rgba(255, 255, 255, 0.7);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.video-grid-item {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    transition: transform 0.3s ease;
}

.video-grid-item:hover {
    transform: translateY(-5px);
}

.video-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.video-grid-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-grid-item:hover .video-grid-overlay {
    opacity: 1;
}

.video-grid-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.video-grid-meta {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .main-navigation {
        display: none;
    }

    .site-footer {
        font-size: 0.75rem;
    }

    .video-meta h2 {
        font-size: 1rem;
    }

    .video-meta .duration,
    .video-meta .views {
        font-size: 0.8rem;
    }

    .single-video-container {
        padding: 60px 15px 30px;
    }

    .single-video-info h1 {
        font-size: 1.4rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        padding: 10px;
    }
}

@media (min-width: 769px) {
    .video-swiper {
        max-width: 500px;
        margin: 0 auto;
        height: calc(100vh - 100px);
        margin-top: 50px;
    }

    .swiper-slide {
        border-radius: 12px;
    }
}

/* ===================================
   Loading States
   =================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fe2c55;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===================================
   Error States
   =================================== */

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.error-message h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fe2c55;
}
