/* =========================
   CHAT BOT
========================= */

#chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999999 !important;
}

/* TARJETA */
#chat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0b2c5f;
  color: white;
  padding: 15px 20px;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: 0.3s;
}

#chat-card:hover {
  transform: translateY(-3px);
}

/* ICONO */
.chat-card__icon {
  position: relative;
}

.chat-card__icon img {
  width: 45px;
  height: 45px;
}

.chat-notification {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* TEXTO */
.chat-card__text h4 {
  margin: 0;
  color: #f5c542;
}

.chat-card__text p {
  margin: 0;
  font-size: 14px;
}

/* CHAT */
/* CONTENEDOR */
#chat-box {
  display: flex;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: #ffffff; /* 🔥 blanco */
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  z-index: 9999999 !important;
  flex-direction: column;
  /* Animacion */
  
  transform: scale(0.8) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

#chat-box.active {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* HEADER */
.chat-header {
  background: #0b2c5f;
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-header img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.chat-header__left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-header__left strong {
  font-size: 14px;
}

.chat-header__left p {
  font-size: 11px;
  opacity: 0.8;
}

.chat-header p {
  margin: 0;
  font-size: 12px;
}

.chat-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header__actions button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;

  border-radius: 8px;
  transition: 0.2s;
}

.chat-header__actions button:hover {
  background: rgba(255,255,255,0.1);
}

/* DROPDOWN */
.chat-menu {
  position: relative;
}

.chat-dropdown {
  position: absolute;
  right: 0;
  top: 30px;
  background: white;
  color: black;
  border-radius: 8px;
  overflow: hidden;
  min-width: 150px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(-5px);
  transition: 0.2s;
  pointer-events: none;
}

.chat-dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-dropdown div {
  padding: 10px;
  cursor: pointer;
}

.chat-dropdown div:hover {
  background: #f0f0f0;
}

.online-dot {
  color: #00ff88;
  font-size: 12px;
}

/* MENSAJES */
#chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f5f5f5;
}

/* CONTENEDOR GENERAL */
.msg-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

/* BOT */
.msg-wrapper.bot {
  align-items: flex-start;
}

/* USER */
.msg-wrapper.user {
  justify-content: flex-end;
}

/* AVATAR */
.avatar {
  width: 30px;
  height: 30px;
}

/* BURBUJAS */
.msg {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 220px;
  font-size: 14px;
}

/* BOT */
.msg.bot {
  background: #0b2c5f;
  color: white;
}

/* USER */
.msg.user {
  background: #e5e5e5;
}

/* HORA */
.msg-time {
  font-size: 10px;
  color: #888;
  margin-top: 3px;
}

/* INPUT */
.chat-input {
  display: flex;
  padding: 10px;
  background: white;
  border-top: 1px solid #ddd;
}

.chat-input input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px;
}

.chat-input button {
  background: #0b2c5f;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
}

/* ESCRIBIENDO */

