* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f4f8;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 20px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 80%;
    max-width: 800px;
}

h1 {
    margin-bottom: 20px;
    color: #333333;
}

.simulation {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.wire-container {
    width: 600px; /* Escala: 1m = 100px para 6m máximo */
    height: 50px;
    position: relative;
    margin-bottom: 20px;
    border: 1px dashed #cccccc;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 10px;
    overflow: hidden;
}

#wire {
    width: 200px; /* L0 = 2m * 100px/m */
    height: 10px;
    background-color: #007BFF;
    transition: width 0.5s, background-color 0.5s, box-shadow 0.5s;
    position: relative;
    z-index: 2;
    box-shadow: none; /* Sombra inicial eliminada */
}

.radiation-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.radiation-effect::before,
.radiation-effect::after {
    content: '';
    position: absolute;
    border: 2px solid rgba(255, 69, 0, 0.5);
    border-radius: 50%;
    animation: radiation 2s infinite;
}

.radiation-effect::before {
    width: 100px;
    height: 100px;
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.radiation-effect::after {
    width: 150px;
    height: 150px;
    top: -75px;
    left: -75px;
    animation-delay: 1s;
}

@keyframes radiation {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.heat-source {
    width: 50px;
    height: 50px;
    background-color: #555555;
    position: relative;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.flame {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid #FF4500;
    animation: flicker 1s infinite;
}

@keyframes flicker {
    0% { transform: translateY(0px); opacity: 1; }
    50% { transform: translateY(-5px); opacity: 0.7; }
    100% { transform: translateY(0px); opacity: 1; }
}

.controls {
    margin-top: 20px;
}

.control-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1em;
    color: #333333;
}

select, input[type=range] {
    width: 100%;
    padding: 8px;
    font-size: 1em;
    border: 1px solid #cccccc;
    border-radius: 5px;
}

input[type=range] {
    margin: 10px 0;
}

p {
    margin-top: 10px;
    font-size: 1.1em;
    color: #333333;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #007BFF;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

/* Contenedor de la gráfica */
.chart-container {
    margin-top: 20px;
}

/* Modal Styles */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4); /* Fondo semi-transparente */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% desde la parte superior y centrado */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    text-align: left;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
}

/* Sombra dinámica para el alambre cuando alcanza 1000°C y más */
#wire.shadow-active {
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.7); /* Sombra roja intensa */
}
