:root {
  --gradient-accent: linear-gradient(135deg, #010DAC, #29B0E6, #930CF1, #D865FF);
}

@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  max-height: 750px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-family: 'Inter', sans-serif;
  display: none;
  flex-direction: column;
  z-index: 9999;
}

#chat-header {
  background: var(--gradient-accent);
  background-size: 300% 100%;
  animation: gradientAnimation 5s ease infinite;
  color: white;
  padding: 12px 15px;
  border-radius: 12px 12px 0 0;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  min-height: 50px;
}

#chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0 5px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chat-close:hover {
  color: #ff6b6b;
  transform: scale(1.1);
}

#chat-messages {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  margin-bottom: 15px;
  padding: 12px 15px;
  border-radius: 8px;
  max-width: 85%;
  text-align: left;
  line-height: 1.6;
  font-size: 14px;
}

.message br {
  margin-bottom: 8px;
  display: block;
  content: "";
}

.message strong {
  display: inline;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

/* Estilo para mensagens do Tecas */
.tecas-message {
  background: #f8f9fa;
  margin-right: auto;
  text-align: left;
  white-space: pre-line;
}

.tecas-message .icon {
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

.tecas-message .time {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.tecas-message .location {
  color: #666;
  margin-left: 20px;
  font-size: 13px;
}

.tecas-message .speakers {
  margin-left: 20px;
  color: #444;
  font-size: 13px;
}

/* Estilo para mensagens do utilizador */
.user-message {
  background: #f5f8ff;
  margin-left: auto;
  text-align: right;
}

.chat-options {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.chat-option:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.chat-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.chat-option span {
  font-size: 14px;
  color: #333;
}

#chat-input {
  border: none;
  border-top: 1px solid #ccc;
  padding: 12px 15px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  border-radius: 0 0 12px 12px;
  transition: all 0.3s ease;
}

#chat-input:focus {
  outline: none;
  border-top: 2px solid var(--purple-dark);
}

#chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--gradient-accent);
  background-size: 300% 100%;
  animation: gradientAnimation 5s ease infinite;
  color: white;
  border: none;
  border-radius: 50%;
  width: 85px;
  height: 85px;
  font-size: 38px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.chat-link {
  color: #0066cc;
  text-decoration: none;
  word-break: break-all;
  display: inline-block;
  max-width: 100%;
  transition: color 0.3s ease;
  line-height: 1.4;
}

.chat-link:hover {
  color: #004080;
  text-decoration: underline;
}

#typing-indicator {
  font-style: italic;
  color: #555;
  margin-top: 5px;
  margin-left: 10px;
}

/* Estilos para dispositivos móveis */
@media screen and (max-width: 768px) {
  #chat-container {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    margin: 0;
    display: none;
  }

  #chat-container[style*="display: flex"] {
    display: flex !important;
  }

  #chat-header {
    border-radius: 0;
    padding: 15px;
    min-height: 60px;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  #chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #chat-input {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px;
    font-size: 16px;
    border-top: 1px solid #ccc;
  }

  .message {
    max-width: 90%;
    padding: 12px 15px;
  }

  .chat-option {
    padding: 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
  }

  .chat-option input[type="radio"] {
    width: 20px;
    height: 20px;
  }

  .chat-option span {
    font-size: 15px;
    font-weight: 500;
  }

  #chat-toggle {
    width: 60px;
    height: 60px;
    font-size: 24px;
    bottom: 20px;
    right: 20px;
  }

  #chat-close {
    padding: 10px;
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Reforço para garantir posicionamento do chat em todas as páginas */
#chat-toggle, #chat-container {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 9999 !important;
} 