/*
Theme Name: DramaTv
Theme URI: https://dramatv.com
Author: DramaTv Team
Author URI: https://dramatv.com
Description: A mobile-first WordPress theme for DramaTv with API-driven content and custom page templates.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dramatv
Tags: custom-theme, api-integration, drama, entertainment, mobile-first
*/

/* =Global Styles
-------------------------------------------------------------- */

:root {
    --primary-color: #FFD700;
    --secondary-color: #000000;
    --background-color: #000000;
    --text-color: #FFFFFF;
    --accent-color: #1a1a1a;
    --gray-light: #333333;
    --gray-medium: #666666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    font-size: 16px;
}

a {
    color: var(--text-color);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

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

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

/* =Mobile App Container
-------------------------------------------------------------- */

.mobile-app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--background-color);
    position: relative;
    padding-bottom: 80px;
}

/* =App Header
-------------------------------------------------------------- */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--background-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.play-icon {
    width: 40px;
    height: 40px;
    background-color: var(--gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
}

.search-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--gray-light);
}

/* =Tabs
-------------------------------------------------------------- */

.tabs-container {
    padding: 0 20px;
    margin-bottom: 20px;
}

.tabs-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 12px 0;
    background: none;
    color: var(--gray-medium);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* =Featured Carousel
-------------------------------------------------------------- */

.featured-section {
    margin-bottom: 30px;
}

.featured-carousel {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.carousel-content {
    height: 100%;
}

.carousel-slide {
    height: 100%;
}

.featured-image-wrapper {
    position: relative;
    height: 100%;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 80px 20px 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}

.featured-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.2;
}

.featured-meta {
    font-size: 14px;
    color: var(--gray-medium);
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--gray-medium);
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--primary-color);
}

/* =Trending Section
-------------------------------------------------------------- */

.trending-section {
    padding: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: bold;
}

.see-all {
    font-size: 14px;
    color: var(--gray-medium);
}

/* =Series Grid
-------------------------------------------------------------- */

.series-grid {
    position: relative;
    min-height: 200px;
}

.grid-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.series-card {
    background-color: var(--accent-color);
    border-radius: 12px;
    overflow: hidden;
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 2/3;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-fire-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-info {
    padding: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 12px;
    color: var(--gray-medium);
}

/* Load More Trigger */
.load-more-trigger {
    visibility: hidden;
    pointer-events: none;
}

/* =Bottom Navigation
-------------------------------------------------------------- */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background-color: var(--accent-color);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid var(--gray-light);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gray-medium);
    transition: color 0.3s ease;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item span {
    font-size: 12px;
}

/* =Loading
-------------------------------------------------------------- */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =Error
-------------------------------------------------------------- */

.error {
    text-align: center;
    color: var(--gray-medium);
    padding: 40px 20px;
}

/* =Container (for desktop view)
-------------------------------------------------------------- */

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

/* =Desktop Responsive
-------------------------------------------------------------- */

@media (min-width: 768px) {
    .mobile-app {
        max-width: 100%;
        padding-bottom: 0;
    }

    .bottom-nav {
        max-width: 100%;
    }

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

    .featured-carousel {
        height: 500px;
    }
}

