/* Estilos para o ChatBot */
:root {
    --primary-color: #c10023;
    --secondary-color: #0c2340;
    --accent-color: #f8f9fa;
    --text-color: #333;
    --light-text: #fff;
    --box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
  }
  
  /* Botão flutuante do chat */
  .chat-float-btn {
    position: fixed;
    bottom: 5px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(193, 0, 35, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    transition: var(--transition);
    border: none;
  }
  
  .chat-float-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 25px rgba(193, 0, 35, 0.4);
  }
  
  .chat-float-btn i {
    color: white;
    font-size: 24px;
  }
  
  .chat-float-btn .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }
  
  /* Container principal do chatbot */
  .chatbot-container {
    position: fixed;
    bottom: 71px;
    right: 30px;
    width: 310px;
    max-width: 90vw;
    height: 520px;
    max-height: 65vh;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
  }
  
  .chatbot-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
  }
  
  /* Cabeçalho do chatbot */
  .chatbot-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }
  
  .chatbot-header-left {
    display: flex;
    align-items: center;
  }
  
  .chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    position: relative;
    overflow: hidden;
  }
  
  .chatbot-avatar img {
    width: 100%;
    height: auto;
  }
  
  .chatbot-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #2ecc71;
    border-radius: 50%;
    border: 2px solid #fff;
  }
  
  .chatbot-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
  }
  
  .chatbot-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
  }
  
  .chatbot-header-actions {
    display: flex;
    align-items: center;
  }
  
  .chatbot-action-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
  }
  
  .chatbot-action-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
  }
  
  /* Corpo do chatbot onde aparecem as mensagens */
  .chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9f9fb;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  }
  
  .chatbot-body::-webkit-scrollbar {
    width: 6px;
  }
  
  .chatbot-body::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
  }
  
  .chatbot-body::-webkit-scrollbar-track {
    background-color: transparent;
  }
  
  /* Mensagens do chat */
  .chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    max-width: 80%;
  }
  
  .chat-message.bot {
    align-self: flex-start;
  }
  
  .chat-message.user {
    align-self: flex-end;
    margin-left: auto;
  }
  
  .message-content {
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }
  
  .bot .message-content {
    background-color: #fff;
    color: var(--text-color);
    border-bottom-left-radius: 5px;
  }
  
  .user .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, #d4173b 100%);
    color: white;
    border-bottom-right-radius: 5px;
  }
  
  .message-time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
    align-self: flex-end;
  }
  
  .bot .message-time {
    color: var(--text-color);
  }
  
  .user .message-time {
    color: var(--text-color);
  }
  
  /* Botões de opções */
  .chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
  }
  
  .chat-option-btn {
    background-color: #fff;
    color: var(--primary-color);
    border: 1px solid rgba(193, 0, 35, 0.2);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
  }
  
  .chat-option-btn:hover, .chat-option-btn:focus {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(193, 0, 35, 0.2);
  }
  
  /* Formulário para dados iniciais */
  .chat-form {
    background-color: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
  }
  
  .chat-form-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--secondary-color);
    font-size: 15px;
  }
  
  .chat-form-field {
    margin-bottom: 12px;
  }
  
  .chat-form-field label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 500;
  }
  
  .chat-form-field input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
  }
  
  .chat-form-field input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(193, 0, 35, 0.1);
    outline: none;
  }
  
  .chat-form-field input.error {
    border-color: #e74c3c;
  }
  
  .chat-form-submit {
    background: linear-gradient(135deg, var(--primary-color) 0%, #d4173b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
  }
  
  .chat-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(193, 0, 35, 0.2);
  }
  
  /* Rodapé do chatbot com input para enviar mensagem */
  .chatbot-footer {
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .chat-input-container {
    display: flex;
    align-items: center;
    background-color: #f5f5f7;
    border-radius: 30px;
    padding: 5px 15px;
    transition: var(--transition);
  }
  
  .chat-input-container:focus-within {
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(193, 0, 35, 0.3);
  }
  
  .chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 5px;
    font-size: 14px;
    outline: none;
  }
  
  .chat-input-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 50%;
  }
  
  .chat-input-btn:hover {
    background-color: rgba(193, 0, 35, 0.1);
    transform: scale(1.1);
  }
  
  .chat-input-btn.send {
    background-color: var(--primary-color);
    color: white;
  }
  
  .chat-input-btn.send:hover {
    background-color: #d4173b;
  }
  
  /* Animações */
  @keyframes pulseAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }
  
  .pulse {
    animation: pulseAnimation 2s infinite;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .fadeInUp {
    animation: fadeInUp 0.4s ease-out;
  }
  
  @keyframes typing {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
  }
  
  .typing-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
  }
  
  .typing-indicator span {
    width: 7px;
    height: 7px;
    background-color: #888;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
  }
  
  .typing-indicator span:nth-child(1) {
    animation: typing 1s infinite 0s;
  }
  
  .typing-indicator span:nth-child(2) {
    animation: typing 1s infinite 0.2s;
  }
  
  .typing-indicator span:nth-child(3) {
    animation: typing 1s infinite 0.4s;
  }

  




  /* Estilos para o efeito de digitação letra por letra */
.typing-text {
  display: inline-block;
  white-space: pre-wrap;
  margin: 0;
 /* border-right: 0.15em solid var(--primary-color);*/
  animation: blink-caret 0.75s step-end infinite;
}

/* Para animação de texto que já terminou de ser digitado */
.typing-done {
  border-right: none;
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--primary-color) }
}

/* Indicador de digitação melhorado */
.typing-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 12px 16px;
  background-color: #fff;
  border-radius: 15px;
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: inline-block;
  opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
  animation: bouncing 1s infinite 0s;
}

.typing-indicator span:nth-child(2) {
  animation: bouncing 1s infinite 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation: bouncing 1s infinite 0.4s;
}

@keyframes bouncing {
  0%, 100% { 
    transform: translateY(0);
  }
  50% { 
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Fade para as opções */
.chat-options {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-options.show {
  opacity: 1;
  transform: translateY(0);
}

/* Efeito fade-in para botões individuais */
.chat-option-btn {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.chat-option-btn.show {
  opacity: 1;
  transform: translateY(0);
}
  
  /* Responsividade */
  @media (max-width: 576px) {
    .chatbot-container {
      width: 100%;
      height: 100%;
      max-height: 80vh;
      bottom: 25px;
      right: 10px ;
      border-radius: 15px;
    }
    
    .chatbot-header {
      border-radius: 0;
    }
    
    .chat-float-btn {
      bottom: 30px;
      right: 20px;
    }
  }



  /* Modern Preloader CSS */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
  }
  
  .preloader-hidden {
    opacity: 0;
    visibility: hidden;
  }
  
  .preloader-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .spinner-circle {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--secondary-color);
    animation: spin 1.2s linear infinite;
  }
  
  .spinner-circle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom: 3px solid var(--primary-color);
    animation: spin 0.8s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Animation para o logo no preloader */
  .preloader-logo {
    position: absolute;
    max-width: 40px;
    max-height: 40px;
    animation: pulse 1.5s ease-in-out infinite;
  }
  
  @keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
  }