/* =========================================
   SERVICIOS CSS - DISEÑO COMPLETO & FINAL
   ========================================= */

/* --- 1. HEADER SECCIÓN --- */
.services-header {
    text-align: center;
    padding: 50px 20px 50px; /* Espacio superior para no chocar con el menú fijo */
}

.services-header h2 {
    font-size: 3rem;
    color: white;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.services-header span {
    color: #e50914; /* Rojo Techno */
}

.services-header p {
    color: #aaa;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- 2. DASHBOARD DE TENDENCIAS (CARRUSEL ARRIBA) --- */
.trending-dashboard {
    max-width: 1000px;
    margin: 0 auto 80px auto;
    padding: 0 20px;
}

.dashboard-container {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    gap: 40px;
    align-items: center;
    min-height: 400px; /* Altura mínima para evitar saltos al cargar */
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    position: relative;
}

.dashboard-preview img {
    width: 200px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
    transition: opacity 0.3s ease;
}

.dashboard-info {
    flex: 1;
    width: 100%;
}

.dashboard-info h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    display: inline-block;
    color: white;
}

/* GRILLA DE CATEGORÍAS (Películas / Series) */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-box h4 {
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: bold;
}

.stat-box ul {
    list-style: none;
    padding: 0;
}

.stat-box li {
    color: #ccc;
    margin-bottom: 8px;
    font-size: 0.95rem;
    padding-left: 10px;
    border-left: 3px solid #333; /* Color por defecto, cambia con JS */
    transition: border-color 0.3s;
}

/* BOTONES DEL DASHBOARD */
.dashboard-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.control-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.control-btn:hover {
    background: white;
    color: black;
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

/* --- 3. GRILLA DE SERVICIOS (TARJETAS ABAJO) --- */
.services-grid-section {
    padding: 0 5% 100px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* TARJETA INDIVIDUAL */
.service-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
    
    /* Variable CSS para el color dinámico (se llena desde JS) */
    --theme-color: #ffffff; 
}

.service-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--theme-color);
    box-shadow: 0 0 20px var(--theme-color);
}

.service-card img {
    width: 80px;
    height: 80px;
    object-fit: cover; /* Mantiene la proporción cuadrada */
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.service-card h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.service-card p {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 20px;
    min-height: 40px; /* Alinea los botones aunque el texto sea corto */
    line-height: 1.4;
}

/* BOTÓN DE PRECIO */
.price-btn {
    display: inline-block;
    padding: 10px 0;
    background: transparent;
    border: 2px solid var(--theme-color); 
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s;
    width: 100%;
}

.service-card:hover .price-btn {
    background: var(--theme-color);
    color: white;
    box-shadow: 0 0 15px var(--theme-color);
}

/* ESTADO "AGOTADO" O "PRONTO" */
.unavailable {
    opacity: 0.5;
    filter: grayscale(100%);
    pointer-events: none;
    cursor: not-allowed;
}

.soon-btn {
    display: inline-block;
    padding: 10px 0;
    background: #333;
    color: #888;
    border-radius: 25px;
    border: 1px solid #444;
    width: 100%;
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- 4. CARGADOR (SPINNER) --- */
/* Estilos para el círculo de carga */
.loader-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    width: 100%;
    
    /* IMPORTANTE: Hace que ocupe todo el ancho de la grilla */
    grid-column: 1 / -1; 
    
    color: white;
    z-index: 10;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top: 6px solid #e50914; /* Rojo Techno */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.2);
}

.loading-text {
    color: #ccc;
    font-size: 1.1rem;
    letter-spacing: 1px;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

/* ANIMACIONES */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-preview img {
        width: 150px;
        margin-bottom: 20px;
    }
    
    .stats-grid {
        text-align: left; /* Mantiene listas legibles */
        gap: 15px;
    }
    
    .services-header h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr; /* Una sola columna en móviles pequeños */
    }
}