/* DelaAI Chat Widget - Dark Theme Styles */
/* Enhanced with modern conversation card design */

/* ==================== STANDALONE DEMO RULES (without theme prefix) ==================== */
.delaai-message.assistant {
  color: #ffffff !important;
}

#delaai-company-name {
  color: #ffffff !important;
}

/* ==================== DARK THEME ==================== */
.delaai-theme-dark #delaai-chat-launcher {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.delaai-theme-dark #delaai-chat-launcher:hover {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
}

.delaai-theme-dark #delaai-chat-container {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid #374151;
}

.delaai-theme-dark #delaai-chat-header {
  background: linear-gradient(135deg, #11182700 0%, #1f293700 100%);
  color: #f9fafb;
  border-bottom-color: #374151;
}

.delaai-theme-dark #delaai-header-logo {
  border-color: rgba(249, 250, 251, 0.1);
}

.delaai-theme-dark #delaai-chat-close {
  color: #9ca3af;
}

.delaai-theme-dark #delaai-chat-close:hover {
  background: rgba(156, 163, 175, 0.2);
  color: #f3f4f6;
}

.delaai-theme-dark .delaai-welcome-message::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.delaai-theme-dark .delaai-message.assistant {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  color: #f3f4f6;
  border: 1px solid #4b5563;
}

.delaai-theme-dark #delaai-chat-input {
  background: #374151;
  border: 1px #4b5563;
  color: #f3f4f6;
}

.delaai-theme-dark #delaai-chat-input::placeholder {
  color: #9ca3af;
}

.delaai-theme-dark #delaai-chat-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.delaai-theme-dark #delaai-chat-send {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.delaai-theme-dark .delaai-faq-item {
  background: #374151;
  color: #d1d5db;
  border: 1px solid #4b5563;
}

.delaai-theme-dark .delaai-faq-item:hover {
  background: #4b5563;
  border-color: #6366f1;
}

.delaai-theme-dark #delaai-chat-footer {
  border-top-color: #374151;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.delaai-theme-dark .delaai-footer-link {
  color: #9ca3af;
}

.delaai-theme-dark .delaai-footer-link:hover {
  color: #6366f1;
}

.delaai-theme-dark #delaai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
}

/* ==================== HISTORY HEADER STYLES ==================== */
.delaai-theme-dark .delaai-history-header {
  border-bottom-color: #374151;
  color: #f3f4f6;
}

.delaai-theme-dark .delaai-history-header h3 {
  color: #f3f4f6;
}

.delaai-theme-dark .delaai-history-header-bottom {
  border-top-color: #374151;
  background: rgba(31, 41, 55, 0);
}

/* ==================== MODERN CONVERSATION CARD DESIGN FOR DARK THEME ==================== */
.delaai-theme-dark .delaai-conversation-item {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(148, 163, 184, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Status indicator bar with purple gradient */
.delaai-theme-dark .delaai-conversation-item::before {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* Icon area with deep purple gradient */
.delaai-theme-dark .delaai-conversation-icon {
  background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Hover state with lighter background */
.delaai-theme-dark .delaai-conversation-item:hover {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(4px);
}

.delaai-theme-dark .delaai-conversation-item:hover .delaai-conversation-icon {
  background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Text colors for dark theme */
.delaai-theme-dark .delaai-conversation-date {
  color: #94a3b8;
}

.delaai-theme-dark .delaai-conversation-date::before {
  opacity: 0.5;
}

.delaai-theme-dark .delaai-conversation-text {
  color: #f1f5f9;
}

/* Message count badge with purple tint */
.delaai-theme-dark .delaai-conversation-messages-count {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Active/selected conversation state */
.delaai-theme-dark .delaai-conversation-item.active {
  background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
  border-color: rgba(139, 92, 246, 0.4);
}

.delaai-theme-dark .delaai-conversation-item.active::before {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* ==================== NAVIGATION BUTTONS ==================== */
.delaai-theme-dark .delaai-back-to-history {
  color: #60a5fa;
  font-weight: 500;
}

.delaai-theme-dark .delaai-back-to-history:hover {
  color: #93bbfc;
  background: rgba(96, 165, 250, 0.1);
}

/* ==================== DELETE BUTTON STYLING ==================== */
.delaai-theme-dark .delaai-delete-conversation-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.delaai-theme-dark .delaai-delete-conversation-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* ==================== ACTION BUTTONS ==================== */
.delaai-theme-dark .delaai-new-conversation-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.delaai-theme-dark .delaai-new-conversation-btn:hover {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  border-color: rgba(124, 58, 237, 0.3);
}

.delaai-theme-dark .delaai-new-conversation-btn-wide {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.delaai-theme-dark .delaai-new-conversation-btn-wide:hover {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.delaai-theme-dark .delaai-view-history-btn {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.08) 0%, rgba(96, 165, 250, 0.12) 100%);
  border: 1.5px solid rgba(96, 165, 250, 0.2);
  color: #60a5fa;
  font-weight: 500;
}

.delaai-theme-dark .delaai-view-history-btn::before {
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.1), transparent);
}

.delaai-theme-dark .delaai-view-history-btn:hover {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.12) 0%, rgba(96, 165, 250, 0.18) 100%);
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 8px 20px rgba(96, 165, 250, 0.15);
}

/* ==================== EMPTY STATE ==================== */
.delaai-theme-dark .delaai-empty-state {
  color: #94a3b8;
}

/* ==================== CUSTOM LOGO SUPPORT ==================== */
.delaai-theme-dark #delaai-chat-launcher.has-custom-logo {
  background: transparent !important;
  animation: none !important;
  border: none !important;
}

.delaai-theme-dark #delaai-chat-launcher.has-custom-logo:hover {
  background: transparent !important;
  animation: none !important;
}

/* ==================== ATTACHMENT BUTTON ==================== */
.delaai-theme-dark #delaai-chat-attach {
  background: rgba(55, 65, 81, 0.8);
  color: #9ca3af;
  border: 1px solid #4b5563;
}

