/* ==========================================================================
   Cyberpunk AI Assistant Chatbot Styles - Akhil S Portfolio
   ========================================================================== */

:root {
  --cb-primary: #00f0ff;
  --cb-secondary: #7000ff;
  --cb-accent: #00f5a0;
  --cb-bg: rgba(10, 16, 28, 0.95);
  --cb-bg-card: rgba(18, 28, 48, 0.7);
  --cb-border: rgba(0, 240, 255, 0.25);
  --cb-text: #e2e8f0;
  --cb-text-muted: #94a3b8;
  --cb-shadow: 0 10px 30px -5px rgba(0, 240, 255, 0.25), 0 0 20px rgba(112, 0, 255, 0.15);
}

/* Chatbot Floating Trigger Button */
.chatbot-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a103c 100%);
  border: 2px solid var(--cb-primary);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 99999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.chatbot-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.75), 0 0 15px var(--cb-secondary);
  border-color: #fff;
}

.chatbot-trigger:active {
  transform: scale(0.96);
}

.chatbot-trigger .trigger-icon {
  position: relative;
  transition: transform 0.3s ease;
}

.chatbot-trigger.active .trigger-icon {
  transform: rotate(90deg);
}

/* Glowing Pulsing Status Dot on Launcher */
.chatbot-trigger .online-pulse {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cb-accent);
  border: 2px solid #0d1b2a;
  box-shadow: 0 0 10px var(--cb-accent);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 160, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 245, 160, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 160, 0); }
}

/* Chatbot Floating Window */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 410px;
  max-width: calc(100vw - 36px);
  height: 590px;
  max-height: calc(100vh - 120px);
  background: var(--cb-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--cb-border);
  border-radius: 18px;
  box-shadow: var(--cb-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(13, 27, 42, 0.95) 0%, rgba(26, 16, 60, 0.95) 100%);
  border-bottom: 1px solid var(--cb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-primary) 0%, var(--cb-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  flex-shrink: 0;
}

.chatbot-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chatbot-title {
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-subtitle {
  color: var(--cb-accent);
  font-size: 10.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Space Grotesk', sans-serif;
}

.chatbot-subtitle::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cb-accent);
  box-shadow: 0 0 6px var(--cb-accent);
}

.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Auto-Voice Speak Toggle in Header */
.cb-voice-auto-btn {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cb-voice-auto-btn:hover {
  color: #fff;
  border-color: var(--cb-primary);
}

.cb-voice-auto-btn.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cb-primary);
  color: var(--cb-primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

/* Gemini Live AI Toggle Button in Header */
.cb-gemini-toggle {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #e2e8f0;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.cb-gemini-toggle .toggle-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  transition: all 0.25s ease;
}

.cb-gemini-toggle.active {
  background: rgba(0, 245, 160, 0.15);
  border-color: var(--cb-accent);
  color: var(--cb-accent);
  box-shadow: 0 0 10px rgba(0, 245, 160, 0.25);
}

.cb-gemini-toggle.active .toggle-dot {
  background: var(--cb-accent);
  box-shadow: 0 0 8px var(--cb-accent);
  animation: pulse-glow 1.8s infinite;
}

.cb-gemini-toggle:hover {
  border-color: var(--cb-primary);
  color: #fff;
}

/* 3-State Language Switcher Chips */
.cb-lang-chips {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.cb-lang-chip {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.cb-lang-chip:hover {
  color: #fff;
}

.cb-lang-chip.active {
  background: rgba(0, 240, 255, 0.25);
  color: #00f0ff;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.chatbot-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cb-text);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
}

.chatbot-lang-btn:hover,
.chatbot-close-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cb-primary);
  color: #fff;
}

/* Chatbot Messages Container */
.chatbot-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.25);
  border-radius: 4px;
}

/* Message Bubbles */
.chatbot-msg-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeInMsg 0.3s ease;
}

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

.chatbot-msg-wrap.user {
  align-items: flex-end;
}

.chatbot-msg-wrap.bot {
  align-items: flex-start;
}

