/* Antipasto.ttf */
@font-face {
    font-family: 'Antipasto';
    src: url('fonts/Antipasto.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

* {
    margin: 0;
    padding: 0;
    outline: none;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
    font-weight: normal;
}

:root {
    --secondary-color: #F0F4F9;
    --secondary-hover-color: #DDE3EA;
    --focus-color: #E9EEF6;
    --focus-hover-color: #E1E6ED;
    --button-hover-color: #E9ECF1;
    --text-color: #000000;
    --text-secondary-color: #4D4D4D;
    --heading-secondary-color: #C4C7C5;
    --placeholder-color: #717075;
    --icon-color: #000000;
}

.light_mode {
    --secondary-color: #F0F4F9;
    --secondary-hover-color: #DDE3EA;
    --focus-color: #E9EEF6;
    --focus-hover-color: #E1E6ED;
    --button-hover-color: #E9ECF1;
    --text-color: #ffffff; /* Texto blanco en modo claro */
    --icon-color: #000000;  /* Íconos negros en modo claro */
    --text-secondary-color: #4D4D4D;
    --heading-secondary-color: #C4C7C5;
    --placeholder-color: #717075;
}

body {
    background: var(--primary-color);
    background-size: 400% 400%;
    animation: movingGradient 5s ease infinite;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    font-weight: normal;
    font-family: 'Antipasto', sans-serif;
}

@keyframes movingGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.header,
.chats .message,
.chats .message .message__content,
.prompt__form {
    margin: 0 auto;
    max-width: 824px;
}

body.hide-header .header {
    margin: 0;
    display: none;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.navbar__logo {
    color: var(--text-secondary-color);
    font-weight: 500;
}

.navbar__button {
    padding: 0.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    border: none;
    background: var(--secondary-color);
    color: var(--icon-color);
    cursor: pointer;
    transition: background 0.3s ease;
}

.navbar__button:hover {
    background: var(--secondary-hover-color);
}

.header {
    margin-top: 6vh;
}

.header__title h1 {
  font-size: 3.5rem;
  font-family: 'Antipasto', sans-serif;
  font-weight: bold;
  color: white;
  position: relative;

  /* Sombras múltiples en los colores indicados */
  text-shadow:
    0 0 5px #00AAFF,
    0 0 10px #D983BC,
    0 0 15px  #FFC000;

  animation: shadowPulse 4s ease-in-out infinite;
}

@keyframes shadowPulse {
  0%, 100% {
    text-shadow:
      0 0 4px #00AAFF,
      0 0 8px #D983BC,
      0 0 12px #FFC000;
  }
  50% {
    text-shadow:
      0 0 8px #00AAFF,
      0 0 14px#D983BC,
      0 0 20px #FFC000;
  }
}



@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.header__title h2 {
    color: var(--heading-secondary-color);
    font-size: 3.25rem;
    font-weight: 500;
    font-family: 'Antipasto', sans-serif;
}

.suggests {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4.875rem;
    gap: 0.5rem;
}

.suggests__item {
    background: var(--secondary-color);
    color: var(--text-secondary-color);
    padding: 1rem;
    height: 12.5rem;
    width: 12.5rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.3s ease;
}

.suggests__item:hover {
    background: var(--secondary-hover-color);
}

.suggests__item-text {
    font-weight: 500;
    line-height: 1.375rem;
}

.suggests__item-icon {
    text-align: right;
}

.suggests__item-icon i {
    font-size: 1.5rem;
    background: var(--primary-color);
    padding: 0.5rem;
    border-radius: 50%;
}

.prompt {
    position: fixed;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    width: 100%;
    left: 0;
    bottom: 0;
    padding: 1rem;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
}

.prompt__input-wrapper {
    width: 100%;
    height: 4rem;
    display: flex;
    position: relative;
}

/* === CORRECCIÓN: Texto del input en negro para escribir === */
.prompt__form-input {
    height: 100%;
    width: 100%;
    border: none;
    resize: none;
    font-size: 1rem;
    color: #000000 !important; /* Texto negro fijo para escribir */
    padding: 1rem 1.75rem;
    border-radius: 100px;
    background: var(--secondary-color);
    transition: background 0.3s ease;
}

.prompt__form-input:focus {
    background: var(--focus-color);
}

.prompt__form-input:focus ~ .prompt__form-button:hover {
    background: var(--focus-hover-color);
}

.prompt__form-input::placeholder {
    color: var(--placeholder-color);
}

.prompt__form-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    width: 48px;
    height: 48px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-color);
    background: transparent;
    transition: all 0.3s ease;
}

.prompt__form-button:hover {
    background: var(--button-hover-color);
}

.prompt__form-button#sendButton {
    transform: translateY(-50%) scale(0);
}

