/* css/style.css */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.container {
    max-width: 800px;
    margin: 30px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
}
.header {
    text-align: center;
    margin-bottom: 25px;
}
.header h1 {
    color: #004466; /* Azul oscuro Topotech */
    margin-bottom: 10px;
}
.header p {
    color: #666;
    font-size: 1.1em;
}
.main-content { /* Este estilo era del diseño anterior, ya no se usa con el course-grid */
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}
.course-info { /* Este estilo era del diseño anterior, ya no se usa con el course-grid */
    flex: 2;
    min-width: 300px;
}
.course-info h2 {
    color: #007bff; /* Azul vibrante */
    margin-top: 0;
}
.course-info p {
    line-height: 1.6;
}
.price-info { /* Este estilo era del diseño anterior, ya no se usa con el course-grid */
    flex: 1;
    min-width: 200px;
    background-color: #e9f7ef; /* Fondo suave para el precio */
    border: 1px solid #d0ecc0;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.current-price { /* Este estilo era del diseño anterior, ya no se usa con el course-grid */
    font-size: 2.5em;
    font-weight: bold;
    color: #28a745; /* Verde */
    margin: 0 0 15px 0;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: calc(100% - 20px); /* Ajuste para padding */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}
.form-actions {
    text-align: center;
    margin-top: 30px;
}
.button {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}
.button:hover {
    background-color: #0056b3;
}
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}
footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: white;
    margin-top: auto; /* Empuja el footer hacia abajo */
}

/* Estilos del modal - Copiados de tu original, si no usas modal.css */
/* Si ya tienes un modal.css, estas reglas podrían duplicarse o sobrescribirse */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%; /* Could be more responsive */
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
}

.modal-content h3 {
    color: #004466;
    margin-top: 0;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 25px;
    line-height: 1.5;
}

#closeModal {
    background-color: #f44336; /* Red */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

#closeModal:hover {
    background-color: #da190b;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    .course-info, .price-info {
        min-width: unset;
        width: 100%;
    }
    .container {
        margin: 15px;
        padding: 20px;
    }
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"] {
        width: calc(100% - 20px);
    }
}

/* AÑADIR NUEVOS ESTILOS PARA LAS TARJETAS DE CURSO */
/* Estos son los estilos que propuse para el nuevo diseño de las "cajas" de cursos */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 2-3 columnas responsivas */
    gap: 25px;
    margin-top: 20px;
    justify-content: center;
}

.course-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden; /* Para que la imagen no se salga */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.course-card img {
    width: 100%;
    height: 200px; /* Altura fija para las imágenes */
    object-fit: cover; /* Recorta la imagen para cubrir el espacio */
    border-bottom: 1px solid #eee;
}

.course-card-content {
    padding: 20px;
    flex-grow: 1; /* Permite que el contenido se expanda */
}

.course-card-content h3 {
    color: #004466;
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: left; /* Alineación del título del curso */
}

.course-card-content p {
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
}

.course-card-content ul {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.course-card-content ul li {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.course-card-content ul li::before {
    content: '•'; /* Un pequeño punto como viñeta */
    color: #007bff;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.course-card-footer {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Para que los elementos se envuelvan en pantallas pequeñas */
}

.course-card-price {
    font-size: 1.6em;
    font-weight: bold;
    color: #28a745; /* Verde */
    margin-right: 10px;
}

/* Asegurar que el botón de inscripción en la tarjeta siga los estilos generales */
.enroll-button { /* Asumiendo que el botón tendrá esta clase */
    background-color: #007bff;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.enroll-button:hover {
    background-color: #0056b3;
}

/* Responsive de las tarjetas */
@media (max-width: 600px) {
    .course-grid {
        grid-template-columns: 1fr; /* Una sola columna en pantallas muy pequeñas */
    }
    .course-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .course-card-price {
        margin-bottom: 10px;
        text-align: center;
    }
    .enroll-button {
        width: 100%;
    }
}