@media (min-width: 1024px) {
    .grid-content {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* =For You Page - Series Detail
-------------------------------------------------------------- */

.for-you-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.for-you-page {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--background-color);
    position: relative;
    padding-bottom: 80px;
}

.series-detail-container {
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.series-detail-container::-webkit-scrollbar {
    display: none;
}

.series-detail-content {
    height: 100%;
}

/* Top Bar */
.detail-top-bar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    z-index: 100;
}

.detail-title-info {
    flex: 1;
    text-align: center;
}

.detail-title {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.detail-episode {
    font-size: 12px;
    color: var(--gray-medium);
    margin: 4px 0 0 0;
}

.back-btn,
.menu-btn {
    width: 40px;
    height: 40px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

/* Hero Section */
.detail-hero {
    position: relative;
    height: 50vh;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(10px);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
}

.play-hero-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-color: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.play-hero-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Content Section */
.detail-content {
    padding: 24px 20px 100px;
}

.series-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
    line-height: 1.3;
}

.series-description {
    font-size: 14px;
    color: var(--gray-medium);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Action Icons */
.detail-actions {
    display: flex;
    gap: 32px;
    margin-bottom: 20px;
}

.detail-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

.detail-action-btn span {
    font-size: 12px;
    font-weight: 600;
}

/* Genre Tags */
.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.genre-tag {
    padding: 6px 16px;
    background-color: var(--gray-light);
    border-radius: 20px;
    font-size: 12px;
    color: white;
}

/* Watch Now Button */
.watch-now-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.watch-now-btn:hover {
    background-color: #E6C200;
}

.watch-now-btn:active {
    transform: scale(0.98);
}

/* Like Button */
.like-btn.liked .like-icon {
    fill: #FF0000;
    stroke: #FF0000;
}

.like-btn.liked svg {
    animation: likeAnimation 0.3s ease-in-out;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Desktop Responsive for For You */
@media (min-width: 768px) {
    .for-you-page {
        max-width: 100%;
    }
}

/* =Series Episodes Page - Video Reels
-------------------------------------------------------------- */

.series-episodes-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.series-episodes-page {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--background-color);
    position: relative;
    padding-bottom: 80px;
}

.reel-duration {
    font-size: 14px;
    color: var(--gray-medium);
    margin-top: 4px;
}

/* Like Button */
.like-btn.liked .like-icon {
    fill: #FF0000;
    stroke: #FF0000;
}

.like-btn.liked svg {
    animation: likeAnimation 0.3s ease-in-out;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Watch Series Button */
.watch-series-btn {
    margin-top: 12px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.watch-series-btn:hover {
    background-color: #E6C200;
}

.watch-series-btn:active {
    transform: scale(0.95);
}

/* Desktop Responsive for Series Episodes */
@media (min-width: 768px) {
    .series-episodes-page {
        max-width: 100%;
    }
}

/* Series Episodes Page - Reuse For You Feed Styles */
.series-episodes-page {
    height: 100vh;
    overflow: hidden;
}

.series-episodes-page .reels-container {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

.series-episodes-page .reels-content {
    height: 100%;
}

.series-episodes-page .reel-item {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    background: #000;
}

.series-episodes-page .reel-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.series-episodes-page .reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =Empty State
-------------------------------------------------------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: calc(100vh - 160px);
}

.empty-icon {
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
}

.empty-description {
    font-size: 16px;
    color: var(--gray-medium);
    margin-bottom: 32px;
    line-height: 1.5;
}

.empty-btn {
    padding: 14px 32px;
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.empty-btn:hover {
    background-color: #E6C200;
}

/* =For You Feed Page
-------------------------------------------------------------- */

.for-you-feed-page {
    height: 100vh;
    overflow: hidden;
}

.reels-container {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

.reels-content {
    height: 100%;
}

.reel-item {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    background: #000;
}

.reel-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Top Bar */
.reel-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 10;
}

.back-btn,
.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reel-title-info {
    text-align: center;
    flex: 1;
}

.reel-series-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.reel-episode-info {
    color: #FFD700;
    font-size: 12px;
    margin: 4px 0 0 0;
    font-weight: 500;
}

/* Right-aligned Action Icons */
.reel-right-actions {
    position: absolute;
    right: 16px;
    top: 60%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 10;
}

.action-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s ease;
}

.action-icon:hover {
    transform: scale(1.1);
}

.action-icon svg {
    width: 32px;
    height: 32px;
}

.action-label {
    color: white;
    font-size: 11px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Bottom Overlay */
.reel-bottom-overlay {
    position: absolute;
    bottom: 80px;
    left: 16px;
    right: 80px;
    z-index: 10;
}

.reel-video-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.reel-genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.reel-genre-tags .genre-tag {
    padding: 4px 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 11px;
    color: white;
    backdrop-filter: blur(10px);
}

.reel-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 12px 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-full-drama-btn {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.watch-full-drama-btn:hover {
    background-color: #E6C200;
}

.watch-full-drama-btn:active {
    transform: scale(0.95);
}

/* Seek Bar */
.reel-seek-bar {
    position: absolute;
    bottom: 60px;
    left: 16px;
    right: 16px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    z-index: 10;
}

.seek-progress {
    height: 100%;
    background: #FFD700;
    border-radius: 2px;
    width: 0%;
    position: relative;
}

.seek-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #FFD700;
    border-radius: 50%;
    border: 2px solid white;
    left: 0%;
}

/* Bottom Controls */
.reel-bottom-controls {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.pip-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.toggle-switch {
    width: 44px;
    height: 24px;
}

.toggle-track {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border-radius: 50%;
    transition: left 0.3s ease;
}
