/* ============================================
   KaiMed - Kai Chat Widget (Redesigned)
   Personaplex-inspired Aesthetic:
   - Dark Mode Glassmorphism
   - Premium Animations
   - Modern Typography
   ============================================ */

:root {
  --kai-bg-glass: rgba(20, 20, 25, 0.75);
  --kai-border-glass: rgba(255, 255, 255, 0.08);
  --kai-text-primary: #ffffff;
  --kai-text-secondary: rgba(255, 255, 255, 0.6);
  --kai-accent-green: #99a783;
  --kai-accent-glow: rgba(153, 167, 131, 0.4);
  --kai-msg-assistant: rgba(255, 255, 255, 0.05);
  --kai-msg-user: linear-gradient(135deg, #99a783, #4a6fa5);
  --kai-shadow-ambient: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ==========================================
   FLOATING ACTION BUTTON (FAB)
   ========================================== */
.kai-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(30, 30, 35, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--kai-border-glass);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--kai-accent-green);
  /* overflow: hidden; Removed to allow badge to pop out */
}

.kai-fab::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--kai-accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.kai-fab:hover {
  transform: scale(1.1) translateY(-4px);
  background: rgba(30, 30, 35, 0.8);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), 0 0 20px var(--kai-accent-glow);
  color: #fff;
}

.kai-fab:hover::after {
  opacity: 0.6;
}

.kai-fab-icon {
  width: 28px;
  height: 28px;
  position: absolute;
  transition: all 0.4s ease;
  z-index: 2;
}

.kai-fab-icon--chat {
  opacity: 1;
  transform: scale(1);
}

.kai-fab-icon--close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.kai-fab.open {
  background: var(--kai-accent-green);
  color: white;
  border-color: transparent;
}

.kai-fab.open .kai-fab-icon--chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.kai-fab.open .kai-fab-icon--close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Notification Badge */
.kai-fab-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff4757;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 3;
  /* Fix clipping/hiding */
  top: -2px;
  right: -2px;
  transform: translate(25%, -25%);
}

/* ==========================================
   CHAT PANEL
   ========================================== */
.kai-panel {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  width: 420px;
  height: 650px;
  max-height: calc(100vh - 10rem);

  /* Glassmorphism Base */
  background: var(--kai-bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--kai-border-glass);
  border-radius: 24px;

  box-shadow: var(--kai-shadow-ambient), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  transform: scale(0.9) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.kai-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Top Gradient Mesh Effect */
.kai-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 0%, rgba(153, 167, 131, 0.15), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(74, 111, 165, 0.15), transparent 40%);
  pointer-events: none;
  z-index: -1;
}

/* ==========================================
   PANEL HEADER
   ========================================== */
.kai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.kai-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kai-avatar {
  position: relative;
  width: 42px;
  height: 42px;
}

.kai-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  /* Invert checks if original image is dark; assuming white icon on transparent */
  filter: brightness(0) invert(1);
  padding: 6px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.kai-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid #202024;
  box-shadow: 0 0 8px #2ecc71;
  animation: kaiDotPulse 2s ease-in-out infinite;
}

@keyframes kaiDotPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0);
  }
}

.kai-header-info {
  display: flex;
  flex-direction: column;
}

.kai-header-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--kai-text-primary);
  letter-spacing: 0.02em;
}

.kai-header-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--kai-text-secondary);
}

.kai-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kai-header-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--kai-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.kai-header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--kai-text-primary);
}

.kai-header-btn svg {
  width: 20px;
  height: 20px;
}

/* Voice Toggle Specific Styles */
.kai-btn-voice-toggle {
  width: auto;
  padding: 0 10px;
  background: rgba(153, 167, 131, 0.1);
  border: 1px solid rgba(153, 167, 131, 0.2);
  color: var(--kai-text-secondary);
  overflow: hidden;
}

.kai-btn-voice-toggle:hover {
  background: rgba(153, 167, 131, 0.25);
  color: #fff;
  border-color: rgba(153, 167, 131, 0.4);
  box-shadow: 0 0 10px rgba(153, 167, 131, 0.15);
}

.kai-btn-voice-toggle.active {
  background: var(--kai-accent-green);
  color: #000;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(153, 167, 131, 0.4);
}

.kai-voice-btn-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kai-voice-icon {
  width: 16px !important;
  height: 16px !important;
}

.kai-voice-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.kai-header-btn.active {
  color: var(--kai-accent-green);
  background: rgba(153, 167, 131, 0.15);
  box-shadow: 0 0 10px rgba(153, 167, 131, 0.2);
}

/* ==========================================
   EMAIL GATE
   ========================================== */
.kai-email-gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.kai-email-gate.hidden {
  animation: kaiGateFadeOut 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  pointer-events: none;
}

@keyframes kaiGateFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.92);
    display: none;
  }
}

