* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  height: 100vh;
  font-family: 'Inter', sans-serif;
  background-color: #0a0f1a;
  color: #00e6ff;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  min-width: 200px;
  background-color: #071c3a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;

}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 90px;
}

.guardadas {
    color: #b4e6ff;
  font-size: 0.9rem;
  display: flex;
  justify-self: flex-start;
}

.bottom-icons {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding-bottom: 10px;
}

.bottom-icons img {
  width: 24px;
  height: 24px;
  cursor: pointer;
}


main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  background-image: url('../images/pantalla_inicio.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  gap: 30px;
}

/* Estilo visual brillante para el contenedor de input */
.contenedor-input {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  width: 90%;
  max-width: 800px;
  padding-left: 20px;
}

.titulo {
  font-size: 1.8rem;
  color: #00e6ff;
  text-shadow: 0 0 12px #00e6ff;
  margin-bottom: 15px;
  z-index: 1;
}

.moleculas-input {
  width: 100%;
  height: 250px;
  background-color: #08182f;
  border: 2px solid #00e6ff;
  border-radius: 25px;
  padding: 20px;
  color: #00e6ff;
  font-size: 1rem;
  box-shadow: 0 0 20px #00e6ff88;
  z-index: 1;
  outline: none;
}

/* Centrado absoluto del botón */
.div-boton {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.btn-generar {
  padding: 15px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  border: 2px solid #00e6ff;
  border-radius: 30px;
  background-color: transparent;
  color: #00e6ff;
  box-shadow: 0 0 12px #00e6ff;
  transition: all 0.3s ease;
  z-index: 1;
}

.btn-generar:hover {
  cursor: pointer;
  background-color: #00e6ff;
  color: #0a0f1a;
  box-shadow: 0 0 25px #00e6ff;
  transform: scale(1.05);
}
@media screen and (max-width: 768px) {
  body {
    flex-direction: column;
    overflow-y: auto;
  }

  .sidebar {
    display: none;
  }

  main {
    width: 100%;
    padding: 30px 15px;
    align-items: center;
    background-size: cover;
    background-position: center;
  }

  .contenedor-input {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .titulo {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 10px;
  }

  .moleculas-input {
    width: 100%;
    height: 180px;
    font-size: 1rem;
  }

  .btn-generar {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1rem;
  }

  .respuesta {
    margin-top: 20px;
    padding: 15px;
    font-size: 0.95rem;
    width: 100%;
    background-color: #0a0f1a;
    color: #00e6ff;
    border: 1px solid #00e6ff;
  }
}
/* === LOADING MOLECULAR === */
.respuesta {
  min-height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: #00e6ff;
  font-size: 1.1rem;
  text-shadow: 0 0 6px rgba(0,230,255,0.6);
}

.loader {
  position: relative;
  width: 70px;
  height: 70px;
}

.loader span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #00e6ff;
  border-radius: 50%;
  transform: rotate(calc(45deg * var(--i))) translate(28px);
  animation: glow 1.2s linear infinite;
  animation-delay: calc(0.15s * var(--i));
}

@keyframes glow {
  0% { opacity: 0.2; box-shadow: 0 0 3px #00e6ff; }
  50% { opacity: 1; box-shadow: 0 0 12px #00e6ff; }
  100% { opacity: 0.2; box-shadow: 0 0 3px #00e6ff; }
}

#generar:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: scale(0.97);
}
/* === Área de respuesta centrada y con ancho controlado === */
#respuesta {
  min-height: 180px;
  display: grid;
  place-items: center;       /* centra vertical y horizontal */
  padding: 16px;
}

.respuesta-box {             /* contenedor para loading y cards */
  width: 100%;
  max-width: 520px;          /* centrado visual */
  margin: 0 auto;
}

/* === LOADING MOLECULAR === */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: #00e6ff;
  font-size: 1.1rem;
  text-shadow: 0 0 6px rgba(0,230,255,0.6);
}

.loader {
  position: relative;
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 0 10px rgba(0,230,255,.45));
}
.loader span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  background: #00e6ff;
  border-radius: 50%;
  transform: rotate(calc(45deg * var(--i))) translate(30px);
  animation: glow 1.25s linear infinite;
  animation-delay: calc(0.14s * var(--i));
}
@keyframes glow {
  0%   { opacity: .2; box-shadow: 0 0 3px #00e6ff; }
  50%  { opacity: 1;  box-shadow: 0 0 14px #00e6ff; }
  100% { opacity: .2; box-shadow: 0 0 3px #00e6ff; }
}

/* === Cards === */
.alerta {
  background: #0f1b28;
  border: 1px solid rgba(0,230,255,.25);
  box-shadow: 0 0 18px rgba(0,230,255,.12);
  color: #ccfaff;
  padding: 16px 18px;
  border-radius: 14px;
}
.alerta.exito h3 { color:#00e6ff; margin-top: 0; }

/* Animaciones de entrada/salida */
.fade-in  { animation: fadeIn .28s ease-out both; }
.fade-out { animation: fadeOut .22s ease-in both; }
@keyframes fadeIn  { from {opacity:0; transform:translateY(4px)} to {opacity:1; transform:translateY(0)} }
@keyframes fadeOut { from {opacity:1; transform:translateY(0)} to {opacity:0; transform:translateY(-4px)} }

/* Botón deshabilitado mientras carga */
#generar:disabled { opacity: 0.6; cursor: not-allowed; transform: scale(0.98); }
/* === ÁREA DE RESPUESTA CENTRADA === */
#respuesta {
  min-height: 200px;
  display: grid;
  place-items: center;
  padding: 16px;
}
.respuesta-box {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* === ALERTA TRANSPARENTE ESTÉTICA === */
.alerta {
  background: transparent;
  border: 1px solid rgba(0,230,255,.35);
  box-shadow: 0 0 18px rgba(0,230,255,.18);
  color: #ccfaff;
  padding: 18px 22px;
  border-radius: 16px;
  backdrop-filter: none;
  width: fit-content;
  margin: 0 auto;
}
.alerta.exito h3 {
  margin: 0 0 10px 0;
  background: linear-gradient(90deg,#00e6ff,#8ff2ff,#00e6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0,230,255,.5);
  letter-spacing: 0.4px;
}
.alerta p {
  margin: 5px 0;
  border-bottom: 1px solid rgba(0,230,255,.1);
  padding-bottom: 4px;
}
.alerta p:last-child { border-bottom: none; }

/* === LOADER: ÁTOMO NEÓN === */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.neon-atom {
  position: relative;
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 0 16px rgba(0,230,255,.45));
}
.neon-atom svg { width: 100%; height: 100%; }
.neon-atom .orbit {
  stroke: #00e6ff;
  stroke-opacity: .55;
  fill: none;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 8px rgba(0,230,255,.55));
  transform-origin: 50% 50%;
  animation: spin 5.4s linear infinite;
}
.neon-atom .orbit.o2 { animation-duration: 6.2s; transform: rotate(60deg); }
.neon-atom .orbit.o3 { animation-duration: 7.1s; transform: rotate(120deg); }
.neon-atom .electron {
  fill: #00e6ff;
  filter: drop-shadow(0 0 8px rgba(0,230,255,.9));
  animation: blink 1.6s ease-in-out infinite;
}
.neon-atom .electron.e2 { animation-delay: .25s; }
.neon-atom .electron.e3 { animation-delay: .5s; }
.neon-atom .core {
  fill: url(#g-core);
  filter: blur(.2px) drop-shadow(0 0 18px rgba(0,230,255,.6));
  animation: pulse 1.8s ease-in-out infinite;
}

/* texto con brillo */
.loading .shine {
  font-size: 1.05rem;
  letter-spacing: .2px;
  color: #bff7ff;
  text-shadow: 0 0 8px rgba(0,230,255,.55);
  position: relative;
  overflow: hidden;
}
.loading .shine::after {
  content: "";
  position: absolute;
  inset: 0 -120%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  animation: sweep 2.2s ease-in-out infinite;
}

/* Animaciones */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(.96); } 50% { transform: scale(1); } }
@keyframes blink { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes sweep { 0% { transform: translateX(-40%); } 100% { transform: translateX(60%); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.fade-in { animation: fadeIn .28s ease-out both; }

/* Botón deshabilitado */
#generar:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: scale(.98);
}
/* Anula el panel azul heredado */
.respuesta {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
/* Overlay fijo para el resultado, sin fondo de columna */
#respuesta-portal.floating-panel {
  position: fixed;
  right: clamp(16px, 4vw, 40px);
  top: clamp(80px, 12vh, 140px);
  z-index: 9999;
  pointer-events: none; /* no molesta la UI debajo */
}
/* Permití interacción dentro de la card si la necesitás */
#respuesta-portal .alerta { pointer-events: auto; }

/* (opcional) responsivo en móvil */
@media (max-width: 780px) {
  #respuesta-portal.floating-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    top: 20px;
  }
}
/* === PORTAL flotante limpio === */
#respuesta-portal.floating-panel {
  position: fixed;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  z-index: 9999;
  pointer-events: none;
}

#respuesta-portal .alerta {
  pointer-events: auto;
  background: rgba(10, 20, 30, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 230, 255, 0.3);
  border-radius: 16px;
  padding: 20px 28px;
  box-shadow: 0 0 20px rgba(0, 230, 255, 0.15);
  color: #ccfaff;
  width: 300px;
  animation: fadeInCard 0.4s ease-out;
}

#respuesta-portal .alerta h3 {
  margin-bottom: 10px;
  background: linear-gradient(90deg, #00e6ff, #7af2ff);
  -webkit-background-clip: text;
  color: transparent;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0,230,255,0.4);
}

