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

body { 
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: block;
    padding: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    margin: 2rem auto;
}

h1 { 
    color: #fff;
    text-align: center;
    background: linear-gradient(135deg, #cc001f 0%, #ff0a3a 100%);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(204, 0, 31, 0.4);
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo-h1 {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: brightness(1) invert(0);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

li {
    margin: 0;
}

a { 
    display: block;
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    background: #fff;
}

a:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

a:active {
    transform: translateY(-4px) scale(0.98);
}

/* Estructura de figure */
figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Imagen del curso */
.course-image {
    width: 100%;
    height: 150px;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
}

/* Overlay sutil sobre la imagen */
.course-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
    transition: opacity 0.3s ease;
}

a:hover .course-image::after {
    opacity: 0.5;
}

/* Figcaption - Pie de imagen */
figcaption {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 100px;
    justify-content: center;
}

.course-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.course-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    text-align: center;
}

/* Imágenes de fondo para cada proyecto */
li:nth-child(1) .course-image { background-image: url('../images/IntroducionProgramacion.png'); }
li:nth-child(2) .course-image { background-image: url('../images/Python.png'); }
li:nth-child(3) .course-image { background-image: url('../images/BBDD.png'); }
li:nth-child(4) .course-image { background-image: url('../images/Python_Avanzado.png'); }
li:nth-child(5) .course-image { background-image: url('../images/JAVA.png'); }
li:nth-child(6) .course-image { background-image: url('../images/ciberseguridad.png'); }

/* Gradientes diferentes para el figcaption de cada curso */
li:nth-child(1) figcaption { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
li:nth-child(2) figcaption { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
li:nth-child(3) figcaption { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
li:nth-child(4) figcaption { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
li:nth-child(5) figcaption { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
li:nth-child(6) figcaption { background: linear-gradient(135deg, #f00707 0%, #272010 100%); }


/* ==================== FOOTER ==================== */

footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 2.5rem 2rem 1.5rem;
    margin-top: 2rem;
    width: 100%;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

.footer-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2rem;
    text-align: center;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* Sección de redes sociales */
.social-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: transform 0.3s ease;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

.social-item:hover {
    transform: translateX(8px) scale(1);
    box-shadow: none;
}

.social-item:active {
    transform: translateX(8px) scale(1);
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.social-icon.facebook {
    background: linear-gradient(135deg, #1877f2, #0d65d9);
}

.social-icon.linkedin {
    background: #0077b5;
}

.social-icon svg {
    width: 28px;
    height: 28px;
}

.social-icon.facebook svg {
    fill: #fff;
}

.social-icon.linkedin svg {
    fill: #fff;
}

.social-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.2rem 0;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

.social-info p {
    font-size: 0.9rem;
    color: #aaa;
    margin: 0;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

/* Formulario de contacto */
.contact-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.8rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-form h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1.5rem 0;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

.form-group {
    margin-bottom: 1rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: #667eea;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Copyright */
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        padding: 2rem 1.5rem;
        margin: 1.5rem;
        border-radius: 20px;
    }
    
    h1 {
        font-size: 1.5rem;
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo-h1 {
        width: 60px;
        height: 60px;
    }
    
    ul {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .course-image {
        height: 130px;
    }

    .course-title {
        font-size: 1.1rem;
    }

    figcaption {
        padding: 1.2rem;
        min-height: 90px;
    }

    /* Footer responsive */
    footer {
        padding: 2rem 1.5rem 1.5rem;
        margin-top: 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .social-section {
        order: 2;
    }

    .contact-form {
        order: 1;
        padding: 1.5rem;
    }

    .contact-form h2 {
        font-size: 1.3rem;
    }

    .social-icon {
        width: 45px;
        height: 45px;
    }

    .social-icon svg {
        width: 24px;
        height: 24px;
    }

    .social-info h3 {
        font-size: 1.1rem;
    }

    .social-info p {
        font-size: 0.85rem;
    }
}

/* Para pantallas grandes, centrar los dos últimos */
@media (min-width: 769px) {
    ul {
        grid-template-columns: repeat(6, 1fr);
    }

    /* Los 6 primeros proyectos ocupan 2 columnas cada uno (3 por fila) */
    li:nth-child(1), li:nth-child(2), li:nth-child(3),
    li:nth-child(4), li:nth-child(5), li:nth-child(6) {
        grid-column: span 2;
    }

    /* Proyectos 7 y 8 centrados */
    li:nth-child(7) {
        grid-column: 2 / 4;
    }

    li:nth-child(8) {
        grid-column: 4 / 6;
    }
}

@media (max-width: 968px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-title {
        font-size: 1.8rem;
    }

    .social-section {
        order: 2;
    }

    .contact-form {
        order: 1;
    }
}