.prompt__form-input:valid ~ .prompt__form-button#sendButton {
    transform: translateY(-50%) scale(1);
}

.prompt__form-input:valid ~ #deleteButton {
    right: 3.5rem;
}

.prompt__disclaim {
    text-align: center;
    color: var(--placeholder-color);
    font-size: 0.85rem;
    margin-top: 1rem;
}

.chats {
    padding: 2rem 1rem 10rem;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-color: #999 transparent;
}

/* === CORRECCIÓN: texto de mensajes salientes en blanco === */
.chats .message--outgoing:not(:first-child) {
    color: #ffffff !important; /* Mensajes que envías en texto blanco */
    margin-top: 40px;
}

/* Texto de mensajes entrantes */
.chats .message--incoming {
    margin-top: 1.5rem;
    color: var(--text-color);
}

.chats .message__content {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    width: 100%;
}

.chats .message__text {
    color: var(--text-color);
    white-space: pre-wrap;
    margin-top: 10px;
}

.hide {
    display: none !important;
}

.chats .message--error .message__text {
    color: #e55865;
}

.chats .message--loading .message__text {
    display: none;
}

.chats .message__avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    object-fit: top center;
}

.chats .message--loading .message__avatar {
  opacity: 0;
  pointer-events: none;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.chats .message__icon {
    color: var(--icon-color);
    cursor: pointer;
    height: 35px;
    width: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    font-size: 1.25rem;
    margin-left: 3.5rem;
    transition: background 0.3s ease;
}

.chats .message__icon:hover {
    background: var(--secondary-hover-color);
}

.chats .message__loading-indicator {
    display: none;
    gap: 0.6rem;
    width: 100%;
    flex-direction: column;
    margin-bottom: 20px;
}

.chats .message--loading .message__loading-indicator {
    display: flex;
}

.chats .message__loading-indicator .message__loading-bar {
    height: 1rem;
    width: 100%;
    border-radius: 0.135rem;
    background: #af14c4be;
    animation: breathe 2.4s ease-in-out infinite;
    transform-origin: center;
    opacity: 0.9;
}

.chats .message__loading-indicator .message__loading-bar:first-child {
    width: 85%;
    animation-delay: 0s;
}

.chats .message__loading-indicator .message__loading-bar:nth-child(2) {
    width: 100%;
    animation-delay: 0.2s;
}

.chats .message__loading-indicator .message__loading-bar:last-child {
    width: 70%;
    animation-delay: 0.4s;
}

@keyframes loading {
    0% {
        background-position: -800px 0;
    }
    50% {
        background-position: 0px 0;
    }
    100% {
        background-position: 800px 0;
    }
}

.code__copy-btn {
    background-color: transparent;
    border: none;
    color: var(--icon-color);
    border-radius: 5px;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 12px;
    z-index: 10;
    font-size: 18px;
}

p {
    margin-bottom: 10px;
}

ul {
    list-style: disc inside;
    margin-left: 20px;
}

ol {
    margin-left: 40px;
}

strong {
    font-weight: bold;
}

em {
    font-style: italic;
}

a {
    color: #1e90ff;
    text-decoration: none;
}

th,
td {
    border: 1px solid;
    text-align: left;
    padding: 10px;
}

pre {
    position: relative;
    background-color: var(--secondary-color);
    padding: 10px 0 0;
    font-family: monospace;
    font-size: 14px;
    border-radius: 10px;
    margin: 0;
    overflow-x: auto;
}

code {
    margin-top: 30px;
    border-radius: 5px;
    color: inherit;
}

.code__language-label {
    position: absolute;
    font-weight: bold;
    top: 10px;
    left: 12px;
    color: var(--placeholder-color);
    font-size: 14px;
    text-transform: capitalize;
}

.hljs {
    background-color: var(--secondary-color);
}

blockquote {
    padding-left: 60px;
    line-height: 2.5rem;
    color: var(--text-color);
}

@media screen and (max-width: 980px) {
    .header {
        padding: 0 2rem;
    }

    .header__title {
        line-height: 2.8rem;
    }

    .header__title h1 {
        font-size: 2.0rem;
    }

    .header__title h2 {
        font-size: 2.5rem;
    }

    .suggests {
        justify-content: center;
    }

    .message {
        padding: 0 1.5rem;
    }

    .prompt__disclaim {
        font-size: 0.8rem;
    }
}

/* Color de texto en sugerencias modo oscuro */
.suggests__item {
    color: #000000;
}

/* Color de texto en sugerencias modo claro */
.light_mode .suggests__item {
    color: #333333;
}

/* Mejorar la responsividad para pantallas pequeñas */

@media screen and (max-width: 600px) {
  .header {
    padding: 0 1rem;
  }

  .header__title h1 {
    font-size: 1.8rem !important;
    line-height: 1.4;
    text-align: center;
  }

  .header__title h2 {
    font-size: 1.4rem !important;
    line-height: 1.4;
    text-align: center;
  }

  .suggests {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
    overflow: visible !important;
  }

  .suggests__item {
    display: flex !important;
    flex: 1 1 100%;
    max-width: 100%;
    height: auto !important;
    min-height: auto !important;
    padding: 0.75rem;
    margin: 0 auto;
    box-sizing: border-box;
    word-break: break-word;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .suggests__item:nth-child(3),
  .suggests__item:nth-child(4) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    position: relative !important;
  }

  .prompt__input-wrapper {
    flex-direction: column;
    gap: 10px;
    height: auto !important;
  }

  .prompt__form-input {
    color: #000000 !important; /* texto negro siempre */
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }

  .prompt__form-button {
    position: relative !important;
    width: 100%;
    height: 40px;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    transform: none !important;
  }

  .prompt__form-button#sendButton {
    transform: none !important;
    scale: 1 !important;
  }

  .prompt__form-input:valid ~ #deleteButton {
    right: auto !important;
  }

  .prompt {
    position: fixed;
    padding: 1rem;
  }

  .chats {
    padding-bottom: 14rem !important;
  }
}