.typing {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing span {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: blink 1.4s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}

/* GRID DE BOTONES */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

/* BOTÓN CARD */
.chat-option-card {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 12px;
  border-radius: 12px;

  background: white;
  border: 2px solid #d4af37; /* dorado */

  color: #0b2c5f;
  font-weight: 500;
  font-size: 14px;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* ICONO */
.option-icon {
  font-size: 18px;
}

/* HOVER */
.chat-option-card:hover {
  background: #0b2c5f;
  color: white;
  transform: translateY(-2px);
}

/* Formulario */
.chat-form {
  background: white;
  padding: 12px;
  border-radius: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-form h4 {
  margin: 0 0 5px 0;
  font-size: 14px;
}

.chat-form input,
.chat-form select {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
}

.chat-form button {
  background: #0b2c5f;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* Formulario Beca */
.chat-input-field {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
}

.chat-btn {
  background: #0b2c5f;
  color: white;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 5px;
}

.chat-btn.secondary {
  background: #ccc;
  color: black;
}



/* =========================================
    Captcha
========================================= */

.contact-field--full{
  grid-column: 1 / -1;
}

.contact-recaptcha{
  display:flex;
  justify-content:center;
  align-items:center;

  margin-top:10px;
  padding:20px;

  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  backdrop-filter:blur(10px);
}

.contact-recaptcha .h-captcha{
  max-width: 100%;
  transform-origin: center;
}

/* Responsive */
@media (max-width: 575px){
  .contact-recaptcha{
    justify-content: flex-start;
    padding-top: 10px;
  }

  .contact-recaptcha .h-captcha{
    transform: scale(.88);
    transform-origin: left center;
  }
}

@media (max-width: 360px){
  .contact-recaptcha .h-captcha{
    transform: scale(.78);
  }
}

/* =========================
   RESPONSIVE CHATBOT
========================= */

/* TABLET */
@media(max-width: 1024px){

  #chat-box{
    width: 320px;
    height: 480px;
  }

}

/* =========================================
   BURBUJA DESDE 1122px HASTA MÓVIL
========================================= */

@media (max-width: 1122px){

  #chat-card{
    width:65px;
    height:65px;

    padding:0;

    border-radius:50%;

    display:flex;
    align-items:center;
    justify-content:center;

    box-shadow:0 10px 25px rgba(0,0,0,.25);

    animation:floatChat 3s ease-in-out infinite;
  }

  .chat-card__text{
    display:none;
  }

  .chat-card__icon{
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .chat-card__icon img{
    width:34px;
    height:34px;
    object-fit:contain;
  }

  .chat-notification{
    top:2px;
    right:2px;
  }

}

/* MOBILE */
@media(max-width: 768px){

  /* Widget */
  #chat-widget{
    bottom: 15px;
    right: 15px;
    left: 15px;
    z-index: 999999;
  }

  /* Card cerrada */
  #chat-card{
    width: fit-content;
    padding: 14px;
    justify-self: right;
  }

  .chat-card__text h4{
    font-size: 15px;
  }

  .chat-card__text p{
    font-size: 13px;
  }

  /* Chat abierto */
  #chat-box{
    width: 100vw;
    height: 92vh;

    left: 0;
    right: 0;
    bottom: 0;

    border-radius: 24px 24px 0 0;
  }

  /* Header */
  .chat-header{
    min-height: 72px;
  }

  .chat-header img{
    width: 34px;
    height: 34px;
  }

  .chat-header__left strong{
    font-size: 13px;
  }

  .chat-header__left p{
    font-size: 10px;
  }

  /* Botones header */
  .chat-header__actions button{
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  /* Mensajes */
  #chat-messages{
    padding: 12px;
  }

  .msg{
    max-width: 85%;
    font-size: 13px;
  }

  /* Opciones */
  .options-grid{
    grid-template-columns: 1fr;
  }

  .chat-option-card{
    width: 100%;
    font-size: 13px;
    padding: 10px;
  }

  /* Inputs */
  .chat-input{
    padding: 8px;
  }

  .chat-input input{
    font-size: 14px;
  }

  .chat-input button{
    padding: 8px 12px;
  }

  /* Formularios */
  .chat-form{
    padding: 10px;
  }

  .chat-input-field{
    font-size: 14px;
  }

}

/* CELULARES MUY PEQUEÑOS */
@media(max-width: 480px){

  /* Widget */
  #chat-widget{
    right: 15px;
    left: auto;
    bottom: 15px;
  }

  .chat-header{
    min-height: 72px;
  }

  #chat-messages{
    padding-bottom: 25px;
  }

  /* Chat fullscreen elegante */
  #chat-box{
    position: fixed;

    width: 100vw;
    height: 100dvh;

    left: 0;
    right: 0;
    bottom: 0;

    padding-top: env(safe-area-inset-top);

    border-radius: 22px 22px 0 0;

    overflow: hidden;
  }

  /* Botones más cómodos */
  .chat-option-card{
    min-height: 52px;
  }

}

@keyframes floatChat {
  0%{
    transform: translateY(0px);
  }

  50%{
    transform: translateY(-4px);
  }

  100%{
    transform: translateY(0px);
  }
}


