/* Estilo profesional con íconos y animaciones suaves */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-in-out;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal-content {
    background: #fff;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.5s ease-in-out;
}

@keyframes slideUp {
    from {transform: translateY(30px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

#openCalcModal {
    padding: 12px 24px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

#openCalcModal i {
    margin-right: 8px;
}

#openCalcModal:hover {
    background-color: #005f8d;
    transform: scale(1.02);
}

#calcForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#calcForm label {
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#calcForm input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

#calcForm select {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="gray" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    cursor: pointer;
}


#calcForm button[type="submit"] {
    background-color: #28a745;
    color: white;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

#calcForm button[type="submit"]:hover {
    background-color: #218838;
    transform: scale(1.02);
}

#resultadoTexto {
    margin-top: 1rem;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

canvas#graficoRendimiento {
    margin-top: 1rem;
    max-width: 100%;
}

/* Responsive */
@media (max-width: 600px) {
    .modal-content {
        padding: 1rem;
    }

    #openCalcModal {
        width: 100%;
    }

    #calcForm button[type="submit"] {
        width: 100%;
    }
}

/* Centrado del modal */
#calcModal.modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    padding: 1rem;
    box-sizing: border-box;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.5s ease-in-out;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #333333; /* CAMBIADO de #ffffff a un gris oscuro visible */
    cursor: pointer;
    z-index: 100000;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ff4d4d;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 1rem;
        max-width: 90vw;
    }
    .close-modal {
        top: -6px !important;
        right: 8px !important;
    }
}
