/**
 * Webhoster AI Assistant Styles
 * Layout: 30% bot panel (left) | 70% chat panel (right)
 */

/* Main Section */
.ai-assistant-section {
  padding: 120px 0 80px;
  min-height: calc(100vh - 80px);
}

.ai-layout {
  display: grid;
  grid-template-columns: 30% 70%;
  gap: 40px;
  align-items: start;
}

/* Left Panel - Bot */
.ai-bot-panel {
  position: sticky;
  top: 120px;
  text-align: center;
  padding: 40px 20px;
}

.bot-info {
  margin-top: 30px;
}

.ai-badge {
  display: inline-block;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--primary, #00d4ff);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.bot-info h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  margin-bottom: 10px;
  line-height: 1.3;
}

.bot-info p {
  font-size: 0.95rem;
  color: var(--text-muted, #6b6b7b);
  line-height: 1.5;
}

/* Bot Character */
.bot-character {
  position: relative;
  display: inline-block;
  animation: botFloat 3s ease-in-out infinite;
}

@keyframes botFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Buzz Animation */
.bot-character.buzz {
  animation: botBuzz 0.5s ease-in-out;
}

@keyframes botBuzz {
  0%, 100% { transform: translateX(0) rotate(0); }
  10% { transform: translateX(-5px) rotate(-5deg); }
  20% { transform: translateX(5px) rotate(5deg); }
  30% { transform: translateX(-5px) rotate(-3deg); }
  40% { transform: translateX(5px) rotate(3deg); }
  50% { transform: translateX(-3px) rotate(-2deg); }
  60% { transform: translateX(3px) rotate(2deg); }
  70% { transform: translateX(-2px) rotate(-1deg); }
  80% { transform: translateX(2px) rotate(1deg); }
  90% { transform: translateX(-1px) rotate(0); }
}

/* Bot Face */
.bot-face {
  position: relative;
  width: 140px;
  height: 140px;
}

.bot-head {
  width: 120px;
  height: 100px;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  border-radius: 60px 60px 40px 40px;
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    0 10px 40px rgba(0, 212, 255, 0.4),
    inset 0 -10px 20px rgba(0, 0, 0, 0.2);
}

/* Eyes */
.bot-eye {
  width: 28px;
  height: 32px;
  background: white;
  border-radius: 14px;
  position: absolute;
  top: 28px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: botBlink 4s ease-in-out infinite;
}

.bot-eye.left { left: 22px; }
.bot-eye.right { right: 22px; }

.eye-pupil {
  width: 14px;
  height: 14px;
  background: #1a1a25;
  border-radius: 50%;
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.eye-pupil::after {
  content: '';
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  right: 2px;
}

@keyframes botBlink {
  0%, 45%, 55%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}

/* Mouth */
.bot-mouth {
  width: 30px;
  height: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 15px 15px;
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
}

.bot-mouth.happy {
  height: 16px;
  border-radius: 0 0 20px 20px;
}

.bot-mouth.thinking {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Ears */
.bot-ears {
  position: absolute;
  top: 55px;
  left: 0;
  width: 100%;
}

.bot-ear {
  width: 16px;
  height: 24px;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  border-radius: 8px;
  position: absolute;
}

.bot-ear.left {
  left: 0;
  border-radius: 8px 0 0 8px;
}

.bot-ear.right {
  right: 0;
  border-radius: 0 8px 8px 0;
}

/* Antenna */
.bot-antenna {
  width: 8px;
  height: 35px;
  background: linear-gradient(to top, #7c3aed, #00d4ff);
  border-radius: 4px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.antenna-ball {
  width: 18px;
  height: 18px;
  background: #00d4ff;
  border-radius: 50%;
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
  animation: antennaPulse 2s ease-in-out infinite;
}

@keyframes antennaPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.8); transform: translateX(-50%) scale(1); }
  50% { box-shadow: 0 0 40px rgba(0, 212, 255, 1); transform: translateX(-50%) scale(1.1); }
}

/* Antenna Pulse Rings */
.antenna-pulses {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 212, 255, 0);
  border-radius: 50%;
  opacity: 0;
}

/* Active pulse animation */
.antenna-pulses.active .pulse-ring {
  animation: pulseOut 3s ease-out forwards;
}

.antenna-pulses.active .pulse-ring:nth-child(1) {
  animation-delay: 0s;
}

.antenna-pulses.active .pulse-ring:nth-child(2) {
  animation-delay: 0.4s;
}

.antenna-pulses.active .pulse-ring:nth-child(3) {
  animation-delay: 0.8s;
}

@keyframes pulseOut {
  0% {
    width: 18px;
    height: 18px;
    border-color: rgba(0, 212, 255, 0.8);
    opacity: 1;
  }
  100% {
    width: 120px;
    height: 120px;
    border-color: rgba(0, 212, 255, 0);
    opacity: 0;
  }
}

/* Glow Effect */
.bot-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* Right Panel - Chat */
.ai-chat-panel {
  min-height: 500px;
}

.chat-window {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  padding-right: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar - Modern Minimal Style */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
  margin: 8px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.3);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.chat-messages::-webkit-scrollbar-thumb:active {
  background: rgba(0, 212, 255, 0.5);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Firefox scrollbar */
.chat-messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.chat-messages:hover {
  scrollbar-color: rgba(0, 212, 255, 0.2) transparent;
}

.chat-messages:empty::before {
  content: 'Start a conversation...';
  color: var(--text-muted, #6b6b7b);
  font-style: italic;
  text-align: center;
  padding: 80px 20px;
  display: block;
}

/* Chat Messages */
.chat-message {
  display: flex;
  gap: 12px;
  animation: messageSlide 0.3s ease;
}

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

.chat-message-user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-message-bot .chat-avatar {
  background: transparent;
  padding: 0;
  overflow: visible;
}

/* Mini Bot Avatar */
.mini-bot {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-bot-head {
  width: 28px;
  height: 24px;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  border-radius: 14px 14px 10px 10px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.mini-bot-eye {
  width: 6px;
  height: 7px;
  background: white;
  border-radius: 3px;
  position: absolute;
  top: 7px;
}

.mini-bot-eye.left { left: 6px; }
.mini-bot-eye.right { right: 6px; }

.mini-bot-mouth {
  width: 8px;
  height: 3px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0 0 4px 4px;
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.mini-bot-antenna {
  width: 2px;
  height: 6px;
  background: linear-gradient(to top, #7c3aed, #00d4ff);
  border-radius: 1px;
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
}

.mini-bot-antenna::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #00d4ff;
  border-radius: 50%;
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.8);
}

.chat-message-user .chat-avatar {
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
}

.chat-avatar svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

.chat-bubble {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.6;
  font-size: 15px;
}

.chat-message-bot .chat-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #ffffff);
  border-top-left-radius: 4px;
}

.chat-message-user .chat-bubble {
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  color: white;
  border-top-right-radius: 4px;
}

.chat-bubble p {
  margin: 0 0 10px 0;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble ul {
  margin: 10px 0;
  padding-left: 0;
  list-style: none;
}

.chat-bubble ul li {
  margin: 6px 0;
  padding-left: 18px;
  position: relative;
}

.chat-bubble ul li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--primary, #00d4ff);
}

.chat-bubble strong {
  color: var(--primary, #00d4ff);
}

.chat-message-user .chat-bubble strong {
  color: white;
}

.chat-bubble a {
  color: var(--primary, #00d4ff);
  text-decoration: underline;
}

.chat-message-user .chat-bubble a {
  color: white;
}

/* Typing Indicator */
.chat-typing {
  display: flex;
  gap: 5px;
  padding: 8px 0;
}

.chat-typing span {
  width: 8px;
  height: 8px;
  background: var(--text-muted, #6b6b7b);
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Chat Input */
.chat-input-form {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.chat-input-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input-container input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-primary, #ffffff);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input-container input::placeholder {
  color: var(--text-muted, #6b6b7b);
}

.chat-input-container input:focus {
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.chat-input-container button {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-input-container button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

.chat-input-container button svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

.chat-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, #6b6b7b);
  margin-top: 12px;
}

.chat-hint a {
  color: var(--primary, #00d4ff);
  text-decoration: none;
}

.chat-hint a:hover {
  text-decoration: underline;
}

/* Technical Note */
.technical-note {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--text-muted, #6b6b7b);
}

/* Light Theme */
[data-theme="light"] .ai-badge {
  background: rgba(8, 145, 178, 0.1);
  border-color: rgba(8, 145, 178, 0.3);
  color: #0891b2;
}

[data-theme="light"] .bot-info h2 {
  color: #0f172a;
}

[data-theme="light"] .bot-info p {
  color: #64748b;
}

[data-theme="light"] .bot-head {
  box-shadow: 
    0 10px 40px rgba(8, 145, 178, 0.3),
    inset 0 -10px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .bot-glow {
  background: radial-gradient(circle, rgba(8, 145, 178, 0.15) 0%, transparent 70%);
}

[data-theme="light"] .antenna-ball {
  box-shadow: 0 0 20px rgba(8, 145, 178, 0.6);
}

[data-theme="light"] .chat-window {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chat-messages {
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

[data-theme="light"] .chat-messages:hover {
  scrollbar-color: rgba(8, 145, 178, 0.3) transparent;
}

[data-theme="light"] .chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  background-clip: padding-box;
}

[data-theme="light"] .chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(8, 145, 178, 0.3);
  border: 2px solid transparent;
  background-clip: padding-box;
}

[data-theme="light"] .chat-messages::-webkit-scrollbar-thumb:active {
  background: rgba(8, 145, 178, 0.5);
  border: 2px solid transparent;
  background-clip: padding-box;
}

[data-theme="light"] .chat-messages:empty::before {
  color: #94a3b8;
}

[data-theme="light"] .chat-message-bot .chat-bubble {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .chat-bubble ul li::before {
  color: #0891b2;
}

[data-theme="light"] .chat-bubble strong {
  color: #0891b2;
}

[data-theme="light"] .chat-bubble a {
  color: #0891b2;
}

[data-theme="light"] .chat-typing span {
  background: #94a3b8;
}

[data-theme="light"] .chat-input-form {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .chat-input-container input {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .chat-input-container input::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .chat-input-container input:focus {
  border-color: rgba(8, 145, 178, 0.5);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

[data-theme="light"] .chat-hint {
  color: #64748b;
}

[data-theme="light"] .chat-hint a {
  color: #0891b2;
}

[data-theme="light"] .technical-note {
  border-color: #e2e8f0;
  color: #64748b;
}

/* Mobile Responsive */
@media (max-width: 992px) {
  .ai-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .ai-bot-panel {
    position: relative;
    top: 0;
    padding: 20px;
  }

  .bot-character {
    transform: scale(0.85);
  }

  .bot-info h2 {
    font-size: 1.25rem;
  }

  .chat-window {
    height: 500px;
  }
}

@media (max-width: 576px) {
  .ai-assistant-section {
    padding: 100px 0 60px;
  }

  .bot-character {
    transform: scale(0.75);
  }

  .chat-messages {
    padding: 16px;
  }

  .chat-bubble {
    max-width: 85%;
  }

  .chat-input-form {
    padding: 16px;
  }

  .chat-input-container input {
    padding: 12px 14px;
    font-size: 16px;
  }
}
