/* assets/css/style.css */
@import 'search-desktop.css';


/* Core Variables & Reset */
:root {
    --bg-dark: #0a0a18;
    --bg-card: #12122a;
    --bg-card-hover: #1c1c3d;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --accent-primary: #3b82f6;
    /* Blue */
    --accent-secondary: #8b5cf6;
    /* Purple */
    --danger: #ef4444;
    /* Live Badge */
    --font-main: 'Inter', sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header & Nav */
header {
    height: var(--header-height);
    background: rgba(10, 10, 24, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 30px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 8px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.search-bar {
    position: relative;
    width: 250px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: var(--accent-primary);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Hero SEO Section (Home) */
.hero-seo-section {
    padding: 60px 5%;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 60%),
        radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.15), transparent 60%),
        rgba(15, 15, 35, 0.5);
    margin-bottom: 40px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-seo-section h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-seo-section p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Hero Featured Section (Pluto Style) */
.hero-section {
    position: relative;
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    width: 100%;
    overflow: hidden;
    margin-bottom: -40px;
    /* Overlap with content */
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
    transition: transform 10s ease;
}

.hero-section:hover .hero-backdrop {
    transform: scale(1.05);
}

.hero-content {
    position: absolute;
    bottom: 80px;
    left: 5%;
    max-width: 600px;
    z-index: 10;
}

.hero-logo {
    max-height: 120px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
}

.hero-description {
    font-size: 1.1rem;
    color: #e0e0e0;
    margin-bottom: 25px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.btn-hero {
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-hero-primary {
    background: white;
    color: black;
}

.btn-hero-primary:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

/* Horizontal Scrolling Rows (Netflix/Pluto Style) */
.category-row {
    margin-bottom: 40px;
    position: relative;
    padding-left: 5%;
    /* Align with hero content */
}

.row-header {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.row-header span {
    color: var(--accent-primary);
}

.scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 20px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    padding-right: 5%;
    /* Padding end */
}

.scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* New Modern Card Style */
.tv-card {
    flex: 0 0 200px;
    /* Fixed width */
    height: 120px;
    background: var(--bg-card);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.tv-card:hover {
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-primary);
}

.tv-card-img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

/* Overlay info on hover */
.tv-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tv-card:hover .tv-card-overlay {
    opacity: 1;
}

.tv-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gradient side fade for scroll indication (Optional, complex to implement purely CSS properly without covering items, leaving out for cleanliness) */

/* Channel Grid */
.grid-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    padding-left: 10px;
    border-left: 4px solid var(--accent-primary);
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding-bottom: 50px;
}

.channel-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.channel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.card-img-container {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    /* Circular for radio, adjust for TV if needed square */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.channel-card.tv .card-img-container {
    border-radius: 15px;
    /* Square rounded for TV */
}

.channel-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Player Page */
.player-container {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 30px;
    margin-top: 30px;
}

.video-wrapper {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    aspect-ratio: 16/9;
}

/* Video.js custom styles */
.video-js {
    width: 100%;
    height: 100%;
}

.channel-info {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

/* Estilos para listas en descripción */
.description-content ul,
.description-content ol {
    margin: 15px 0;
    padding-left: 0;
    list-style: none;
}

.description-content ul li,
.description-content ol li {
    position: relative;
    padding: 10px 15px 10px 30px;
    margin-bottom: 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary);
}

.description-content ul li::before {
    content: '▸';
    position: absolute;
    left: 10px;
    color: var(--accent-primary);
    font-weight: bold;
}

.description-content ol {
    counter-reset: list-counter;
}

.description-content ol li {
    counter-increment: list-counter;
}

.description-content ol li::before {
    content: counter(list-counter) '.';
    position: absolute;
    left: 10px;
    color: var(--accent-primary);
    font-weight: bold;
}

.description-content p {
    margin-bottom: 12px;
}

.description-content h2,
.description-content h3,
.description-content h4 {
    color: var(--text-primary);
    margin: 20px 0 10px;
}

.description-content a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.description-content a:hover {
    color: var(--accent-secondary);
}

.channel-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.live-badge {
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* Popup Button */
.btn-popup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-popup:hover {
    background: var(--accent-secondary);
    transform: scale(1.02);
}

.btn-popup svg {
    flex-shrink: 0;
}

/* Popup Placeholder (para canales que abren en popup) */
.popup-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #0a0a18 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.popup-logo {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    background: white;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

.btn-play-popup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 18px 35px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.btn-play-popup:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
}

.popup-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.channel-title {
    font-size: 1.8rem;
    font-weight: 700;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mini-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.mini-card:hover {
    background: var(--bg-card-hover);
}

.mini-card img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    object-fit: contain;
    padding: 2px;
}

/* Radio Player Specifics */
.radio-player-wrapper {
    background: #1a1a2e;
    height: 400px;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .radio-player-wrapper {
        /* height: 320px; Remove fixed height */
        height: auto;
        aspect-ratio: 16/9;
        /* Maintain ratio if needed, or just let it flow */
        min-height: 250px;
        /* Ensure at least some height */
    }
}

.radio-title {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    padding: 0 15px;
    word-break: break-word;
}

@media (max-width: 768px) {
    .radio-title {
        font-size: 1.3rem !important;
    }
}

.radio-player-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    z-index: 1;
}

.radio-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.radio-logo-lg {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: white;
    padding: 15px;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
    object-fit: contain;
}

.audio-visualizer {
    display: flex;
    gap: 5px;
    height: 40px;
    align-items: flex-end;
}

.bar {
    width: 6px;
    height: 100%;
    /* Ocupa el 100% del contenedor */
    background: var(--accent-primary);
    border-radius: 3px;
    animation: bounce 1s infinite ease-in-out;
    transform-origin: bottom;
    /* Crece desde abajo */
}

@keyframes bounce {

    0%,
    100% {
        transform: scaleY(0.25);
        /* 10px de 40px */
    }

    50% {
        transform: scaleY(1);
        /* 40px total */
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    background: #05050c;
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 900px) {
    .player-container {
        grid-template-columns: 1fr;
    }

    /* Ocultar sidebar en tablet */
    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {

    /* Radio player responsive */
    .radio-logo-lg {
        width: 120px;
        height: 120px;
        padding: 10px;
    }

    .radio-content h2 {
        font-size: 1.3rem !important;
    }

    .video-wrapper {
        /* Remove fixed height to respect aspect-ratio */
        /* height: 300px !important; */
        /* min-height: 280px; */
        width: 100%;
        aspect-ratio: 16/9;
    }

    .audio-visualizer {
        height: 30px;
    }

    .audio-visualizer .bar {
        width: 4px;
    }

    /* Popup placeholder responsive */
    .popup-logo {
        width: 80px;
        height: 80px;
    }

    .popup-content h2 {
        font-size: 1.2rem;
    }

    .btn-play-popup {
        padding: 14px 25px;
        font-size: 1rem;
    }

    /* Radio Page Mobile */
    /* Radio Page Mobile */
    .seo-section {
        padding: 20px 15px !important;
    }

    .seo-section h1,
    .seo-section h2 {
        font-size: 1.2rem !important;
    }

    .seo-section h3 {
        font-size: 1rem !important;
    }

    .seo-section p {
        font-size: 0.85rem !important;
    }

    /* Hero SEO Mobile */
    .hero-seo-section {
        padding: 20px 15px !important;
    }

    .hero-seo-section h1 {
        font-size: 1.3rem !important;
    }

    .hero-seo-section p {
        font-size: 0.9rem !important;
        padding-right: 0;
    }

    /* Grid más compacto en móvil para radios */
    .channel-card.radio .card-img-container {
        width: 60px !important;
        height: 60px !important;
    }

    /* Radio Station Detail Mobile Fix */
    .player-container {
        padding: 0 !important;
    }

    .main-content {
        padding: 0 10px;
    }

    .channel-info {
        margin: 15px 0;
        padding: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .channel-info .channel-title {
        font-size: 1.3rem !important;
        word-break: break-word;
    }

    .description-content {
        word-wrap: break-word;
        overflow-wrap: break-word;
        overflow-x: hidden;
    }

    .description-content p,
    .description-content li {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .description-content a {
        word-break: break-all;
    }

    /* Container principal con padding */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    header {
        height: auto;
    }

    .main-menu {
        overflow-x: auto;
        width: 100%;
        padding-bottom: 5px;
        white-space: nowrap;
    }

    .channel-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .channel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Bottom Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 24, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    padding: 10px 0;
    z-index: 9999;
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 5px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--accent-primary);
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
}

.bottom-nav-item.active svg {
    fill: var(--accent-primary);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: block;
    }

    /* Ocultar menú superior en móvil */
    .main-menu {
        display: none;
    }

    /* Agregar padding inferior al body para que el contenido no quede debajo del nav */
    body {
        padding-bottom: 80px;
    }

    /* Ocultar footer en móvil para más espacio */
    footer {
        margin-bottom: 70px;
    }

    /* Ocultar barra de búsqueda en header móvil */
    .search-bar {
        display: none;
    }
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 24, 0.98);
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-search-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-search-container {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 50px auto 0;
}

.mobile-search-container input {
    flex: 1;
    padding: 15px 20px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.mobile-search-container input:focus {
    border-color: var(--accent-primary);
}

.mobile-search-container button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Mobile Search Results */
.mobile-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.mobile-result-item:hover,
.mobile-result-item:active {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.mobile-result-item img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: white;
    padding: 3px;
    object-fit: contain;
}

.mobile-result-item span {
    font-size: 0.95rem;
    font-weight: 500;
}

/* App Download Banner */
.app-download-banner {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: transform 0.2s;
}

.app-download-banner:hover {
    transform: translateY(-2px);
}

.app-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-icon-circle {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-text-group h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
}

.app-text-group p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.9rem;
}

.app-install-btn {
    background: white;
    color: #059669;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Mobile Responsive for App Banner */
@media (max-width: 768px) {
    .app-download-banner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px 15px;
    }

    .app-banner-content {
        flex-direction: column;
        gap: 10px;
    }

    .app-text-group h3 {
        font-size: 1.2rem;
    }

    .app-install-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}