/* ============================================================================
   GreenCircuit - Estilos Principales
   ============================================================================ 
*/

/* Reset y elementos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  padding: 20px;
  line-height: 1.6;
  background-color: #f5f5f5;
}

h1,
h2,
h3 {
  margin: 15px 0;
}

p {
  margin: 10px 0;
}

/* Secciones */
section {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid #ddd;
  background-color: white;
  border-radius: 5px;
}

/* Footer */
footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  text-align: center;
  color: #666;
}

/* Controles de formulario */
input,
select {
  padding: 8px;
  margin: 5px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

button {
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f0f0f0;
}

button:hover {
  background-color: #e0e0e0;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Clases de utilidad */
.hidden {
  display: none;
}

.info-box {
  background-color: #e3f2fd;
  padding: 10px;
  margin: 10px 0;
  border-left: 4px solid #2196f3;
}

.button-group {
  margin: 10px 0;
}

.execute-container {
  margin-top: 15px;
}

/* Contenedores específicos */
#config-status,
#generation-status,
#execution-status {
  margin-top: 10px;
}

#manual-controls {
  margin-top: 10px;
}

#graph-info {
  margin-bottom: 10px;
}

#graph-container {
  width: 100%;
  height: 500px;
  border: 2px solid #333;
  margin: 10px 0;
  background-color: white;
}

#log-container {
  width: 100%;
  height: 400px;
  border: 2px solid #333;
  overflow-y: auto;
  font-family: "Courier New", monospace;
  font-size: 12px;
  padding: 10px;
  background-color: #f9f9f9;
}

/* Botón de ejecutar */
#btn-execute {
  background-color: #4caf50;
  color: white;
  font-weight: bold;
  padding: 15px 30px;
}

/* Clases de log */
.log-entry {
  margin: 2px 0;
  padding: 2px 0;
}

.log-timestamp {
  color: #666;
  font-size: 10px;
}

.log-header {
  font-weight: bold;
  font-size: 14px;
  color: #2196f3;
}

.log-phase {
  font-weight: bold;
  color: #ff9800;
}

.log-info {
  color: #333;
}

.log-success {
  color: #4caf50;
  font-weight: bold;
}

.log-warning {
  color: #ff9800;
}

.log-error {
  color: #f44336;
  font-weight: bold;
}

.log-cycle {
  color: #9c27b0;
  font-family: monospace;
}

.log-result {
  color: #00796b;
}

.log-savings {
  color: #4caf50;
  font-weight: bold;
}

.log-separator {
  color: #999;
  margin: 10px 0;
}

/* Barra de progreso */
.progress-bar {
  width: 100%;
  height: 20px;
  background-color: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  background-color: #4caf50;
  transition: width 0.3s ease;
}

#progress-text {
  margin-top: 5px;
  font-weight: bold;
}

/* Tablas */
table.adjacency-matrix {
  border-collapse: collapse;
  margin: 10px 0;
  font-family: monospace;
}

table.adjacency-matrix th,
table.adjacency-matrix td {
  padding: 5px;
  border: 1px solid #ccc;
  text-align: center;
}

table.adjacency-matrix th {
  background-color: #f0f0f0;
}

/* ============================================================================
   MODAL PARA AGREGAR NODOS
   ============================================================================ 
*/

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

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

.node-modal {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px;
  background-color: #2196f3;
  color: white;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  color: #333;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
  margin: 0;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2196f3;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 12px;
}

.form-info {
  background-color: #f5f5f5;
  padding: 10px;
  border-radius: 4px;
  margin-top: 15px;
}

.form-info p {
  margin: 5px 0;
  font-size: 13px;
  color: #555;
}

.modal-footer {
  padding: 15px 20px;
  background-color: #f9f9f9;
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  background-color: #fff;
  border: 2px solid #ddd;
  color: #333;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background-color: #f5f5f5;
  border-color: #999;
}

.btn-confirm {
  background-color: #4caf50;
  border: 2px solid #4caf50;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-confirm:hover {
  background-color: #45a049;
  border-color: #45a049;
}

/* Estilos para modo edición */
#btn-toggle-edit {
  background-color: #ff9800;
  color: white;
  font-weight: bold;
  padding: 12px 24px;
}

#btn-toggle-edit.active {
  background-color: #f44336;
}

#btn-toggle-edit:hover {
  background-color: #fb8c00;
}

#btn-toggle-edit.active:hover {
  background-color: #e53935;
}
