/* ================================================
   GLT Bot — Two-Pane Interactive UI
   ================================================ */

/* ── Floating Trigger Button ── */
#glt-bot-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a0e1a 0%, #111827 100%);
  border: 2px solid rgba(0, 212, 255, 0.5);
  box-shadow: 
    0 0 24px rgba(0, 212, 255, 0.35), 
    0 12px 48px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#glt-bot-trigger.hidden {
  transform: scale(0) rotate(90deg);
  opacity: 0;
  pointer-events: none;
}
#glt-bot-trigger:hover {
  transform: scale(1.1);
  border-color: rgba(0, 212, 255, 0.9);
  box-shadow: 
    0 0 40px rgba(0, 212, 255, 0.65), 
    0 18px 56px rgba(0, 0, 0, 0.85);
}
#glt-bot-trigger img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  transition: transform 0.3s ease;
  z-index: 2;
}
#glt-bot-trigger:hover img {
  transform: scale(1.08) rotate(-5deg);
}

/* Pulse rings for Trigger */
#glt-bot-trigger .bot-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(0, 212, 255, 0.3);
  animation: botPulse 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
#glt-bot-trigger .bot-pulse-2 {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.15);
  animation: botPulse 2.4s ease-in-out 0.8s infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes botPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0; }
}

/* ── Window Layout (Two Pane) ── */
#glt-bot-window {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 1200px;
  max-width: 65vw;
  height: 85vh;
  max-height: 1000px;
  min-height: 600px;
  background: linear-gradient(160deg, rgba(5, 8, 20, 0.99) 0%, rgba(8, 12, 28, 0.99) 100%);
  border: 3px solid #00d4ff;
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(0, 212, 255, 0.25),
    0 0 40px rgba(0, 212, 255, 0.4),
    0 32px 80px rgba(0, 0, 0, 0.9);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(28px);
  transform: scale(0.85) translateY(30px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#glt-bot-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* GLT Bot CSS v3.0 - Two Pane Layout */

/* ── Header ── */
#glt-bot-header {
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.14) 0%, rgba(0, 100, 180, 0.07) 100%);
  border-bottom: 2.5px solid rgba(0, 212, 255, 0.5);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 3px 20px rgba(0, 212, 255, 0.12);
}
.bot-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bot-header-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #00d4ff;
  padding: 2px;
}
.bot-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
.bot-header-title span { color: #00d4ff; }
.bot-header-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.bot-header-close:hover {
  background: rgba(255, 70, 70, 0.2);
  color: #ff4444;
  border-color: rgba(255, 70, 70, 0.4);
}

/* ── Body (Two Panes) ── */
#glt-bot-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Left Pane (History) ── */
#glt-bot-left-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 2px solid rgba(0, 212, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  position: relative;
}
#glt-bot-history {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}
#glt-bot-history::-webkit-scrollbar { width: 6px; }
#glt-bot-history::-webkit-scrollbar-track { background: transparent; }
#glt-bot-history::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 4px; }

/* Message Bubbles */
.bot-msg-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 90%;
  animation: msgSlideIn 0.3s ease;
}
.bot-msg-group.user-msg {
  align-self: flex-end;
  align-items: flex-end;
}
.bot-msg-group.bot-msg {
  align-self: flex-start;
  align-items: flex-start;
}

.bot-msg-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #00d4ff;
  display: flex;
  align-items: center;
  gap: 5px;
}
.user-msg .bot-msg-label { color: #a78bfa; }

.bot-msg-bubble {
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e2e8f0;
}
.bot-msg .bot-msg-bubble {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 4px 16px 16px 16px;
  border-left: 3px solid #00d4ff;
}
.bot-msg .bot-msg-bubble strong { color: #00d4ff; }

.user-msg .bot-msg-bubble {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 16px 4px 16px 16px;
  border-right: 3px solid #a78bfa;
}

@keyframes msgSlideIn {
  from { transform: translateY(15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Typing indicator */
.bot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 18px;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 4px 16px 16px 16px;
  width: fit-content;
}
.bot-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00d4ff;
  animation: typingBounce 1.2s ease infinite;
}
.bot-typing span:nth-child(2) { animation-delay: 0.2s; }
.bot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Right Pane (Options & Avatar) ── */
#glt-bot-right-pane {
  width: 400px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(10, 15, 32, 0) 0%, rgba(0, 212, 255, 0.03) 100%);
}

#glt-bot-options-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
}
.bot-back-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 14px;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-weight: 600;
}
.bot-back-btn:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: #00d4ff;
  color: #00d4ff;
}

#glt-bot-options {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#glt-bot-options::-webkit-scrollbar { width: 4px; }
#glt-bot-options::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.2); }

.bot-option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px;
  padding: 12px 18px;
  color: #e2e8f0;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.4;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.bot-option-btn:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: #00d4ff;
  color: #fff;
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(0,212,255,0.15);
}
.bot-option-btn .opt-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ── Avatar Stage (Bottom Right) ── */
#glt-bot-avatar-stage {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border-top: 1px solid rgba(0,212,255,0.1);
  background: rgba(0, 0, 0, 0.2);
}
.bot-avatar-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bot-avatar-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(0, 212, 255, 0.4);
  animation: avatarRingPulse 2.5s ease-in-out infinite;
}
.bot-avatar-ring::after {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.15);
  animation: avatarRingPulse 2.5s ease-in-out 0.6s infinite;
}
@keyframes avatarRingPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 0; transform: scale(1.15); }
}

#glt-bot-main-avatar {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #00d4ff;
  background: rgba(0, 0, 30, 0.8);
  box-shadow:
    0 0 0 3px rgba(0, 212, 255, 0.3),
    0 0 35px rgba(0, 212, 255, 0.5),
    0 0 60px rgba(0, 212, 255, 0.2);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#glt-bot-main-avatar.avatar-switch {
  transform: scale(0.6) rotate(15deg);
  opacity: 0;
}

/* Satisfaction */
.bot-satisfaction {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.bot-sat-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s;
}
.bot-sat-btn.yes {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.4);
  color: #00ff88;
}
.bot-sat-btn.yes:hover { background: rgba(0, 255, 136, 0.25); }
.bot-sat-btn.no {
  background: rgba(255, 160, 50, 0.1);
  border-color: rgba(255, 160, 50, 0.4);
  color: #ffa032;
}
.bot-sat-btn.no:hover { background: rgba(255, 160, 50, 0.25); }

/* ── Mobile Responsive ── */
@media (max-width: 900px) {
  #glt-bot-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 90px;
    height: 85vh;
  }
  #glt-bot-body {
    flex-direction: column;
  }
  #glt-bot-left-pane {
    border-right: none;
    border-bottom: 2px solid rgba(0,212,255,0.2);
    height: 50%;
  }
  #glt-bot-right-pane {
    width: 100%;
    height: 50%;
  }
  #glt-bot-avatar-stage {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 0;
    border: none;
    background: transparent;
  }
  #glt-bot-main-avatar {
    width: 80px;
    height: 80px;
  }
}
