/* style.css */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 20px; background-color: #f4f7f6; color: #333; }

/* --- NUEVO LAYOUT PARA ANUNCIOS --- */
.contenedor-global { display: grid; grid-template-columns: 1fr minmax(auto, 900px) 1fr; gap: 20px; align-items: start; max-width: 1400px; margin: 0 auto; }
.contenido-principal { display: flex; flex-direction: column; width: 100%; }

.espacio-anuncio { background-color: #e8eaea; border: 2px dashed #bdc3c7; border-radius: 10px; height: 600px; display: flex; align-items: center; justify-content: center; color: #7f8c8d; font-weight: bold; position: sticky; top: 20px; }

.pie-pagina { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 2px solid #ddd; padding-bottom: 20px; }
.pie-pagina a { color: #2c3e50; text-decoration: none; margin: 0 15px; font-weight: bold; }
.pie-pagina a:hover { color: #3498db; text-decoration: underline; }

/* Ocultar anuncios en pantallas pequeñas (celulares/tablets) */
@media (max-width: 1100px) {
    .contenedor-global { grid-template-columns: 1fr; }
    .espacio-anuncio { display: none; }
}
/* ---------------------------------- */

.cabecera-app { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 3px solid #2c3e50; padding-bottom: 10px; }
.cabecera-app h1 { margin: 0; color: #2c3e50; font-size: 2.2em; letter-spacing: -0.5px; }
.selector-idioma { display: flex; align-items: center; gap: 8px; background: white; padding: 5px 10px; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid #ddd; }
.selector-idioma select { border: none; outline: none; font-size: 1em; cursor: pointer; background: transparent; color: #2c3e50; font-weight: bold; }

.layout-principal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; align-items: stretch; }
@media (max-width: 800px) { .layout-principal { grid-template-columns: 1fr; } .cabecera-app { flex-direction: column; align-items: flex-start; gap: 15px; } }

.tarjeta { background: white; padding: 25px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.05); display: flex; flex-direction: column; min-width: 0; }
.tarjeta-scroll { max-height: 450px; }
h2 { margin-top: 0; color: #2c3e50; font-size: 1.4em; }
.subtitulo { margin-top: 0; color: #666; margin-bottom: 20px;}

.tabla-interpolacion { display: flex; flex-direction: column; gap: 10px; margin-bottom: 25px; }
.fila-cabecera { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; text-align: center; font-weight: bold; color: #444; border-bottom: 2px solid #2c3e50; padding-bottom: 8px; margin-bottom: 5px; }
.fila-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* CORRECCIÓN: Ajuste de anchos para evitar desbordamiento */
input[type=number] { 
    -moz-appearance: textfield; 
    text-align: center; 
    padding: 12px; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    font-size: 16px; 
    outline: none; 
    transition: 0.3s;
    width: 100%; /* Fuerza al input a no crecer más del 100% de su celda */
    box-sizing: border-box; /* Asegura que el padding no engorde la casilla */
}

input[type=number]:focus { border-color: #3498db; box-shadow: 0 0 5px rgba(52, 152, 219, 0.2); }
.calculado { background-color: #e8f4f8 !important; border-color: #3498db !important; color: #2980b9; font-weight: bold; }

button.btn-calcular { padding: 12px; background-color: #2c3e50; color: white; border: none; border-radius: 5px; cursor: pointer; width: 100%; font-size: 16px; font-weight: bold; transition: 0.3s; margin-top: auto; }
button.btn-calcular:hover { background-color: #1a252f; }

.btn-exportar { padding: 10px; background-color: #27ae60; color: white; border: none; border-radius: 5px; cursor: pointer; width: 100%; font-size: 15px; font-weight: bold; transition: 0.3s; margin-top: 15px; }
.btn-exportar:hover { background-color: #219653; }

.btn-editar { cursor: pointer; font-size: 0.9em; margin-left: 5px; opacity: 0.6; transition: 0.2s; user-select: none; }
.btn-editar:hover { opacity: 1; transform: scale(1.2); color: #3498db; }

.grafica-wrapper { position: relative; flex-grow: 1; width: 100%; min-height: 250px; }
.bg-secundario { background-color: #fafafa; border: 1px dashed #ccc; box-shadow: none; }

.contenedor-tabla { overflow-y: auto; flex-grow: 1; border: 1px solid #eee; border-radius: 5px; max-height: 300px; }
.contenedor-tabla::-webkit-scrollbar { width: 8px; }
.contenedor-tabla::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.contenedor-tabla::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.contenedor-tabla::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
thead { position: sticky; top: 0; background-color: #2c3e50; z-index: 1; }
th, td { padding: 12px 5px; text-align: center; border-bottom: 1px solid #ddd; }
th { color: white; }
tr.fila-historial:hover { background-color: #e8f4f8; cursor: pointer; transition: 0.2s; }

.btn-borrar { background: none; border: none; font-size: 1.2em; cursor: pointer; opacity: 0; transition: opacity 0.2s, transform 0.2s; padding: 0; color: #e74c3c; visibility: hidden; }
tr.fila-historial:hover .btn-borrar { opacity: 0.6; visibility: visible; }
.btn-borrar:hover { opacity: 1 !important; transform: scale(1.2); }

.ayuda-clic { font-size: 0.8em; color: #7f8c8d; font-weight: normal; margin-left: 10px; }
.mensaje-vacio { text-align: center; color: #999; margin-top: 20px; }
.mensaje-flotante { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #999; text-align: center; width: 100%; pointer-events: none; }

.caja-formula { background-color: #f8f9fa; padding: 20px; border-radius: 5px; text-align: center; font-size: 1.3em; margin: 15px 0; border: 1px dashed #ccc; }
.texto-centrado { text-align: center; color: #555; margin-bottom: 30px; }
.text-bold { font-weight: bold; }
.lista-pasos { line-height: 1.6; color: #444; margin-left: 20px; }