/* Chat Flotante TOC Ingeniería */

/* Botón flotante */
.toc-chat-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #206edd, #1a5cb8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(32, 110, 221, 0.4);
  z-index: 9999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toc-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(32, 110, 221, 0.6);
}

.toc-chat-btn:active {
  transform: scale(0.95);
}

.toc-chat-btn svg {
  width: 36px;
  height: 36px;
}

/* Caja del chat */
.toc-chat {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all 0.3s ease;
}

.toc-chat.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.toc-chat .header {
  background: linear-gradient(135deg, #206edd, #1a5cb8);
  color: #fff;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.toc-chat .header .title {
  font-weight: 600;
  font-size: 16px;
}

/* Área de mensajes */
.toc-chat .messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-chat .messages::-webkit-scrollbar {
  width: 6px;
}

.toc-chat .messages::-webkit-scrollbar-track {
  background: #e0e0e0;
}

.toc-chat .messages::-webkit-scrollbar-thumb {
  background: #206edd;
  border-radius: 3px;
}

/* Mensajes */
.bot-message {
  background: #e3e8f0;
  color: #333;
  padding: 10px 14px;
  border-radius: 15px 15px 15px 5px;
  max-width: 85%;
  align-self: flex-start;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
}

.bot-message a {
  color: #206edd;
  text-decoration: none;
  word-break: break-all;
}

.bot-message a:hover {
  text-decoration: underline;
}

.user-message {
  background: linear-gradient(135deg, #206edd, #1a5cb8);
  color: #fff;
  padding: 10px 14px;
  border-radius: 15px 15px 5px 15px;
  max-width: 85%;
  align-self: flex-end;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
}

/* Área de input */
.toc-chat .input-area {
  display: flex;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  gap: 8px;
}

.toc-chat .input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 25px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s;
}

.toc-chat .input-area input:focus {
  border-color: #206edd;
}

.toc-chat .input-area button {
  background: linear-gradient(135deg, #206edd, #1a5cb8);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.toc-chat .input-area button:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(32, 110, 221, 0.3);
}

.toc-chat .input-area button:active {
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 480px) {
  .toc-chat {
    bottom: 80px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    height: calc(100vh - 180px);
  }

  .toc-chat-btn {
    bottom: 15px;
    right: 15px;
    width: 55px;
    height: 55px;
  }
}