#respuesta-portal .alerta p {
  margin: 6px 0;
  border-bottom: 1px solid rgba(0,230,255,0.1);
  padding-bottom: 4px;
}
#respuesta-portal .alerta p:last-child {
  border-bottom: none;
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* para móviles */
@media (max-width: 900px) {
  #respuesta-portal.floating-panel {
    top: auto;
    bottom: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  #respuesta-portal .alerta {
    width: 85vw;
  }
}
/* ===== Overlay + modal limpio ===== */
#mg-overlay{
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(8,12,20,0.45);         /* oscurece */
  backdrop-filter: blur(8px);              /* difumina fondo */
  z-index: 10000;
}
#mg-overlay.show{ display: flex; animation: mgFade .18s ease-out both; }

.mg-modal{
  position: relative;
  width: min(560px, 92vw);
  background: rgba(14,18,26,0.9);          /* glass oscuro */
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  padding: 22px 24px;
  color: #e8f4f8;
}

.mg-x{
  position: absolute; top: 8px; right: 10px;
  border: none; background: transparent; color: #9fdaf0;
  font-size: 22px; cursor: pointer; line-height: 1;
}
.mg-x:hover{ transform: scale(1.06); }

/* Contenido */
.mg-card h3.mg-title{
  margin: 0 0 10px 0;
  color: #9ee9ff; font-weight: 700;
}
.mg-card p{ margin: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 6px; }
.mg-card p:last-child{ border-bottom: none; }