/* Chat area entrance after gate */
.kai-messages.kai-chat-enter {
  animation: kaiChatSlideIn 0.6s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.kai-input-area.kai-chat-enter {
  animation: kaiChatSlideIn 0.6s cubic-bezier(0.19, 1, 0.22, 1) 0.1s both;
}

@keyframes kaiChatSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.kai-gate-content {
  max-width: 300px;
}

.kai-gate-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(153, 167, 131, 0.15);
  border: 1px solid rgba(153, 167, 131, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--kai-accent-green);
}

.kai-gate-icon svg {
  width: 26px;
  height: 26px;
}

.kai-gate-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--kai-text-primary);
  margin: 0 0 0.5rem;
}

.kai-gate-desc {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--kai-text-secondary);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.kai-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kai-gate-input {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  outline: none;
  text-align: center;
  transition: all 0.3s ease;
}

.kai-gate-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--kai-accent-green);
  box-shadow: 0 0 0 2px rgba(153, 167, 131, 0.2);
}

.kai-gate-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.kai-gate-btn {
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  border: none;
  background: var(--kai-accent-green);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(153, 167, 131, 0.25);
}

.kai-gate-btn:hover {
  background: #aab894;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(153, 167, 131, 0.35);
}

.kai-gate-btn:active {
  transform: scale(0.97);
}

.kai-gate-btn svg {
  width: 18px;
  height: 18px;
}

.kai-gate-privacy {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.25);
  margin: 1rem 0 0;
}

/* ==========================================
   VOICE VISUALIZER (CANVAS)
   ========================================== */
.kai-voice-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.kai-panel.voice-active .kai-voice-canvas {
  opacity: 1;
}

/* ==========================================
   VOICE AGENT MODE (Full-Panel Takeover)
   ========================================== */
.kai-voice-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: radial-gradient(ellipse at center, rgba(10, 12, 18, 0.95), rgba(3, 3, 6, 0.99));
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.kai-voice-overlay.active {
  display: flex;
  opacity: 1;
}

.kai-panel.voice-agent-mode .kai-voice-canvas {
  opacity: 1;
  z-index: 21;
  pointer-events: none;
}

.kai-voice-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 25;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.kai-voice-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.kai-voice-close svg {
  width: 18px;
  height: 18px;
}

.kai-voice-status {
  position: absolute;
  bottom: 48px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 25;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
}

.kai-voice-status.listening {
  color: rgba(100, 255, 218, 0.7);
}

.kai-voice-status.thinking {
  color: rgba(153, 167, 131, 0.7);
}

.kai-voice-status.speaking {
  color: rgba(255, 255, 255, 0.6);
}

/* ---- Tap-to-Speak Fallback (Mobile) ---- */
.kai-tap-to-speak {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  border-radius: 20px;
  border: 1px solid rgba(100, 255, 218, 0.25);
  background: rgba(100, 255, 218, 0.08);
  color: rgba(100, 255, 218, 0.9);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: kaiTapPulse 2s ease-in-out infinite;
}

.kai-tap-to-speak:hover,
.kai-tap-to-speak:active {
  background: rgba(100, 255, 218, 0.15);
  border-color: rgba(100, 255, 218, 0.4);
  transform: translateX(-50%) scale(1.05);
}

.kai-tap-to-speak svg {
  width: 32px;
  height: 32px;
}

.kai-tap-to-speak span {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes kaiTapPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(100, 255, 218, 0.3);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(100, 255, 218, 0);
  }
}

/* Listening pulse indicator */
.kai-voice-status.listening::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(100, 255, 218, 0.8);
  margin-right: 8px;
  vertical-align: middle;
  animation: kaiStatusPulse 1.5s ease-in-out infinite;
}

@keyframes kaiStatusPulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

.kai-sphere-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  animation: kaiPulseText 2s ease-in-out infinite;
}

@keyframes kaiPulseText {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.8;
  }
}

/* ==========================================
   MESSAGES AREA
   ========================================== */
.kai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
  /* subtle pattern/texture could go here */
}

/* Custom scrollbar */
.kai-messages::-webkit-scrollbar {
  width: 4px;
}

.kai-messages::-webkit-scrollbar-track {
  background: transparent;
}

.kai-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.kai-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ==========================================
   MESSAGE BUBBLES
   ========================================== */
.kai-msg {
  max-width: 88%;
  animation: kaiFadeInUp 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.kai-msg--assistant {
  align-self: flex-start;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.kai-msg--user {
  align-self: flex-end;
}

.kai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  padding: 4px;
  background: rgba(255, 255, 255, 0.1);
  filter: brightness(0) invert(1);
}

.kai-msg-bubble {
  padding: 1rem 1.25rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.6;
  position: relative;
  backdrop-filter: blur(5px);
}

.kai-msg-bubble--assistant {
  background: var(--kai-msg-assistant);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px 18px 18px 4px;
  color: #e0e0e0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.kai-msg-bubble--user {
  background: var(--kai-msg-user);
  border-radius: 18px 18px 4px 18px;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(74, 111, 165, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes kaiFadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   TYPING INDICATOR
   ========================================== */
.kai-typing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem 1rem;
  flex-shrink: 0;
}

/* Smoother Wave Loading Animation */
.kai-typing-avatar-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 3px;
  background: rgba(255, 255, 255, 0.1);
  filter: brightness(0) invert(1);
}

.kai-typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: var(--kai-msg-assistant);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  align-items: center;
  height: 48px;
  /* Fixed height for consistency */
}

