/*
Theme Name: StreamFlix
Theme URI: https://ejemplo.com/streamflix
Description: Tema para plataforma de streaming con integración de vidsrc.me
Version: 1.0
Author: Tu Nombre
Author URI: https://tudominio.com
Text Domain: streamflix
*/

/* Estilos generales */
:root {
    --primary: #8e44ad;
    --primary-dark: #6c3483;
    --secondary: #e74c3c;
    --dark: #121212;
    --darker: #0a0a0a;
    --light: #f5f5f5;
    --gray: #2c2c2c;
    --overlay: rgba(0, 0, 0, 0.7);
}

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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--darker);
    color: var(--light);
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header estilo app móvil */
.app-header {
    background: linear-gradient(to bottom, var(--darker), var(--dark));
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--gray);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary);
}

.header-icons {
    display: flex;
    gap: 20px;
}

.header-icon {
    font-size: 20px;
    color: var(--light);
    cursor: pointer;
}

/* Buscador */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--darker);
    padding: 70px 0 20px;
    z-index: 99;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: none;
}

.search-container {
    padding: 0 15px;
    position: relative;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border-radius: 30px;
    border: none;
    background: var(--gray);
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.search-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
}

.close-search {
    position: absolute;
    top: -55px;
    right: 15px;
    background: rgba(30, 30, 30, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    border: none;
    backdrop-filter: blur(5px);
    z-index: 10;
    cursor: pointer;
    transition: background 0.3s;
}

/* Navegación inferior */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--dark);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid var(--gray);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #888;
    font-size: 12px;
    text-decoration: none;
}

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

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding-top: 70px;
    padding-bottom: 70px;
    overflow-y: auto;
}

/* Secciones */
.section-title {
    padding: 15px 15px 10px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-all {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
}

/* Estilos para carruseles modernos */
.swiper {
    padding: 0 15px 30px;
    position: relative;
    overflow: hidden;
}

.swiper-wrapper {
    padding-bottom: 10px;
    display: flex;
}

.swiper-slide {
    width: auto;
    flex-shrink: 0;
    transition: transform 0.3s;
}

/* Tarjetas de género */
.genre-card {
    width: 150px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    margin-right: 15px;
}

.genre-image {
    width: 100%;
    height: 90px;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.3s ease;
}

.genre-card:hover .genre-image {
    transform: scale(1.05);
}

.genre-name {
    padding: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background: rgba(0,0,0,0.7);
    color: white;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Mejoras para tarjetas existentes */
.movie-card, .series-card {
    min-width: 140px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    margin-right: 15px;
}

.movie-card:hover, .series-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.movie-poster, .series-poster {
    border-radius: 8px;
    overflow: hidden;
    height: 210px;
}

/* Paginación moderna */
.swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 15px;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #555;
    opacity: 1;
    transition: all 0.3s;
}

.swiper-pagination-bullet-active {
    background: var(--primary);
    width: 25px;
    border-radius: 10px;
}

/* Efecto de gradiente en tarjetas */
.movie-info, .series-info {
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 15px 10px 10px;
}

/* Responsive para móviles */
@media (max-width: 480px) {
    .genre-card {
        width: 130px;
    }
    
    .movie-poster, .series-poster {
        height: 190px;
    }
    
    .swiper {
        padding: 0 10px 25px;
    }
}

.movie-info, .series-info {
    padding: 10px 5px 5px;
}

.movie-title, .series-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta, .series-meta {
    font-size: 12px;
    color: #aaa;
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.rating {
    color: gold;
    font-weight: bold;
}

/* Grid de películas */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 0 15px 20px;
}

.movie-grid-item {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s;
}

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

.movie-grid-poster {
    width: 100%;
    aspect-ratio: 2/3;
    position: relative;
    overflow: hidden;
}

.movie-grid-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.movie-grid-item:hover .movie-grid-poster img {
    transform: scale(1.1);
}

.movie-grid-title {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Categorías */
.categories {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 15px 15px;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category {
    background: var(--gray);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

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

/* Reproductor */
.video-reels-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--darker);
    z-index: 1000;
    display: none;
}

.video-player-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-player {
    width: 100%;
    height: 100%;
    background: #000;
}

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

.video-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.control-btn {
    background: rgba(30, 30, 30, 0.7);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    border: none;
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: background 0.3s;
}

.control-btn:hover {
    background: rgba(50, 50, 50, 0.9);
}

.episode-info {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    z-index: 10;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding-top: 30px;
}

.series-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.episode-title {
    font-size: 16px;
    opacity: 0.9;
}

.episode-description {
    font-size: 14px;
    opacity: 0.7;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.close-player {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(30, 30, 30, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    border: none;
    backdrop-filter: blur(5px);
    z-index: 10;
    cursor: pointer;
    transition: background 0.3s;
}

.close-player:hover {
    background: rgba(50, 50, 50, 0.9);
}

.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    z-index: 5;
}

.lock-icon {
    font-size: 50px;
    color: var(--primary);
    margin-bottom: 20px;
}

.unlock-btn {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    margin-top: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.unlock-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(to right, var(--primary-dark), var(--primary));
}

/* Página de búsqueda */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 0 15px 20px;
}

.search-result-item {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.search-result-poster {
    width: 100%;
    aspect-ratio: 2/3;
    background-color: var(--gray);
    border-radius: 8px;
    overflow: hidden;
}

.search-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    padding: 10px 5px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Página individual */
.page-content {
    padding: 20px;
}

.page-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--primary);
}

.page-text {
    line-height: 1.6;
}

/* Responsive */
@media (min-width: 768px) {
    body {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        height: 100vh;
    }
    
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* SOLUCIÓN PARA REPRODUCTOR */
body.single-pelicula .video-reels-container,
body.single-serie .video-reels-container {
    display: block !important;
    position: relative;
    top: 0;
    height: auto;
    z-index: 1;
}

body.single-pelicula .app-header,
body.single-serie .app-header,
body.single-pelicula .bottom-nav,
body.single-serie .bottom-nav {
    display: none;
}

.video-reels-container.active {
    display: block;
}

.video-player-container {
    padding-top: 56.25%;
    position: relative;
}

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

.episode-info {
    padding: 20px;
    background: #1a1a1a;
    border-radius: 8px;
    margin: 20px 0;
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.control-btn {
    background: #e50914;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.close-player {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 100;
}

/* Asegurar visibilidad de elementos */
.series-name, .episode-title, .episode-description {
    color: #fff;
    opacity: 1 !important;
}

/* Añadir al final de style.css */
/* Correcciones adicionales para carrusel */

.swiper-wrapper {
    padding-bottom: 30px;
}

.swiper-slide {
    width: auto;
    flex-shrink: 0;
    height: auto;
}

.genre-card {
    width: 150px;
    height: 100%;
}

/* Mejoras táctiles */
.swiper-slide {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Paginación visible */
.swiper-pagination {
    position: absolute;
    bottom: 10px !important;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 10;
}

@media (max-width: 480px) {
    .swiper {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .swiper-slide {
        width: 120px;
    }
}