/* 
   PALETA DE COLORES APLICADA:
   - Fondo General: #121212 (Gris muy oscuro, casi negro)
   - Fondo Tarjetas/Contenedores: #1E1E1E (Gris oscuro suave)
   - Texto Principal: #E0E0E0 (Blanco humo)
   - Texto Secundario: #A0A0A0 (Gris medio)
   - Acento Primario (Botones/Hover): #00E5FF (Cian Neón / Cyberpunk)
   - Acento Secundario: #7B61FF (Violeta Neón)
   - Footer: #0D0D0D
*/

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212; /* Fondo oscuro principal */
    color: #E0E0E0; /* Texto claro para contraste */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* Partículas: Fondo sutil para dar profundidad */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    left: 0;
    background: radial-gradient(circle at center, #1a1a2e 0%, #121212 100%);
}

header {
    text-align: center;
    margin-top: 40px; /* Más espacio para respetar el diseño */
    margin-bottom: 40px;
    z-index: 1;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.main-title {
    font-size: 4.5em;
    margin: 10px 0;
    line-height: 1.1;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.3); /* Resplandor sutil */
    font-weight: 800;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 2em;
    margin: 0;
    color: #00E5FF; /* Color de acento para el subtítulo */
    font-weight: 300;
}

/* Contenedor horizontal de las tarjetas de categoría */
.horizontal-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: 1400px;
    z-index: 1;
    margin-bottom: 60px;
}

/* Estilo de las tarjetas (Secciones) */
.section {
    flex: 1 1 300px;
    max-width: 350px;
    margin: 15px;
    background-color: #1E1E1E; /* Fondo tarjeta oscuro */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); /* Sombra más profunda */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: normal;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    border: 1px solid #333; /* Borde sutil */
}

.section:hover {
    transform: translateY(-5px); /* Levantamiento suave */
    border-color: #00E5FF; /* Borde neón al hacer hover */
    box-shadow: 0 10px 25px rgba(0, 229, 255, 0.15);
}

.section img {
    width: 100%;
    height: 200px;
    border-radius: 12px 12px 0 0;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.section:hover img {
    opacity: 1;
}

.section h2 {
    margin: 15px;
    text-align: center;
    font-size: 1.4em;
    color: #fff;
    font-weight: 600;
}

/* Contenedor de la galería tipo Masonry */
.gallery-container {
    position: relative;
    padding: 20px;
    width: 100%;
    max-width: 1400px;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 80px;
}

.gallery {
    column-count: 4; 
    column-gap: 15px;
}

.galeria-video, .galeria-img {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 10px;
    display: block;
    break-inside: avoid;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #252525; /* Fondo mientras carga */
    border: 1px solid transparent;
}

.galeria-video {
    background-color: #000;
    border: 1px solid #333;
}

.galeria-img {
    object-fit: cover; /* Recorte artístico para Masonry */
}

/* Hover en galería: efecto neón */
.galeria-video:hover, .galeria-img:hover {
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0, 229, 255, 0.2);
    border-color: #7B61FF; /* Borde violeta en hover */
}

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95); /* Fondo casi negro */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
    backdrop-filter: blur(5px);
}

#lightbox img, #lightbox-video {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.15);
    border: 1px solid #333;
}

/* --- MEDIA QUERIES --- */

/* Tablets */
@media (max-width: 1024px) {
    .main-title { font-size: 3.5em; }
    .subtitle { font-size: 1.5em; color: #7B61FF; }
    
    .section {
        flex: 1 1 45%;
        max-width: 48%;
    }

    .gallery {
        column-count: 3;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .main-title { font-size: 2.5em; }
    .subtitle { font-size: 1.2em; }

    .section {
        flex: 1 1 100%;
        max-width: 100%;
        margin: 10px 0;
    }

    .section img { height: 180px; }
    .section h2 { font-size: 1.2em; }

    .gallery {
        column-count: 2;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .main-title { font-size: 2em; }
    .subtitle { font-size: 1em; }

    .section img { height: 160px; }
    
    .back-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 20px;
        left: 10px;
    }

    .gallery {
        column-count: 1;
        column-gap: 0;
    }

    .galeria-video, .galeria-img {
        margin-bottom: 10px;
        width: 100%;
        max-width: 100%;
    }
}

/* Tipografía Fredoka si se usa en HTML */
.fredoka {
    font-family: "Fredoka", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500; /* Un poco más grueso para legibilidad en fondo oscuro */
    font-style: normal;
}

/* Botón de regreso estilizado */
.back-button {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 70px;
    height: 70px;
    /* Gradiente moderno para el botón */
    background: linear-gradient(135deg, #00E5FF 0%, #7B61FF 100%);
    color: #000; /* Texto negro para contraste en neón */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.4);
    z-index: 50;
    transition: transform 0.2s, box-shadow 0.3s;
    border: none;
}

.back-button:active { transform: scale(0.95); }
.back-button:hover { 
    box-shadow: 0 6px 20px rgba(123, 97, 255, 0.6);
    transform: translateY(-2px);
}

footer {
    background-color: transparent; /* Fondo totalmente invisible */
    color: #888; 
    text-align: center;
    padding: 25px 0;
    width: 100%;
  
    margin-top: auto;
    z-index: 10;
    font-size: 0.9em;
    
    /* Recomendación: Añade una sombra al texto para que se lea bien sobre el fondo animado */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}