/* Loader minimal */
.mg-loader-wrap{ display:flex; flex-direction:column; align-items:center; gap:12px; }
.mg-loader-text{ color:#cfefff; font-size: 15px; }
.mg-spinner{
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #00e6ff;
  border-radius: 50%;
  animation: mgSpin 0.9s linear infinite;
}

/* Animaciones */
@keyframes mgFade { from{opacity:0} to{opacity:1} }
@keyframes mgSpin { to{ transform: rotate(360deg) } }

/* Responsive */
@media (max-width: 680px){
  .mg-modal{ width: 94vw; padding: 18px }
}
/* ===== Overlay + Modal glass ===== */
#mg-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 15, 25, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
}
#mg-overlay.show {
  display: flex;
  animation: mgFade 0.2s ease-out both;
}

/* ===== Modal principal ===== */
.mg-modal {
  position: relative;
  width: min(560px, 92vw);
  background: linear-gradient(180deg, rgba(14,18,26,0.92), rgba(10,14,20,0.9));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  padding: 26px 28px;
  color: #eafaff;
  font-family: 'Inter', system-ui, sans-serif;
}
.mg-modal::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  background:
    radial-gradient(120px 60px at 85% 15%, rgba(0,230,255,0.12), transparent 70%),
    radial-gradient(140px 120px at 10% 100%, rgba(0,230,255,0.1), transparent 70%);
  filter: blur(16px);
  opacity: 0.7;
  pointer-events: none;
}

