:root {
  --primary: #3cefff;
  --text: #f4f4f4;
  --bg-1: #161d30;
  --bg-2: #232f46;
  --panel: rgba(22, 29, 48, 0.75);
  --panel-strong: rgba(36, 47, 70, 0.92);
  --shadow: rgba(0, 0, 0, 0.5);
}

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: #000;
  background-image: url("Image/Estrellas.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Roboto", "Orbitron", Arial, sans-serif;
  color: var(--text);
  background: transparent;
}

.contenido-principal {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 0;
}

.contenido-principal.is-hidden {
  display: none;
}

main {
  flex: 1 1 auto;
  overflow-y: auto;
  text-align: center;
  padding: 20px 0;
}

.main-compact {
  padding: 12px 0 6px 0;
}

#main-welcome {
  margin: 10px 0 6px 0;
}

#main-desc {
  margin: 0 0 10px 0;
}

footer a {
  text-decoration: none;
  color: var(--primary);
}

h1, .header-content h1 {
  text-shadow: 0 0 24px var(--primary), 0 0 4px #fff;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 0;
  background: var(--panel);
  box-shadow: 0 2px 24px #0008;
  color: #fff;
}

.header-icon {
  width: 70px;
  height: 70px;
}

.site-title {
  font-size: 50px;
  margin: 14px 0;
}

.site-nav {
  background: var(--panel);
}

.nav-list {
  margin: 0;
  padding: 10px;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 28px;
  color: #fff;
}

.nav-link {
  color: var(--primary);
  text-decoration: none;
}

.nav-link.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.site-footer {
  width: 100%;
  background: var(--panel);
  box-shadow: 0 -2px 24px #0008;
  color: #fff;
  padding: 12px 0 14px 0;
  text-align: center;
  font-size: 1em;
}

.modal-instrucciones {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(22,29,48,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-contenido {
  background: var(--panel-strong);
  padding: 30px;
  border: 3px solid var(--primary);
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  color: var(--text);
  box-shadow: 0 8px 24px var(--shadow);
}

.modal-contenido h2 {
  text-align: center;
  margin-bottom: 16px;
  color: var(--primary);
}

.modal-contenido ol {
  margin: 16px 0;
  padding-left: 20px;
  line-height: 1.4;
}

.instr-important-title {
  margin-top: 15px;
}

.instr-important-body {
  text-align: left;
  margin: 10px 0 15px 20px;
}

.modal-contenido button {
  display: block;
  margin: 20px auto 0;
  padding: 10px 24px;
  background-color: var(--primary);
  color: var(--bg-2);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.modal-contenido button:hover {
  background-color: #f4c542;
  color: var(--bg-1);
}

.galeria.solo {
  width: min(1100px, 92vw);
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: 0fr 460px;
  align-items: center;
  gap: 26px;
}

.galeria-item {
  display: flex;
  justify-content: center;
  align-items: center;
}

#modelo-container {
  width: 520px;
  height: 460px;
  margin: 0;
}

#chat-container {
  width: 460px;
  max-height: 340px;
  background: var(--bg-2);
  border: 1px solid var(--primary);
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 16px;
  color: var(--text);
  box-shadow: 0 0 28px #161d3080;
}

.chat-form {
  display: flex;
  gap: 8px;
}

#chat-input {
  flex: 1;
  padding: 7px 12px;
  border-radius: 7px;
  border: none;
  font-size: 1em;
}

.chat-send {
  background: #208cff;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 7px;
  font-weight: 700;
  cursor: pointer;
}

#chat-history {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 5px;
}

.msg {
  margin: 18px 10px;
  font-size: 0.9em;
}

.msg.user {
  text-align: right;
}

.msg.bot {
  text-align: left;
}

#spinner {
  display: none;
  text-align: left;
  margin: 10px 0;
}

.chat-mic {
  margin-left: 8px;
  padding: 0.45em 0.7em;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  border-radius: 6px;

  background: #2e7d32;
  color: #fff;

  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.chat-mic:hover {
  background: #388e3c;
}

.chat-mic.is-listening {
  background: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.35);
  animation: mic-pulse 1.2s infinite;
}

.chat-mic.is-listening:hover {
  background: #b71c1c;
}

.chat-mic:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes mic-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(198, 40, 40, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0);
  }
}


@media (max-width: 1024px) {
  .site-title {
    font-size: 36px;
    text-align: center;
  }

  .galeria.solo {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 10px;
  }

  #modelo-container {
    width: min(520px, 92vw);
    height: min(460px, 78vw);
  }

  #chat-container {
    width: min(520px, 85vw);
    max-height: 360px;
    margin-bottom: 35px;
  }
}

@media (max-width: 480px) {
  .modal-contenido {
    padding: 10px;
    max-width: 96vw;
  }

  .site-title {
    font-size: 36px;
    text-align: center;
  }

  .nav-list {
    gap: 7px;
    font-size: 0.92em;
    padding: 10px 5px;
  }

  main {
    padding: 4px 0;
  }

  .main-compact {
    padding: 6px 0 4px 0;
  }

  #chat-container {
    padding: 10px;
    border-radius: 14px;
    margin-bottom: 35px;

    overflow-x: hidden;
  }

  .site-footer {
    font-size: 0.95em;
    padding: 10px 0 12px 0;
  }

  .chat-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "input input"
      "mic send";
    gap: 6px;
    width: 100%;
  }

  #chat-input {
    grid-area: input;
    width: auto;
    min-width: 0;
    padding: 9px 12px;
    font-size: 0.95rem;
    margin-bottom: 10px;
  }

  .chat-mic {
    grid-area: mic;
    margin-left: 0;
    padding: 10px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .chat-send {
    grid-area: send;
    padding: 10px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}
