/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.construccion {
    background-color: #9b5951;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 6px;
    width: 100%;
    margin: 0;
}

.construccion svg {
    margin-right: 10px;
}

.construccion p {
    font-weight: 500;
    color: white;
    font-size: 1.2rem;
}


body {
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    border-radius: 8px;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

header h1 {
    margin-bottom: 10px;
    font-size: 2.5rem;
}

/* Área de simulación */
.simulation-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.simulation-area {
    height: 400px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 300px;
}

.chart {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    height: 300px;
}

/* Controles */
.controls-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.parameters, .simulation-controls {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.parameters h2, .simulation-controls h2, .calculations-container h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.parameter-group {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 1fr 80px;
    grid-template-rows: auto auto;
    gap: 5px;
    align-items: center;
}

.parameter-group label {
    grid-column: 1 / 3;
    font-weight: 600;
    color: #2c3e50;
}

.parameter-group input[type="range"] {
    grid-column: 1 / 2;
    width: 100%;
    height: 10px;
    background: #d7dcdf;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.parameter-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
}

.parameter-group input[type="number"] {
    grid-column: 2 / 3;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

/* Botones */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    margin-bottom: 15px;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.primary {
    background-color: #2ecc71;
    color: white;
}

.primary:hover {
    background-color: #27ae60;
}

.secondary {
    background-color: #e74c3c;
    color: white;
}

.secondary:hover {
    background-color: #c0392b;
}

.export-btn {
    background-color: #9b59b6;
    color: white;
}

.export-btn:hover {
    background-color: #8e44ad;
}

/* Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #3498db;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Cálculos */
.calculations-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.calculations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.calculation {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.calculation h3 {
    color: #3498db;
    margin-bottom: 10px;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

table td:first-child {
    font-weight: 600;
}

/* Nuevos estilos para experimentos múltiples y análisis estadístico */
.data-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.statistics-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.statistical-charts {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.chart-wrapper {
    width: 100%;
    height: 300px;
}

.experiments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.experiments-table th,
.experiments-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.experiments-table th {
    background-color: #3498db;
    color: white;
}

.experiments-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.experiments-table tr:hover {
    background-color: #e3f2fd;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.stats-table th,
.stats-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.stats-table th {
    background-color: #2c3e50;
    color: white;
}

.stats-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.actions-row {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

#multiple-experiments {
    accent-color: #3498db;
}

.multiple-active {
    background-color: #2ecc71 !important;
    border: 2px solid #27ae60 !important;
}

.table-container {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 15px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #2c3e50;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

   /* Estilos para mejorar usabilidad en móviles */
   .touch-active {
    opacity: 0.8;
    transform: scale(0.98);
}

/* Evitar selección de texto al manipular controles */
input, button, .slider {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Language toggle button style */
.language-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
}

.language-toggle:hover {
    background-color: #2980b9;
}

/* Responsive */
@media (max-width: 992px) {
    .controls-container,
    .calculations-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .chart {
        height: 300px;
    }
    
    .statistical-charts {
        grid-template-columns: 1fr;
    }

    /* Mejoras para controles en móviles */
    .parameter-group {
        grid-template-columns: 1fr 70px;
    }
    
    .parameter-group input[type="range"] {
        height: 15px;
    }
    
    .parameter-group input[type="range"]::-webkit-slider-thumb {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    /* Mejoras para pantallas pequeñas */
    .simulation-area {
        height: 300px;
    }
    
    .parameter-group label {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 15px;
        font-size: 1rem;
    }
    
    table td {
        font-size: 0.9rem;
        padding: 6px 4px;
    }
}

@media (max-width: 480px) {
    .simulation-area {
        height: 250px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .chart {
        height: 250px;
    }
    
    .parameter-group {
        grid-template-columns: 1fr 60px;
        gap: 3px;
    }
}