/* =========================================
   1. RESET Y ESTILOS GLOBALES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #fff;
    background: #000;
    overflow-x: hidden;
}

/* Transiciones de página */
.page-container {
    min-height: 100vh;
    animation: fadeInPage 0.5s ease-out;
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Elementos Flotantes (Fondo) */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* =========================================
   2. HERO SECTION
   ========================================= */
.hero {
    height: 100vh;
    background: linear-gradient(45deg, rgba(139, 0, 0, 0.9), rgba(0, 0, 0, 0.9)), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><rect fill="%23222" width="1000" height="1000"/><circle cx="200" cy="200" r="50" fill="%23333" opacity="0.3"/><circle cx="800" cy="300" r="30" fill="%23444" opacity="0.5"/><circle cx="400" cy="700" r="40" fill="%23333" opacity="0.4"/></svg>');
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(220, 20, 60, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
    animation: pulseBackground 4s ease-in-out infinite alternate;
}

@keyframes pulseBackground {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    animation: fadeInUp 1.2s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 900;
    text-transform: uppercase;
    background: linear-gradient(45deg, #ff6b6b, #ffd700, #ff6b6b);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeIn 1.5s ease-out 0.5s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.hero-logo {
    margin-bottom: 2rem;
    text-align: center;
}

.hero-logo-img {
    height: 120px;
    width: auto;
    border-radius: 15px;
    border: 3px solid #ffd700;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) scale(1); box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4); }
    50% { transform: translateY(-10px) scale(1.02); box-shadow: 0 20px 40px rgba(255, 215, 0, 0.6); }
}

/* =========================================
   3. BOTONES (CTA)
   ========================================= */
.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(45deg, #dc143c, #ff6b6b);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(220, 20, 60, 0.4);
    margin: 0.5rem;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(220, 20, 60, 0.6);
}

/* =========================================
   4. NAVEGACIÓN
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.95);
    padding: 0.5rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffd700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1600; /* Asegura que el logo se vea sobre el menú móvil si es necesario */
}

.logo:hover {
    transform: translateY(-2px);
}

.logo-img {
    height: 50px;
    width: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.logo:hover .logo-img {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.logo-text {
    background: linear-gradient(45deg, #ffd700, #ff6b6b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ff6b6b;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* =========================================
   5. SECCIONES Y COMPONENTES
   ========================================= */
.section {
    padding: 80px 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.section h2 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, #ffd700, #ff6b6b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(45deg, #ffd700, #ff6b6b);
    border-radius: 2px;
}

/* About Content */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 2rem;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 1s ease-out forwards;
}

@keyframes slideInLeft {
    to { opacity: 1; transform: translateX(0); }
}

.about-image {
    background: linear-gradient(45deg, #dc143c, #ff6b6b);
    height: 400px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(220, 20, 60, 0.3);
    transform: translateX(50px);
    opacity: 0;
    animation: slideInRight 1s ease-out forwards;
    overflow: hidden;
    position: relative;
    padding: 0.5rem;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid #ffd700;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.about-image:hover img {
    transform: scale(1.05);
}

@keyframes slideInRight {
    to { opacity: 1; transform: translateX(0); }
}

/* Schedule / Info Cards */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.schedule-card {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1), rgba(0, 0, 0, 0.8));
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.schedule-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(220, 20, 60, 0.3);
    border-color: #ffd700;
}

.schedule-card h3 {
    color: #ffd700;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.time-slot {
    background: rgba(255, 107, 107, 0.2);
    padding: 0.8rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    font-weight: bold;
    border-left: 3px solid #ff6b6b;
}

/* Class Cards */
.class-card {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1), rgba(0, 0, 0, 0.8));
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.class-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(220, 20, 60, 0.3);
    border-color: #ffd700;
}

.class-title {
    color: #ffd700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.class-description {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.instructor {
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Gallery General */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    background: linear-gradient(45deg, #dc143c, #ff6b6b);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 400px;
    text-align: center;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(220, 20, 60, 0.4);
}

.gallery-item span {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.gallery-item img {
    width: 45%;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0.3rem;
    border: 2px solid #ffd700;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.gallery-item img:hover {
    transform: scale(1.1);
    border-color: #fff;
    z-index: 3;
    position: relative;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 2rem;
}

.contact-info {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1), rgba(0, 0, 0, 0.8));
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.contact-info h3 {
    color: #ffd700;
    margin-bottom: 1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.submit-btn {
    background: linear-gradient(45deg, #dc143c, #ff6b6b);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 20, 60, 0.4);
}

/* Footer */
.footer {
    background: #000;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
}

/* =========================================
   6. MAPA ESTILIZADO
   ========================================= */
.simple-map-container {
    width: 100%;
    max-width: 400px;
}

.simple-map {
    display: block;
    width: 100%;
    height: 300px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.simple-map:hover {
    transform: scale(1.02);
}

/* =========================================
   8. RESPONSIVE Y MENÚ MÓVIL (CORREGIDO)
   ========================================= */

/* Por defecto el botón hamburguesa está oculto en PC */
.menu-toggle {
    display: none;
    cursor: pointer;
    z-index: 2000; /* Siempre encima de todo */
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: #ffd700; /* Dorado */
}

/* Reglas solo para celulares */
@media (max-width: 768px) {
    /* 1. Ajustes de texto y estructura general */
    .hero h1 { font-size: 2.5rem; }
    .section { padding-left: 1rem; padding-right: 1rem; }
    
    .about-content, 
    .contact-content, 
    .schedule-grid, 
    .gallery-grid,
    .simple-gallery-grid {
        grid-template-columns: 1fr; /* Todo a una columna */
        gap: 2rem;
    }

    /* 2. Mostrar el botón del menú */
    .menu-toggle {
        display: block;
    }

    /* 3. Animación del botón (la X) */
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* 4. EL MENÚ DESPLEGABLE (PANTALLA COMPLETA) */
    .nav-menu {
        position: fixed; /* Flotante, no empuja el contenido */
        left: -100%;     /* Oculto a la izquierda */
        top: 0;
        flex-direction: column;
        background-color: #000; /* Fondo negro sólido */
        width: 100%;
        height: 100vh;   /* Ocupa toda la altura de la pantalla */
        text-align: center;
        transition: 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        display: flex;   /* Para centrar los elementos */
        justify-content: center; /* Centrado vertical */
        align-items: center;     /* Centrado horizontal */
        z-index: 1500;   /* Debajo del botón hamburguesa pero encima del resto */
        padding: 0;
    }

    .nav-menu.active {
        left: 0; /* Aparece */
    }

    .nav-menu li {
        margin: 1.5rem 0; /* Espacio entre enlaces */
    }
    
    .nav-menu a {
        font-size: 1.5rem; /* Letra más grande para tocar fácil */
    }

    /* 5. Ajustes de imágenes y logo */
    .logo { font-size: 1.4rem; z-index: 1600; position: relative; }
    .logo-img { height: 40px; }
    .logo-text { display: none; } /* Ocultar texto del logo para espacio */
    .hero-logo-img { height: 80px; }
    
    /* Resetear estilos complejos de imagen para móvil */
    .about-image {
        background: none !important;
        height: auto !important;
        border-radius: 20px;
        display: block;
        box-shadow: none !important;
        transform: none !important;
        opacity: 1 !important;
        animation: none !important;
        padding: 0;
    }
    
    /* Galería normal en móvil */
    .gallery-item {
        min-height: auto;
    }
    .gallery-item img {
        width: 45%;
        height: 100px;
    }
    
    /* Mapa en móvil */
    .simple-map-container {
        width: 100% !important;
    }
}

/* =========================================
   9. ESTILOS DE GALERÍA MINIMALISTA (NUEVO)
   ========================================= */

/* El contenedor de la rejilla */
.simple-gallery-grid {
    display: grid;
    /* Esto es magia: crea tantas columnas como quepan, 
       con un ancho mínimo de 280px por foto. Se adapta a cualquier pantalla. */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Un buen espacio entre fotos como pediste */
    gap: 1.5rem; 
    padding: 1rem 0;
}

/* El envoltorio de cada imagen individual */
.gallery-image-wrapper {
    /* Le damos una altura fija para que todas se vean uniformes */
    height: 300px; 
    border-radius: 12px; /* Bordes redondeados suaves */
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); /* Sombra sutil para profundidad */
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* La imagen dentro del envoltorio */
.gallery-image-wrapper img {
    width: 100%;
    height: 100%;
    /* 'cover' es CLAVE: recorta la imagen para llenar el cuadro 
       sin estirarla ni deformarla, sin importar si la foto es vertical u horizontal. */
    object-fit: cover; 
    transition: transform 0.5s ease;
    display: block;
}

/* Efecto suave al pasar el mouse */
.gallery-image-wrapper:hover img {
    transform: scale(1.08); /* Un ligero zoom */
}

/* Ajuste para celulares: fotos un poco más bajas */
@media (max-width: 768px) {
    .simple-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(45%, 1fr)); /* 2 por fila en móvil */
        gap: 1rem;
    }
    .gallery-image-wrapper {
        height: 200px;
    }
}