/* chat-widget.css — Operra Website Chat Widget
   Sprint 8.0 — Dark theme, bottom-right floating bubble */

/* ---- Toggle Button ---- */
.fox-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f5731a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(245, 115, 26, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.fox-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(245, 115, 26, 0.5);
}
.fox-chat-toggle svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}
.fox-chat-toggle.open svg.icon-chat { display: none; }
.fox-chat-toggle:not(.open) svg.icon-close { display: none; }

/* ---- Panel ---- */
.fox-chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9998;
  width: 380px;
  max-height: 520px;
  background: #131a2b;
  border: 1px solid #1e2740;
  border-radius: 14px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.fox-chat-panel.visible {
  display: flex;
}

/* ---- Header ---- */
.fox-chat-header {
  padding: 16px 20px;
  background: #0b0f19;
  border-bottom: 1px solid #1e2740;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fox-chat-header .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(245, 115, 26, 0.12);
  border: 1px solid rgba(245, 115, 26, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #f5731a;
}
.fox-chat-header .info h4 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.fox-chat-header .info p {
  font-size: 11px;
  color: #7b8299;
  margin: 0;
}

/* ---- Messages ---- */
.fox-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
}
.fox-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.fox-chat-messages::-webkit-scrollbar-thumb {
  background: #1e2740;
  border-radius: 2px;
}

.fox-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.fox-msg.bot {
  align-self: flex-start;
  background: rgba(245, 115, 26, 0.08);
  border: 1px solid rgba(245, 115, 26, 0.15);
  color: #e0e4ef;
}
.fox-msg.user {
  align-self: flex-end;
  background: #1a2235;
  color: #e0e4ef;
}

/* Typing indicator */
.fox-msg.typing .dots {
  display: inline-flex;
  gap: 4px;
}
.fox-msg.typing .dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5731a;
  animation: fox-dot 1.2s infinite;
}
.fox-msg.typing .dots span:nth-child(2) { animation-delay: 0.2s; }
.fox-msg.typing .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes fox-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ---- Input ---- */
.fox-chat-input {
  padding: 12px 16px;
  border-top: 1px solid #1e2740;
  display: flex;
  gap: 8px;
  background: #0b0f19;
}
.fox-chat-input input {
  flex: 1;
  background: #1a2235;
  border: 1px solid #1e2740;
  border-radius: 8px;
  padding: 10px 14px;
  color: #e0e4ef;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.fox-chat-input input:focus {
  border-color: #f5731a;
}
.fox-chat-input input::placeholder {
  color: #7b8299;
}
.fox-chat-input button {
  background: #f5731a;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.fox-chat-input button:hover {
  background: #ff8c42;
}
.fox-chat-input button svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}
.fox-chat-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .fox-chat-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 84px;
    max-height: 70vh;
  }
  .fox-chat-toggle {
    right: 16px;
    bottom: 16px;
  }
}
