/* assets/css/chatbot.css */

/* Chatbot Variables */
:root {
  --chatbot-bg: rgba(20, 20, 20, 0.85);
  --chatbot-border: rgba(255, 255, 255, 0.1);
  --chatbot-primary: rgba(100, 150, 255, 0.9);
  --chatbot-primary-hover: rgba(80, 130, 240, 1);
  --chatbot-text: #ffffff;
  --chatbot-text-muted: #aaaaaa;
  --chatbot-msg-user: rgba(100, 150, 255, 0.2);
  --chatbot-msg-bot: rgba(40, 40, 40, 0.7);
  --chatbot-zindex: 9999;
}

/* Floating Action Button Container */
#goliath-fab-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: var(--chatbot-zindex);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
}

#goliath-fab {
  width: 60px;
  height: 60px;
  background: var(--chatbot-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

#goliath-fab:hover {
  transform: scale(1.1);
  background: var(--chatbot-primary-hover);
}

#goliath-fab i {
  color: #fff;
  font-size: 24px;
}

/* Popup Notification */
.goliath-popup {
  background: var(--chatbot-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--chatbot-border);
  padding: 12px 18px;
  border-radius: 12px 12px 0 12px;
  color: var(--chatbot-text);
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom right;
}

.goliath-popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.goliath-popup-text {
  line-height: 1.4;
}

.goliath-popup-close {
  background: none;
  border: none;
  color: var(--chatbot-text-muted);
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  transition: color 0.2s;
}

.goliath-popup-close:hover {
  color: var(--chatbot-text);
}

/* Notification Dot */
.goliath-notification {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #ff4757;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* Chatbot Tooltip */
.goliath-tooltip {
  position: absolute;
  right: 75px;
  background: var(--chatbot-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--chatbot-text);
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: all 0.3s ease;
  border: 1px solid var(--chatbot-border);
}

#goliath-fab:hover .goliath-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Chat Window */
#goliath-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  height: 550px;
  max-height: calc(100vh - 120px);
  max-width: calc(100vw - 40px);
  background: var(--chatbot-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--chatbot-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: var(--chatbot-zindex);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

#goliath-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.goliath-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--chatbot-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.goliath-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.goliath-title {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 16px;
  color: var(--chatbot-text);
  margin: 0;
}

.goliath-badge {
  background: var(--chatbot-primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  letter-spacing: 1px;
}

.goliath-status {
  font-size: 12px;
  color: var(--chatbot-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.goliath-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #32ff7e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px rgba(50, 255, 126, 0.6);
}

.goliath-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.goliath-action-btn, .goliath-close {
  background: none;
  border: none;
  color: var(--chatbot-text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goliath-close {
  font-size: 18px;
}

.goliath-action-btn:hover, .goliath-close:hover {
  color: var(--chatbot-text);
}

/* Messages Area */
.goliath-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

/* Scrollbar Customization */
.goliath-messages::-webkit-scrollbar {
  width: 6px;
}

.goliath-messages::-webkit-scrollbar-track {
  background: transparent;
}

.goliath-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* Individual Message Styles */
.goliath-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  animation: msg-appear 0.3s ease forwards;
  word-wrap: break-word;
}

@keyframes msg-appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.goliath-msg.bot {
  align-self: flex-start;
  background: var(--chatbot-msg-bot);
  border-top-left-radius: 4px;
  color: var(--chatbot-text);
  border: 1px solid var(--chatbot-border);
}

.goliath-msg.user {
  align-self: flex-end;
  background: var(--chatbot-msg-user);
  border-top-right-radius: 4px;
  color: var(--chatbot-text);
  border: 1px solid rgba(100, 150, 255, 0.3);
}

/* Input Area */
.goliath-input-area {
  padding: 16px;
  border-top: 1px solid var(--chatbot-border);
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
}

.goliath-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--chatbot-border);
  padding: 12px 16px;
  border-radius: 24px;
  color: var(--chatbot-text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.goliath-input-area input:focus {
  border-color: rgba(100, 150, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.goliath-input-area input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.goliath-send-btn {
  background: var(--chatbot-primary);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.goliath-send-btn:hover {
  background: var(--chatbot-primary-hover);
  transform: scale(1.05);
}

.goliath-send-btn:active {
  transform: scale(0.95);
}

.goliath-send-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  transform: none;
}

/* Typing Indicator */
.goliath-typing {
  display: flex;
  gap: 5px;
  padding: 15px 20px;
  background: var(--chatbot-msg-bot);
  border-radius: 14px;
  border-top-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid var(--chatbot-border);
}

.goliath-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--chatbot-text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.goliath-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.goliath-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.goliath-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  #goliath-window {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    border: none;
  }

  #goliath-fab-container {
    bottom: 20px;
    right: 20px;
  }
}
