/* Variables de color basadas en la imagen de referencia */
:root {
    --bg-color: #050505;
    --header-bg: #1c1c1c;
    --card-bg: #121212;
    --primary-color: #008f7a; /* Color verde/teal de los botones y acentos */
    --text-color: #ffffff;
    --text-muted: #999999;
    --border-color: #2a2a2a;
    --border-radius: 16px;
}

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

body {
    font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    /* Fondo de la web con la imagen del Loro (fondo.jpg) y un filtro oscuro para leer el texto */
    background-image: linear-gradient(rgba(5, 5, 5, 0.8), rgba(5, 5, 5, 0.85)), url('fondo.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: var(--bg-color); /* Color de respaldo */
}

/* Header */
.navbar {
    padding: 18px 30px;
    background-color: var(--header-bg);
    border-bottom: 2px solid #222;
    display: flex;
    align-items: center;
}

.navbar .logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar .logo img {
    height: 45px;
    width: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

/* Sidebar Social */
.social-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    background: transparent;
    z-index: 100;
}

.social-sidebar a {
    color: var(--text-color);
    font-size: 18px;
    text-decoration: none;
    transition: color 0.3s;
    text-align: center;
}

.social-sidebar a:hover {
    color: var(--primary-color);
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    /* Dejar espacio para el sidebar a la derecha */
    padding-right: 60px;
}

/* Sección de Eventos */
.events-section {
    text-align: center;
    margin-bottom: 50px;
}

.events-section h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.events-carousel {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #222;
}

.events-carousel::-webkit-scrollbar {
    height: 8px;
}
.events-carousel::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}
.events-carousel::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.dot {
    width: 25px;
    height: 8px;
    background-color: transparent;
    border-radius: 4px;
    border: 1px solid var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Contenido Principal y Búsqueda */
.subtitle {
    text-align: center;
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 30px;
}

.search-container {
    position: relative;
    max-width: 100%;
    margin-bottom: 40px;
}

.search-container input {
    width: 100%;
    padding: 16px 20px;
    padding-right: 50px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #1e1e1e;
    color: var(--text-color);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.search-container input:focus {
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

/* Grid de Canales */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

/* Estilo de Tarjetas */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
    border-color: var(--primary-color);
}

/* Para las tarjetas del carrusel, fijamos un ancho mínimo */
.events-carousel .card {
    min-width: 280px;
    flex-shrink: 0;
}

/* Badge (Etiqueta superior izquierda) */
.card-badge {
    align-self: flex-start;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.card-badge.social {
    background-color: #0088cc;
}

.card-badge.donate {
    background-color: #0070ba;
}

/* El puntito verde animado de "En vivo" */
.card-badge.live::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #a3ffb4;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(163, 255, 180, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(163, 255, 180, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(163, 255, 180, 0); }
}

/* Imagen del canal */
.card-logo {
    width: 120px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.5));
}

/* Título de la tarjeta */
.card-title {
    font-size: 14px;
    text-align: center;
    margin-bottom: 20px;
    flex-grow: 1;
    color: #e0e0e0;
}

/* Botón de la tarjeta */
.card-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.card-btn:hover {
    background-color: #007a68;
}

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

/* Burbuja de chat flotante */
.chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    z-index: 100;
    transition: background-color 0.3s, transform 0.2s;
}

.chat-bubble:hover {
    background-color: #333;
    transform: scale(1.05);
}

/* Loading */
.loading {
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px;
    font-size: 16px;
    color: var(--primary-color);
}

/* Modal del reproductor */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.85); 
    backdrop-filter: blur(4px);
}

/* --- DINO TV Red Player UI --- */
.player-modal-content-dino {
    background-color: #1e1e24; /* Fondo oscuro tipo imagen */
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 900px;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 15px 30px rgba(0,0,0,0.8);
    font-family: 'Roboto', sans-serif;
}

.player-title-dino {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
}

.title-underline-dino {
    height: 3px;
    width: 60px;
    background-color: #d80027; /* Línea roja */
    margin-top: 8px;
    margin-bottom: 25px;
}

.dino-options-row {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.dino-opt-btn {
    background-color: #d80027; /* Botón rojo */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dino-opt-btn:hover {
    background-color: #b30020;
}

.dino-opt-btn.active {
    box-shadow: 0 0 0 2px #1e1e24, 0 0 0 4px #d80027; /* Borde activo */
}

.dino-player-box {
    background-color: #000000;
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.dino-player-overlay {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.dino-player-overlay p {
    color: #a0a0a0;
    font-size: 16px;
    margin-bottom: 20px;
}

.dino-btn-activar {
    background-color: #d80027;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    z-index: 2;
}

.dino-btn-activar:hover {
    background-color: #b30020;
}

.dino-btn-activar:active {
    transform: scale(0.98);
}

.dino-player-bottom-line {
    position: absolute;
    bottom: 40px;
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: #d80027;
}

.dino-player-active-area {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #000;
}

.dino-ext-warning {
    background-color: #f2dede;
    color: #a94442;
    padding: 12px 15px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dino-close-warning {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: #a94442;
}

.dino-video-container {
    flex-grow: 1;
    width: 100%;
    position: relative;
}

.dino-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #000;
}

.close-btn {
    color: #aaa;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-btn:hover {
    color: #fff;
}

/* Espacios Publicitarios (Anuncios) */
.ad-container {
    width: 100%;
    background-color: #1a1a1a;
    border: 1px dashed #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.top-ad {
    height: 90px;
    max-width: 728px;
    margin: 0 auto 30px auto;
}

.modal-ad {
    height: 60px;
    margin-top: 20px;
    margin-bottom: 0;
}

/* Footer y Enlaces Legales (AdSense) */
.site-footer {
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    text-align: center;
    margin-top: 50px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.site-footer p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.site-footer .disclaimer {
    font-size: 11px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Paginas Legales (Privacidad, Terminos, etc) */
.legal-content {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    margin: 40px auto;
    border: 1px solid var(--border-color);
}

.legal-content h1, .legal-content h2, .legal-content h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    margin-top: 30px;
}

.legal-content p, .legal-content ul {
    margin-bottom: 15px;
    color: #e0e0e0;
}

.legal-content ul {
    padding-left: 20px;
}

/* Responsividad */
@media (max-width: 768px) {
    .social-sidebar {
        display: none; /* Ocultar sidebar en móviles para ahorrar espacio */
    }
    .container {
        padding-right: 20px;
    }
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .card-logo {
        width: 90px;
        height: 60px;
    }
}