/* === MODAL DE CONFIRMACIÓN PARA EL BOTÓN ELIMINAR === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease forwards;
}

.modal-content {
    background: var(--secondary-color);
    color: var(--text-color);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: slideUp 0.3s ease forwards;
}

.modal-content p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.modal-buttons button {
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    color: white;
    background-color: #7e0774;
    transition: background-color 0.2s ease;
}

.modal-buttons button#confirmNo {
    background-color: #292929;
}

.modal-buttons button:hover {
    opacity: 0.9;
}

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

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

.tutorial-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.tutorial-content {
  background: rgba(25, 0, 31, 0.85);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  max-width: 90%;
  width: 800px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.tutorial-content video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  margin-bottom: 15px;
}

#closeTutorial {
  background: #adacac;
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

#closeTutorial:hover {
  background: #b4b3b3;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.75;
    filter: drop-shadow(0 0 0px transparent);
  }
  50% {
    transform: scale(1.1);
    opacity: 0;
    filter: drop-shadow(0 0 10px #b8b5b5);/*no*/
  }
}

.avatar-breathe-wrapper {
  display: inline-block;
  width: 30px;
  height: 30px;
}

.message__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-color: black;
}

.video-background video {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 100%;
  width: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  aspect-ratio: 16 / 9;
  min-height: 100%;
  min-width: 100%;
}
/* === ESTILO PARA MENSAJES SALIENTES CON BLUR Y BORDES REDONDEADOS === */
.chats .message--outgoing:not(:first-child) .message__text {
  background: rgba(255, 255, 255, 0.1); /* blanco translúcido */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(51, 50, 50, 0.2);
  position: relative;
  transition: all 0.3s ease;
}

/* Ajuste para el icono de copiar dentro del mismo fondo */
.chats .message--outgoing:not(:first-child) .message__icon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  border-radius: 8px;
  font-size: 1rem;
  padding: 6px;
  transition: background 0.3s ease;
  z-index: 1;
}

.chats .message--outgoing:not(:first-child) .message__icon:hover {
  background: rgba(255, 255, 255, 0.3);
}
/* === Mensajes entrantes con blur y botón debajo === */
.chats .message--incoming .message__text {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Botón de copiar debajo del texto */
.chats .message--incoming .message__icon {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 1rem;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.3s ease;
  border: none;
}

.chats .message--incoming .message__icon:hover {
  background: rgba(255, 255, 255, 0.5);
}
