/* ==========================================
   RESET Y ESTILOS GLOBALES
   ========================================== */
* { 
    box-sizing: border-box; 
}

body { 
    background-color: #0b0b0c; 
    color: #f1f2f6; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    margin: 0; 
    padding: 0; 
}

header { 
    margin-bottom: 30px; 
    text-align: center; 
}

h1 { 
    color: #ffa502; 
    font-size: 2.2rem; 
    margin: 0 0 10px 0; 
    font-weight: 800; 
}

p { 
    color: #747d8c; 
    margin: 0; 
    font-size: 1rem; 
}

/* ==========================================
   GRILLA PRINCIPAL DE CONTENIDO
   ========================================== */
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 25px; 
    max-width: 1300px; 
    margin: 0 auto; 
    padding: 30px;
    align-items: stretch;
}

/* ==========================================
   TARJETAS DE VIDEO REGULAR
   ========================================== */
.video-card { 
    background-color: #121212; 
    border-radius: 10px; 
    border: 1px solid #1c1c1c; 
    overflow: hidden; 
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.video-card:hover { 
    transform: translateY(-4px); 
    border-color: #333; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.5); 
}

.video-card h3, 
.video-card p { 
    font-size: 14px; 
    font-weight: 500; 
    margin: 12px; 
    color: #e0e0e0; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.video-container { 
    position: relative; 
    width: 100%; 
    height: 0; 
    padding-bottom: 56.25%; /* Relación de aspecto 16:9 */
    background: #000;
    overflow: hidden;
}

.video-container iframe { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    border: none; 
    z-index: 1;
}

/* ==========================================
   CAPA PRE-ROLL SOBRE VIDEOS
   ========================================== */
.preroll-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #000; 
    z-index: 10; 
    display: flex !important; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    opacity: 1; 
    transition: opacity 0.5s ease; 
}

.preroll-loader { 
    border: 4px solid #f3f3f3; 
    border-top: 4px solid #ff3366; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    animation: spin 1s linear infinite; 
    margin-bottom: 10px; 
}

.preroll-text { 
    font-size: 12px; 
    color: #aaa; 
    margin-bottom: 15px; 
}

.preroll-skip { 
    position: absolute; 
    bottom: 15px; 
    right: 15px; 
    background: rgba(0, 0, 0, 0.8); 
    border: 1px solid #444; 
    color: #fff; 
    padding: 6px 12px; 
    font-size: 12px; 
    font-weight: bold; 
    text-decoration: none; 
    border-radius: 4px; 
    display: inline-block; 
    cursor: pointer; 
    z-index: 11; 
}

.preroll-skip:hover { 
    background: #ff3366; 
    border-color: #ff3366; 
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   TARJETAS PROMOCIONALES (ANUNCIOS INYECTADOS)
   ========================================== */
.promo-card { 
    background-color: #121212;
    border: 1px solid #ff3366 !important; 
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(255, 51, 102, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.promo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(255, 51, 102, 0.3);
}

.promo-link { 
    text-decoration: none; 
    color: inherit; 
    display: flex;
    flex-direction: column;
    height: 100%;
}

.promo-thumb { 
    position: relative; 
    width: 100%; 
    padding-top: 56.25%; /* Relación de aspecto 16:9 */
    background: #151515; 
    overflow: hidden;
}

.promo-thumb img { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.promo-badge { 
    position: absolute; 
    top: 10px; 
    left: 10px; 
    background: #ff3366; 
    color: #ffffff; 
    padding: 3px 8px; 
    font-size: 11px; 
    font-weight: bold; 
    border-radius: 3px; 
    text-transform: uppercase; 
    z-index: 2;
}

/* ==========================================
   BOTONES DE ACCIÓN
   ========================================== */
.btn-action { 
    display: block; 
    background: linear-gradient(90deg, #ffa502, #ff7f50); 
    color: #000000; 
    text-decoration: none; 
    text-align: center; 
    padding: 12px; 
    border-radius: 6px; 
    font-weight: bold; 
    margin-top: 15px; 
    font-size: 0.95rem;
    transition: transform 0.1s ease;
}

.btn-action:active { 
    transform: scale(0.98); 
}

/* ==========================================
   PAGINACIÓN
   ========================================== */
.pagination-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px; 
    margin: 40px auto 60px; 
    max-width: 1300px; 
    padding: 0 20px; 
}

.page-link { 
    text-decoration: none; 
    color: #fff; 
    background: #151515; 
    border: 1px solid #222; 
    padding: 10px 16px; 
    border-radius: 5px; 
    font-size: 14px; 
    font-weight: 600; 
    transition: all 0.2s; 
}

.page-link:hover { 
    background: #252525; 
    border-color: #444; 
}

.page-link.active { 
    background: #ffcc00; 
    color: #000; 
    border-color: #ffcc00; 
}

.page-link.disabled { 
    background: #080808; 
    color: #444; 
    border-color: #111; 
    cursor: not-allowed; 
    pointer-events: none; 
}

/* ==========================================
   CONTENEDOR FLOTANTE (ALINEACIÓN HORIZONTAL)
   ========================================== */
.chat-heads-container {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    max-width: calc(100vw - 40px) !important;
}

/* ==========================================
   TARJETA COMPACTA DE MODELO (CARD CHICA)
   ========================================== */
.chat-head-widget {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    display: flex !important;
    align-items: center !important;
    background: #1e1e2f !important;
    border: 1px solid #3a3b5c !important;
    border-radius: 30px !important;
    padding: 6px 14px 6px 6px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    width: auto !important;
    max-width: 260px !important;
    height: auto !important;
}

.chat-head-widget:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8) !important;
}

/* FOTO CIRCULAR (AVATAR) */
.chat-avatar-wrapper {
    position: relative !important;
    width: 42px !important;
    height: 42px !important;
    margin-right: 10px !important;
    flex-shrink: 0 !important;
}

.chat-avatar-wrapper img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #00ff88 !important;
    display: block !important;
}

/* PUNTO VERDE ONLINE */
.online-badge {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 10px !important;
    height: 10px !important;
    background-color: #00ff88 !important;
    border: 2px solid #1e1e2f !important;
    border-radius: 50% !important;
    animation: chatPulse 1.5s infinite !important;
}

/* TEXTO / INFORMACIÓN */
.chat-info {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.chat-name {
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.chat-status {
    color: #a0a0b8 !important;
    font-size: 11px !important;
    margin-top: 2px !important;
    white-space: nowrap !important;
}

/* BOTÓN DE CERRAR (X) */
.chat-close-btn {
    position: absolute !important;
    top: -6px !important;
    left: -6px !important;
    background: #ff4757 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50 !important;
    border-radius: 50% !important;
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
    line-height: 18px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) !important;
    z-index: 100000 !important;
}

.chat-close-btn:hover {
    background: #ff3366 !important;
}

/* ==========================================
   ANIMACIONES
   ========================================== */
@keyframes chatPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 255, 136, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

/* ==========================================
   DISEÑO RESPONSIVO (MÓVILES)
   ========================================== */
@media (max-width: 480px) {
    .grid {
        padding: 15px;
        gap: 15px;
    }
    
    .chat-heads-container {
        bottom: 15px !important;
        left: 15px !important;
    }
}