body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinea al inicio verticalmente */
    min-height: 100vh;
    margin: 20px 0; /* Margen superior e inferior para espacio */
    color: #333;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #0056b3;
    margin-bottom: 30px;
    font-size: 2em;
}

h2 {
    color: #007bff;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    font-size: 1.6em;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
textarea,
select {
    width: calc(100% - 20px); /* Ajuste para padding */
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Incluye padding y borde en el ancho total */
}

textarea {
    resize: vertical; /* Permite redimensionar verticalmente */
    min-height: 120px;
}

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, transform 0.2s ease;
    margin-right: 10px; /* Espacio entre botones */
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 30px;
    height: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #28a745; /* Color de progreso verde */
    border-radius: 5px;
    transition: width 0.4s ease-in-out;
}

.step {
    padding: 20px 0;
    border-top: 1px dashed #e9ecef;
    margin-top: 20px;
}

.step:first-child {
    border-top: none;
    margin-top: 0;
}

.loading-spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #007bff; /* Blue */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#projectPreview, #finalProjectOutput {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
    margin-top: 20px;
    max-height: 500px; /* Altura máxima para el scroll */
    overflow-y: auto; /* Scroll si el contenido es muy largo */
}

#projectPreview p, #finalProjectOutput p {
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

/* Estilos para el HTML generado, si Gemini lo incluye */
#projectPreview h2, #finalProjectOutput h2 {
    color: #0056b3;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.8em;
    border-bottom: 1px solid #a2c6eb;
    padding-bottom: 5px;
}

#projectPreview h3, #finalProjectOutput h3 {
    color: #007bff;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.4em;
}

#projectPreview p, #finalProjectOutput p,
#projectPreview ul, #finalProjectOutput ul,
#projectPreview table, #finalProjectOutput table {
    margin-bottom: 15px;
    line-height: 1.6;
}

#projectPreview ul, #finalProjectOutput ul {
    list-style-type: disc;
    padding-left: 25px;
}

#projectPreview li, #finalProjectOutput li {
    margin-bottom: 8px;
}

#projectPreview table, #finalProjectOutput table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

#projectPreview th, #finalProjectOutput th,
#projectPreview td, #finalProjectOutput td {
    border: 1px solid #dee2e6;
    padding: 10px;
    text-align: left;
}

#projectPreview th, #finalProjectOutput th {
    background-color: #f1f5f9;
    font-weight: bold;
    color: #333;
}

/* Nuevos estilos para la cuadrícula de áreas */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Columnas adaptables */
    gap: 15px; /* Espacio entre los elementos de la cuadrícula */
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.areas-grid label {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre el checkbox y el texto */
    font-weight: normal; /* El texto de la etiqueta no tan negrita como los títulos */
    cursor: pointer;
    background-color: #ffffff;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease-in-out;
}

.areas-grid label:hover {
    background-color: #e6f2ff; /* Color al pasar el ratón */
    border-color: #007bff;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.1);
}

.areas-grid input[type="checkbox"] {
    appearance: none; /* Oculta el checkbox nativo */
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0; /* Evita que el checkbox se encoja */
}

.areas-grid input[type="checkbox"]:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.areas-grid input[type="checkbox"]:checked::before {
    content: '✔'; /* Símbolo de check */
    font-size: 14px;
    color: white;
}