* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f7f7f8;
  color: #111827;

  font-size: 16.5px;   /* 👈 antes era 16px implícito */
  line-height: 1.6;    /* 👈 más aire, más “premium” */
}


/* ===== Layout ===== */

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 90px;
}

@media (max-width: 768px) {
  .app {
    padding: 16px 12px 90px;
  }
}

/* ===== Header ===== */

.top {
  text-align: center;
  margin-bottom: 32px;
}

.top h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.top p {
  margin-top: 6px;
  font-size: 14px;
  color: #6b7280;
}

/* ===== Examples ===== */

.examples {
  margin-bottom: 32px;
}

.examples h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.examples p {
  margin: 0 0 16px;
  font-size: 13px;
  color: #6b7280;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.example-grid button {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #111827;       /* texto oscuro tipo ChatGPT */
  transition: all 0.15s ease;
}



.example-grid button:hover {
  background: #f3f4f6;
}

/* ===== Chat ===== */

.chat-container {
  min-height: 200px;
}

#chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Messages ===== */

.message {
  max-width: 80%;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.user {
  align-self: flex-end;
  background: #10a37f;
  color: white;
}

/* ===== Input ===== */

.input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f7f7f8;
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
  display: flex;
  justify-content: center; /* centra horizontalmente */
}

.input-bar form {
  width: 100%;
}

#chat-form {
  max-width: 1100px;   /* mismo ancho que el contenido */
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}

input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  padding: 14px;
  font-size: 14px;
}

input:focus {
  outline: none;
  border-color: #10a37f;
}

button {
  background: #10a37f;
  border: none;
  color: white;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 18px;
  cursor: pointer;
}

/* ===== Info button (perfect circle) ===== */

.info-btn {
  position: absolute;
  top: 16px;
  right: 16px;

  width: 28px;
  height: 28px;
  border-radius: 50%;

  border: 1px solid #d1d5db;
  background: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: 700;
  line-height: 1;

  color: #374151;
  cursor: pointer;
  padding: 0;
}

.info-btn:hover {
  background: #f3f4f6;
}



/* ===== Info box ===== */

.info-box {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  border: 1px solid #666666;
}

.hidden {
  display: none;
}


/* ===== Modal ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  border: 2px solid #4b5563; 
}

.modal h3 {
  margin-top: 0;
}

.modal p {
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}

/* ===== Hide ===== */

.hidden {
  display: none;
}

/* ===== Input bar (ChatGPT style) ===== */

.input-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  justify-content: center;
}

#chat-form {
  max-width: 720px;
  width: calc(100vw - 32px);
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  padding: 8px;
  display: flex;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

#chat-form input {
  border: none;
  padding: 12px;
}

#chat-form input:focus {
  outline: none;
}

#chat-form button {
  background: #10a37f;
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 18px;
  color: white;
  cursor: pointer;
}

.bot {
  align-self: flex-start;
  background: white;
  border: 1px solid #e5e7eb;

  font-size: 14.5px;
  line-height: 1.7;
  color: #111827;
}


.bot strong {
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 15.5px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.2px;
}

/* =========================================
   SWITCH DESIGN (From Uiverse.io by JustCode14)
   ========================================= */

.switch {
  /* Posicionamiento en el header */
  position: absolute;
  top: 16px;     /* Ajustado para alinear con el botón de ayuda */
  right: 54px;   /* A la izquierda del botón ? (que está en right:16px) */
  
  font-size: 13px; /* Ajusté un poco el tamaño para que no sea gigante en el header */
  display: inline-block;
  width: 4em;
  height: 2.2em;
  border-radius: 30px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2a2a2a; /* Fondo NOCHE por defecto */
  transition: 0.4s;
  border-radius: 30px;
  overflow: hidden;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.2em;
  width: 1.2em;
  border-radius: 20px;
  left: 0.5em;
  bottom: 0.5em;
  transition: 0.4s;
  transition-timing-function: cubic-bezier(0.81, -0.04, 0.38, 1.5);
  box-shadow: inset 8px -4px 0px 0px #fff; /* Luna */
}

/* Estado CHECKED (DÍA/SOL) */
.switch input:checked + .slider {
  background-color: #52a9ff; /* Azul cielo */
}

.switch input:checked + .slider:before {
  transform: translateX(1.8em);
  box-shadow: inset 15px -4px 0px 15px #ffcf48; /* Sol amarillo */
}

.star {
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  width: 5px;
  transition: all 0.4s;
  height: 5px;
}

.star_1 { left: 2.5em; top: 0.5em; }
.star_2 { left: 2.2em; top: 1.2em; }
.star_3 { left: 3em; top: 0.9em; }

.switch input:checked ~ .slider .star {
  opacity: 0; /* Ocultar estrellas de día */
}

.cloud {
  width: 3.5em;
  position: absolute;
  bottom: -1.4em;
  left: -1.1em;
  opacity: 0;
  transition: all 0.4s;
}

.switch input:checked ~ .slider .cloud {
  opacity: 1; /* Mostrar nubes de día */
}


/* =========================================
   DARK MODE COLORS
   ========================================= */

/* Cuando el body tiene la clase .dark-mode aplicamos los colores oscuros */
body.dark-mode {
  background: #343541;
  color: #ececf1;
}

body.dark-mode .top p,
body.dark-mode .examples p {
  color: #c5c5d2;
}

/* Botones ejemplos */
body.dark-mode .example-grid button {
  background: #202123;
  border-color: #4d4d4f;
  color: #ececf1;
}
body.dark-mode .example-grid button:hover {
  background: #2a2b32;
}

/* Chat Bot */
body.dark-mode .bot {
  background: #444654;
  border-color: #2a2b32;
  color: #d1d5db;
}
body.dark-mode .bot strong {
  color: #ffffff;
}

/* Input flotante */
body.dark-mode #chat-form {
  background: #40414f;
  border-color: #303139;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
body.dark-mode input {
  background: transparent;
  color: white;
  border: none;
}
body.dark-mode input::placeholder {
  color: #8e8ea0;
}

/* Modal e Info Box */
body.dark-mode .modal,
body.dark-mode .info-box {
  background: #202123;
  border-color: #d1d5db;
  color: #ececf1;
}

body.dark-mode .modal h3,
body.dark-mode .modal p,
body.dark-mode .modal strong {
  color: #ececf1;
}

body.dark-mode .modal-close {
  color: #ececf1;
}

/* Botón de ayuda (?) */
body.dark-mode .info-btn {
  background: #444654;
  border-color: #565869;
  color: #ececf1;
}

/* =========================================
   Ajustes para teléfono para evitar la
   superposición de los botones sobre el título
   ========================================= */

@media (max-width: 600px) {
  .top {
    padding-top: 60px;
    position: relative;
  }

  .switch {
    right: 50px;
  }
  .info-btn {
    right: 10px;
  }
}