/* ===== Botón cerrar ===== */
.mg-x {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: #a8e9ff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: 0.15s;
}
.mg-x:hover {
  transform: scale(1.1);
  color: #c4f6ff;
}

/* ===== Texto y secciones ===== */
.mg-card h3.mg-title {
  margin: 0 0 14px 0;
  font-weight: 700;
  color: #aef0ff;
  font-size: 1.3rem;
}
.mg-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: center;
}
.mg-label {
  opacity: 0.8;
  font-size: 0.95rem;
}
.mg-value {
  font-weight: 500;
  font-size: 0.97rem;
  text-align: right;
}

/* ===== Código y botón copiar ===== */
.mg-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.mg-copy {
  border: none;
  background: transparent;
  color: #9fdaf0;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
  padding: 2px 4px;
}
.mg-copy:hover {
  color: #b9f2ff;
  text-decoration: underline;
}

/* ===== Badges ===== */
.mg-badges {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.badge {
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}
.badge.ok {
  border-color: rgba(0,200,140,0.35);
  color: #a9f5df;
}
.badge.warn {
  border-color: rgba(255,180,0,0.35);
  color: #ffe6a6;
}
.badge.danger {
  border-color: rgba(255,80,80,0.35);
  color: #ffb8b8;
}

/* ===== Separador suave ===== */
.mg-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  margin: 14px 0;
}

/* ===== Loader elegante ===== */
.mg-loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mg-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: #aef0ff;
  border-radius: 50%;
  animation: mgSpin 0.9s linear infinite;
}
.mg-loader-text {
  color: #dff7ff;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.mg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aef0ff;
  opacity: 0.4;
  animation: mgDot 1.2s ease-in-out infinite;
}
.mg-dot:nth-child(2) { animation-delay: 0.15s; }
.mg-dot:nth-child(3) { animation-delay: 0.3s; }

/* ===== Animaciones ===== */
@keyframes mgFade {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes mgSpin { to { transform: rotate(360deg); } }
@keyframes mgDot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .mg-modal {
    width: 94vw;
    padding: 20px;
  }
  .mg-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .mg-value {
    text-align: left;
  }
}
/* ===== Loader Átomo girando ===== */
.atom-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.atom {
  position: relative;
  width: 90px;
  height: 90px;
  animation: spinAtom 6s linear infinite;
}

.nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  background: radial-gradient(circle at 30% 30%, #aef0ff, #00e6ff);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(0,230,255,0.6);
}

/* Órbitas */
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1.5px solid rgba(174,240,255,0.25);
  border-radius: 50%;
  transform-style: preserve-3d;
}

.orbit1 {
  width: 60px;
  height: 90px;
  transform: translate(-50%, -50%) rotateX(65deg);
}
.orbit2 {
  width: 90px;
  height: 60px;
  transform: translate(-50%, -50%) rotateY(65deg);
}
.orbit3 {
  width: 78px;
  height: 78px;
  transform: translate(-50%, -50%) rotateZ(45deg);
}

/* Electrones */
.electron {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #aef0ff;
  border-radius: 50%;
  transform-origin: center 45px;
  animation: orbitElectron 1.8s linear infinite;
  box-shadow: 0 0 8px rgba(174,240,255,0.7);
}

.orbit2 .electron { animation-duration: 2.4s; }
.orbit3 .electron { animation-duration: 3s; }

@keyframes orbitElectron {
  from { transform: rotate(0deg) translateX(45px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(45px) rotate(-360deg); }
}

@keyframes spinAtom {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
