/* ── ISHWOR AI VOICE ASSISTANT STYLES (EMERALD DARK SYSTEM) ── */

:root {
  --ishwor-accent: #00f076;
  --ishwor-accent-glow: rgba(0, 240, 118, 0.25);
  --ishwor-bg: #090a0d;
  --ishwor-surface: #11141b;
  --ishwor-card: #161922;
  --ishwor-border: rgba(255, 255, 255, 0.1);
  --ishwor-text: #ffffff;
  --ishwor-muted: #9ca3af;
  --ishwor-dim: #6b7280;
}

/* Floating Trigger Button */
#ishwor-trigger-btn {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom) + 10px);
  right: max(20px, env(safe-area-inset-right) + 10px);
  z-index: 2147483647 !important;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px 8px 10px;
  background: var(--ishwor-surface);
  border: 1px solid rgba(0, 240, 118, 0.4);
  border-radius: 50px;
  color: var(--ishwor-text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 14px var(--ishwor-accent-glow);
  transition: all 0.2s ease;
  user-select: none;
  touch-action: manipulation;
}

#ishwor-trigger-btn:hover {
  transform: translateY(-3px);
  border-color: var(--ishwor-accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--ishwor-accent-glow);
}

#ishwor-trigger-btn.active {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.ishwor-avatar-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #000;
  border: 1px solid var(--ishwor-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.ishwor-btn-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.ishwor-btn-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ishwor-text);
}

.ishwor-btn-sub {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ishwor-accent);
  letter-spacing: 0.3px;
}

/* Floating Voice Greeting Toast */
#ishwor-voice-toast {
  position: fixed;
  bottom: max(78px, env(safe-area-inset-bottom) + 68px);
  right: max(20px, env(safe-area-inset-right) + 10px);
  z-index: 2147483646 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--ishwor-surface);
  border: 1px solid var(--ishwor-accent);
  border-radius: 50px;
  color: var(--ishwor-text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

#ishwor-voice-toast.hidden {
  display: none !important;
}

/* Main Assistant Panel */
#ishwor-panel {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom) + 10px);
  right: max(20px, env(safe-area-inset-right) + 10px);
  z-index: 2147483647 !important;
  width: 410px;
  max-width: calc(100vw - 28px);
  height: 580px;
  max-height: calc(100vh - 40px);
  background: var(--ishwor-surface);
  border: 1px solid var(--ishwor-border);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 240, 118, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.97);
  transition: all 0.25s ease;
}

#ishwor-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#ishwor-panel.expanded {
  width: 680px;
  max-width: calc(100vw - 32px);
  height: 75vh;
  max-height: 800px;
}

.ishwor-mobile-bar {
  display: none;
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 10px auto 4px auto;
  flex-shrink: 0;
}

/* Header */
.ishwor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--ishwor-bg);
  border-bottom: 1px solid var(--ishwor-border);
  user-select: none;
  flex-shrink: 0;
}

.ishwor-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ishwor-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #000;
  border: 1px solid var(--ishwor-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ishwor-title-box {
  display: flex;
  flex-direction: column;
}

.ishwor-name {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ishwor-text);
}

.ishwor-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ishwor-muted);
}

.ishwor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--ishwor-accent);
  box-shadow: 0 0 6px var(--ishwor-accent);
}

.ishwor-dot.thinking {
  background-color: #a855f7;
  animation: ishworBlink 0.8s infinite alternate;
}

.ishwor-dot.speaking {
  background-color: var(--ishwor-accent);
  animation: ishworPulse 0.5s infinite alternate;
}

.ishwor-dot.listening {
  background-color: #ef4444;
  animation: ishworPulse 0.4s infinite alternate;
}

@keyframes ishworBlink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes ishworPulse {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.2); }
}

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

.ishwor-icon-btn {
  background: transparent;
  border: none;
  color: var(--ishwor-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.ishwor-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Chat Body */
.ishwor-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.ishwor-body::-webkit-scrollbar {
  width: 5px;
}

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

/* Message Bubbles */
.ishwor-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: ishworFadeUp 0.2s ease-out;
}

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

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

.ishwor-msg.bot {
  align-self: flex-start;
}

.ishwor-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}

.ishwor-bubble strong {
  color: var(--ishwor-accent);
  font-weight: 600;
}

.ishwor-bubble code {
  background: #000;
  color: var(--ishwor-accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.ishwor-msg.user .ishwor-bubble {
  background: #1c202c;
  border: 1px solid rgba(0, 240, 118, 0.3);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.ishwor-msg.bot .ishwor-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ishwor-border);
  color: #e2e8f0;
  border-bottom-left-radius: 2px;
}

.ishwor-msg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 0 4px;
}

.ishwor-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ishwor-border);
  color: var(--ishwor-muted);
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ishwor-speak-btn:hover {
  color: #fff;
  border-color: var(--ishwor-accent);
}

.ishwor-time {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ishwor-dim);
}

/* Quick Chips */
.ishwor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ishwor-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ishwor-border);
  color: var(--ishwor-muted);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ishwor-chip:hover {
  border-color: var(--ishwor-accent);
  color: #fff;
  background: rgba(0, 240, 118, 0.08);
}

/* Footer Input Area */
.ishwor-footer {
  padding: 12px 16px;
  background: var(--ishwor-bg);
  border-top: 1px solid var(--ishwor-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.ishwor-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #141720;
  border: 1px solid var(--ishwor-border);
  border-radius: 50px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s ease;
}

.ishwor-input-row:focus-within {
  border-color: var(--ishwor-accent);
  box-shadow: 0 0 12px var(--ishwor-accent-glow);
}

.ishwor-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  min-width: 0;
  padding: 6px 0;
}

.ishwor-input::placeholder {
  color: var(--ishwor-dim);
}

.ishwor-action-btn {
  background: transparent;
  border: none;
  color: var(--ishwor-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.ishwor-action-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ishwor-action-btn.active-mic {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.ishwor-send-btn {
  background: var(--ishwor-accent);
  color: #000;
  font-weight: 700;
}

.ishwor-send-btn:hover {
  opacity: 0.9;
  box-shadow: 0 0 10px var(--ishwor-accent-glow);
}

.ishwor-footer-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ishwor-dim);
  padding: 0 4px;
}

/* Mobile Compatibility */
@media (max-width: 640px) {
  #ishwor-panel {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 85vh !important;
    height: 85dvh !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
  }

  .ishwor-mobile-bar {
    display: block;
  }
}