.delaai-theme-dark #delaai-chat-attach:hover {
  background: #4b5563;
  color: #d1d5db;
  border-color: #6366f1;
}

.delaai-theme-dark #delaai-chat-attach.has-attachment {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border: 1px solid transparent;
}

/* ==================== REGISTRATION FORM DARK THEME ==================== */
.delaai-theme-dark .delaai-registration-form {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.delaai-theme-dark .delaai-registration-title {
  color: #f1f5f9;
}

.delaai-theme-dark .delaai-form-label {
  color: #cbd5e1;
}

.delaai-theme-dark .delaai-form-input {
  background: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

.delaai-theme-dark .delaai-form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.delaai-theme-dark .delaai-submit-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.delaai-theme-dark .delaai-submit-btn:hover {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
}

/* ==================== LAUNCHER OPTIONS CIRCLES ==================== */
/* Chat button - indigo theme */
.delaai-theme-dark #delaai-option-chat {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.delaai-theme-dark #delaai-option-chat:hover {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
}

/* Voice button - green theme */
.delaai-theme-dark #delaai-option-voice {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.delaai-theme-dark #delaai-option-voice:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* ==================== VOICE INTERFACE - MODERN DARK THEME ==================== */

/* Voice Sentences - Dark glassmorphic design */
.delaai-theme-dark .delaai-voice-sentences {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.delaai-theme-dark .delaai-voice-sentence {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.6);
  border-left-color: #818cf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.delaai-theme-dark .delaai-voice-sentence:hover {
  background: rgba(51, 65, 85, 0.8);
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.15);
}

[dir="rtl"] .delaai-theme-dark .delaai-voice-sentence {
  border-right-color: #818cf8;
}

/* Voice Status - Dark theme */
.delaai-theme-dark .delaai-voice-status {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.delaai-theme-dark .delaai-voice-status-text {
  color: #cbd5e1;
}

/* Call Duration - Dark theme */
.delaai-theme-dark .delaai-voice-duration {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.15) 0%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid rgba(129, 140, 248, 0.3);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.delaai-theme-dark .delaai-voice-duration svg {
  color: #a5b4fc;
}

.delaai-theme-dark .delaai-voice-duration-text {
  color: #c7d2fe;
}

/* Voice Audio Controls - Dark theme glassmorphic */
.delaai-theme-dark .delaai-voice-controls {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(51, 65, 85, 0.3) 100%);
  border: 1px solid rgba(129, 140, 248, 0.2);
  backdrop-filter: blur(24px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.delaai-theme-dark .delaai-voice-control-btn {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.8) 0%, rgba(71, 85, 105, 0.6) 100%);
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.delaai-theme-dark .delaai-voice-control-btn::before {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
}

.delaai-theme-dark .delaai-voice-control-btn:hover {
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 8px 28px rgba(129, 140, 248, 0.3);
}

.delaai-theme-dark .delaai-voice-control-icon {
  color: #a5b4fc;
}

/* Muted state - Dark theme */
.delaai-theme-dark .delaai-voice-control-btn.muted {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.15) 100%);
  border-color: rgba(239, 68, 68, 0.4);
}