.chatbot-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.chatbot-msg.user {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(112, 0, 255, 0.35) 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.chatbot-msg.bot {
  background: rgba(18, 28, 48, 0.85);
  border: 1px solid var(--cb-border);
  color: var(--cb-text);
  border-bottom-left-radius: 3px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.chatbot-msg.bot strong {
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
}

.chatbot-msg.bot a {
  color: var(--cb-primary);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 240, 255, 0.4);
  transition: all 0.2s;
}

.chatbot-msg.bot a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* Bot Message Action Bar (Voice Read Aloud & Source) */
.chatbot-msg-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.cb-speak-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.cb-speak-btn:hover {
  color: var(--cb-primary);
}

.cb-speak-btn.speaking {
  color: var(--cb-accent);
  animation: pulse-glow 1s infinite;
}

.cb-model-tag {
  font-size: 9.5px;
  color: #64748b;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.3px;
}

/* Recruiter Direct Action Links inside Bot Messages */
.chatbot-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chatbot-action-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cb-primary) !important;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.chatbot-action-link:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--cb-primary);
  color: #fff !important;
  transform: translateY(-1px);
}

.chatbot-action-link.whatsapp {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
  color: #25d366 !important;
}

.chatbot-action-link.whatsapp:hover {
  background: rgba(37, 211, 102, 0.3);
  color: #fff !important;
}

/* Quick Action Chips Bar Above Input */
.cb-chips-bar {
  padding: 6px 12px;
  background: rgba(13, 21, 36, 0.95);
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.cb-chips-bar::-webkit-scrollbar {
  display: none;
}

.cb-chip-btn {
  background: rgba(18, 28, 48, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.22);
  color: #cbd5e1;
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cb-chip-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--cb-primary);
  color: #fff;
  transform: translateY(-1px);
}

/* Typing Indicator */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(18, 28, 48, 0.85);
  border: 1px solid var(--cb-border);
  border-radius: 14px;
  border-bottom-left-radius: 3px;
  width: fit-content;
}

.chatbot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cb-primary);
  opacity: 0.4;
  animation: typing-dots 1.2s infinite ease-in-out;
}

.chatbot-dot:nth-child(1) { animation-delay: 0s; }
.chatbot-dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dots {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Chatbot Input Footer */
/* Markdown Content Styling */
.cb-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: #fff;
  margin: 10px 0 6px 0;
  display: block;
}

.cb-heading.h1 {
  font-size: 15px;
  color: var(--cb-primary);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  padding-bottom: 3px;
}

.cb-heading.h2 {
  font-size: 14px;
  color: var(--cb-primary);
}

.cb-heading.h3 {
  font-size: 13px;
  color: var(--cb-accent);
}

.cb-list-item {
  margin: 4px 0;
  line-height: 1.5;
  padding-left: 2px;
}

.chatbot-msg.bot pre {
  background: rgba(10, 16, 28, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 6px;
  padding: 8px;
  overflow-x: auto;
  margin: 6px 0;
  font-family: 'Fira Code', monospace;
  font-size: 11px;
}

.chatbot-msg.bot code {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  background: rgba(0, 240, 255, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--cb-accent);
}

.chatbot-footer {
  padding: 10px 14px;
  background: rgba(10, 16, 28, 0.98);
  border-top: 1px solid var(--cb-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  background: rgba(18, 28, 48, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chatbot-input:focus {
  border-color: var(--cb-primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.chatbot-input.listening {
  border-color: #ff0055 !important;
  box-shadow: 0 0 12px rgba(255, 0, 85, 0.45) !important;
  color: #ff99bb !important;
}

.chatbot-input.listening::placeholder {
  color: #ff6699 !important;
}

.chatbot-input::placeholder {
  color: #64748b;
  font-size: 12px;
}

.chatbot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-primary) 0%, var(--cb-secondary) 100%);
  border: none;
  color: #0a0f1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  color: #fff;
}

/* Voice Chat Microphone Button */
.chatbot-mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(18, 28, 48, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cb-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  transition: all 0.25s ease;
  flex-shrink: 0;
  outline: none;
}

.chatbot-mic-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cb-primary);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.chatbot-mic-btn.listening {
  background: rgba(255, 0, 85, 0.25);
  border-color: #ff0055;
  color: #ff0055;
  box-shadow: 0 0 16px rgba(255, 0, 85, 0.7);
  animation: mic-pulse 1.2s infinite ease-in-out;
}

@keyframes mic-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.6); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(255, 0, 85, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); }
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .chatbot-trigger {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
    font-size: 21px;
  }
  .chatbot-window {
    bottom: 84px;
    right: 14px;
    left: 14px;
    width: auto;
    height: 520px;
    max-height: calc(100vh - 100px);
  }
}
