body {
  background: #111;
}

/* BIG VIDEO TOGGLE BUTTON */
.chat-toggle-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 80px;
  height: 65px;
  border: none;
  cursor: pointer;
  background: transparent;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 20px;
}

/* Chat tail */
.chat-toggle-btn::after {
  content: "";
  position: absolute;
  bottom: 4px;
  right: 8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #ffffff;
}

.chat-toggle-btn:hover {
  transform: scale(0.9);
}

/* VIDEO BOT AVATAR */
.chat-toggle-btn .bot-avatar {
  position: relative;
  width: 85px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chat-toggle-btn .bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform: scaleX(-1);
}

/* CYAN PULSE FOR VIDEO */
.chat-toggle-btn .avatar-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(83, 83, 83, 0.6);
  animation: videoPulse 2s ease-in-out infinite;
  z-index: 1;
}

@keyframes videoPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* CHAT PANEL */
.chat-panel {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 350px;
  height: 500px;
  display: none;
  flex-direction: column;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  z-index: 999;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.chat-panel.open {
  display: flex;
}

/* HEADER */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #1f2024, #d6dcf1);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* HEADER AVATAR (Static BOLT + white pulse) */
.chat-header .bot-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header .bot-avatar img {
  width: 58%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  position: relative;
}


.chat-header .avatar-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 0; }
}

.bot-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.bot-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.bot-status::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #38c172;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: statusBlink 1.5s ease-in-out infinite;
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.close-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: black;
}

/* MESSAGES */
.chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background: transparent;
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}

.welcome-card {
  background: #6b6b738f;
  border-radius: 18px;
  padding: 22px 18px 18px;
  text-align: center;
  margin-top: 8px;
  color: #111;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.wave {
  font-size: 38px;
  margin-bottom: 10px;
}

.welcome-card h3 {
  margin: 2px 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

.welcome-card p {
  font-size: 14px;
  color: rgba(12, 12, 12, 0.829);
}

.quick-options {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-btn {
  padding: 11px 12px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: #ffffff;
  background: linear-gradient(135deg, rgb(31, 32, 36), rgb(214, 220, 241));
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease;
  transform: translateZ(0);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.quick-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(60, 62, 68, 0.95),
    rgba(120, 130, 160, 0.25)
  );
  border: 1px solid rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  color: cyan;
}

.user-message {
  align-self: flex-end;
  color: white;
  border-radius: 18px 18px 2px 18px;
  max-width: 75%;
  padding: 10px 12px;
  margin: 10px 0;
  line-height: 1.5;
  font-size: 14px;
  animation: messageSlide 0.3s ease-out;
  word-wrap: break-word;
  background: linear-gradient(135deg, #1f2024, #d6dcf1);
}

@keyframes messageSlide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.bot-message {
  align-self: flex-start;
  margin: 10px 0;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.507);
  color: rgb(19, 18, 18);
  padding: 10px 12px;
  max-width: 85%;
  border-radius: 2px 18px 18px 18px;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

#chatInput {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 253, 253, 0.918);
  backdrop-filter: blur(5px);
  border-radius: 12px;
  outline: none;
  font-size: 14px;
  color: #2c3e50;
}

#chatInput::placeholder {
  color: rgba(0, 0, 0, 0.45);
}

.send-btn {
  background: linear-gradient(135deg, #b1bdee, #1a1f2e);
  color: white;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.send-btn:hover {
  transform: scale(1.05);
}

.send-btn svg {
  width: 20px;
  height: 20px;
  stroke: white;
  fill: none;
}

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

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.7);
}

@media (max-width: 1200px) {
  .chat-toggle-btn {
    width: 65px;
    height: 55px;
  }

  .chat-toggle-btn .bot-avatar img {
    width: 100%;
    height: 80%;
  }
}

@media (max-width: 700px ) {
  .chat-toggle-btn {
    width: 55px;
    height: 45px;
  }

  .chat-toggle-btn .bot-avatar img {
    width: 100%;
    height: 70%;
  }

  .chat-toggle-btn::after{
    bottom: 4px;
    right: 7px;
    border-right: 2px solid transparent;
  }
}

@media (max-width: 480px) {
  .chat-panel {
    right: 12px;
    bottom: 25px;
    width: calc(100vw - 70px);
    height: calc(100vh - 340px);
    max-height: 600px;
  }
}