.delaai-theme-dark .delaai-voice-control-btn.muted .delaai-voice-control-icon {
  color: #f87171;
}

.delaai-theme-dark .delaai-voice-control-btn.muted:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 8px 28px rgba(239, 68, 68, 0.4);
}

/* Speaker active state - Dark theme */
.delaai-theme-dark .delaai-voice-control-btn.speaker-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.15) 100%);
  border-color: rgba(16, 185, 129, 0.4);
}

.delaai-theme-dark .delaai-voice-control-btn.speaker-active .delaai-voice-control-icon {
  color: #34d399;
}

.delaai-theme-dark .delaai-voice-control-btn.speaker-active:hover {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.3);
}

/* Waveform - Indigo gradient */
.delaai-theme-dark .delaai-voice-wave {
  background: linear-gradient(180deg, #818cf8 0%, #6366f1 100%);
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.4);
}

/* Call Buttons - Enhanced glow for dark theme */
.delaai-theme-dark .delaai-voice-btn-start {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.5),
              0 0 40px rgba(16, 185, 129, 0.2);
}

.delaai-theme-dark .delaai-voice-btn-start:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.6),
              0 0 60px rgba(16, 185, 129, 0.3);
}

.delaai-theme-dark .delaai-voice-btn-end {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.5),
              0 0 40px rgba(239, 68, 68, 0.2);
}

.delaai-theme-dark .delaai-voice-btn-end:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(239, 68, 68, 0.6),
              0 0 60px rgba(239, 68, 68, 0.3);
}

/* Back Button - Dark theme glassmorphic */
.delaai-theme-dark .delaai-voice-btn-back {
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #a5b4fc;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.delaai-theme-dark .delaai-voice-btn-back:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
  color: #c7d2fe;
  box-shadow: 0 6px 20px rgba(129, 140, 248, 0.3);
}

/* Wave Animation - Dark Theme */
.delaai-theme-dark .delaai-voice-wave-container {
  background: transparent;
}

/* Volume Popup - Dark Theme */
.delaai-theme-dark .delaai-volume-popup {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.delaai-theme-dark .delaai-volume-popup-arrow {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
  border-left-color: rgba(129, 140, 248, 0.3);
  border-bottom-color: rgba(129, 140, 248, 0.3);
}

.delaai-theme-dark .delaai-volume-popup-value {
  color: #a5b4fc;
}

.delaai-theme-dark .delaai-volume-popup-slider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #334155 0%, #475569 100%);
}

.delaai-theme-dark .delaai-volume-popup-slider::-moz-range-track {
  background: linear-gradient(90deg, #334155 0%, #475569 100%);
}

.delaai-theme-dark .delaai-volume-popup-slider::-webkit-slider-thumb {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  box-shadow:
    0 0 0 3px rgba(30, 41, 59, 1),
    0 2px 8px rgba(129, 140, 248, 0.6);
}

.delaai-theme-dark .delaai-volume-popup-slider::-moz-range-thumb {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  box-shadow:
    0 0 0 3px rgba(30, 41, 59, 1),
    0 2px 8px rgba(129, 140, 248, 0.6);
}

.delaai-theme-dark .delaai-volume-popup-slider::-webkit-slider-thumb:hover {
  box-shadow:
    0 0 0 3px rgba(30, 41, 59, 1),
    0 4px 12px rgba(129, 140, 248, 0.8);
}

.delaai-theme-dark .delaai-volume-popup-slider::-moz-range-thumb:hover {
  box-shadow:
    0 0 0 3px rgba(30, 41, 59, 1),
    0 4px 12px rgba(129, 140, 248, 0.8);
}

.delaai-theme-dark .delaai-volume-popup-fill {
  background: linear-gradient(90deg, #a5b4fc 0%, #818cf8 50%, #6366f1 100%);
  box-shadow: 0 0 8px rgba(129, 140, 248, 0.5);
}