.kai-typing-dots span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kai-accent-green);
  animation: kaiWave 1.4s ease-in-out infinite both;
}

.kai-typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.kai-typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.kai-typing-dots span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes kaiWave {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }

  40% {
    transform: translateY(-5px);
    opacity: 1;
    box-shadow: 0 0 6px var(--kai-accent-green);
  }
}

/* ==========================================
   BOOKING CONFIRMATION CARD
   ========================================== */
.kai-booking-card {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 100%;
  animation: kaiFadeInUp 0.4s ease-out;
  align-self: stretch;
  margin-top: 0.5rem;
}

.kai-booking-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
  animation: kaiCheckPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kai-booking-check svg {
  width: 24px;
  height: 24px;
}

.kai-booking-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
  text-align: center;
}

.kai-booking-detail {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  text-align: center;
}

/* ==========================================
   SCHEDULER DATE/TIME PICKER
   ========================================== */
.kai-scheduler-card {
  background: rgba(153, 167, 131, 0.08);
  border: 1px solid rgba(153, 167, 131, 0.2);
  border-radius: 16px;
  padding: 1.25rem;
  max-width: 100%;
  animation: kaiFadeInUp 0.4s ease-out;
  align-self: stretch;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
}

.kai-scheduler-card.confirmed {
  opacity: 0.5;
  pointer-events: none;
}

.kai-scheduler-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.kai-scheduler-icon {
  width: 22px;
  height: 22px;
  color: var(--kai-accent-green);
  flex-shrink: 0;
}

.kai-scheduler-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--kai-text-primary);
}

.kai-scheduler-fields {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kai-scheduler-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kai-scheduler-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--kai-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kai-scheduler-select {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.kai-scheduler-select:focus {
  border-color: var(--kai-accent-green);
  box-shadow: 0 0 0 2px rgba(153, 167, 131, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
}

.kai-scheduler-select option {
  background: #1a1a1f;
  color: #fff;
  padding: 0.5rem;
}

.kai-scheduler-confirm {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: none;
  background: var(--kai-accent-green);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(153, 167, 131, 0.25);
}

.kai-scheduler-confirm:hover {
  background: #aab894;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(153, 167, 131, 0.35);
}

.kai-scheduler-confirm:active {
  transform: scale(0.97);
}

.kai-scheduler-confirm svg {
  width: 18px;
  height: 18px;
}

.kai-scheduler-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================
   INPUT AREA
   ========================================== */
.kai-input-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.kai-input-field {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  outline: none;
  transition: all 0.3s ease;
}

.kai-input-field:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--kai-accent-green);
  box-shadow: 0 0 0 2px rgba(153, 167, 131, 0.2);
}

.kai-input-field::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.kai-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: var(--kai-accent-green);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(153, 167, 131, 0.2);
}

.kai-send-btn:hover {
  background: #aab894;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(153, 167, 131, 0.3);
}

.kai-send-btn svg {
  width: 20px;
  height: 20px;
}

.kai-send-btn:active {
  transform: scale(0.95);
}

/* ==========================================
   MICROPHONE BUTTON
   ========================================== */
.kai-mic-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.kai-mic-btn svg {
  width: 22px;
  height: 22px;
}

.kai-mic-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.kai-mic-btn.listening {
  background: #e74c3c;
  color: white;
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
}

.kai-mic-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 16px;
  border: 2px solid #e74c3c;
  opacity: 0;
  pointer-events: none;
}

.kai-mic-btn.listening .kai-mic-pulse {
  animation: kaiDatePulse 1.5s ease-out infinite;
}

@keyframes kaiDatePulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ==========================================
   POWERED BY FOOTER
   ========================================== */
.kai-powered {
  padding: 0.5rem 1rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  flex-shrink: 0;
}

.kai-powered span {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .kai-panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .kai-fab {
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .kai-fab.open {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
  }
}

/* ==========================================
   CUSTOM CALENDAR STYLES
   ========================================== */
.kai-scheduler-header-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kai-calendar-container {
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1rem;
}

.kai-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  font-weight: 500;
}

.kai-calendar-header button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.kai-calendar-header button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.kai-calendar-header button svg {
  width: 18px;
  height: 18px;
}

.kai-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.kai-calendar-weekday {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.kai-calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s ease;
}

.kai-calendar-day:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.kai-calendar-day.selected {
  background: var(--kai-accent-green);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(153, 167, 131, 0.3);
}

.kai-calendar-day.disabled {
  color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

/* ==========================================
   TIME SLOT GRID STYLES
   ========================================== */
.kai-time-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.kai-time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
}

.kai-time-grid::-webkit-scrollbar {
  width: 3px;
}

.kai-time-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.kai-time-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.kai-time-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.6rem 0.25rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.kai-time-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.kai-time-pill.selected {
  background: var(--kai-accent-green);
  border-color: var(--kai-accent-green);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(153, 167, 131, 0.25);
}