/* 🚀 ULTRA-MODERN CHAT UI V2 - WOW FACTOR */

.ai-chat-modern-v2 {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(135deg, #0f0e1f 0%, #1a1830 100%);
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

/* ─── Header ─── */
.ai-header-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
  backdrop-filter: blur(10px);
}

.ai-header-modern .ai-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(10px);
}

.ai-header-modern .ai-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.ai-header-modern .ai-text p {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.9;
}

/* ─── Messages Container ─── */
.ai-messages-modern {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #0f0e1f 0%, #1a1830 100%);
}

.ai-messages-modern::-webkit-scrollbar {
  width: 6px;
}

.ai-messages-modern::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.ai-messages-modern::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 10px;
}

.ai-messages-modern::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* ─── Message Bubbles ─── */
.ai-msg-row {
  display: flex;
  gap: 8px;
  animation: slideInMsg 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInMsg {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* User Message */
.ai-msg-row.user-msg {
  justify-content: flex-end;
}

.ai-msg-row.user-msg .ai-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px 4px 20px 20px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.ai-msg-row.user-msg .ai-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
  border-radius: 20px 4px 20px 20px;
}

/* Assistant Message */
.ai-msg-row.assistant-msg {
  justify-content: flex-start;
}

.ai-msg-row.assistant-msg .ai-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px 20px 20px 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Bubble Styling */
.ai-bubble {
  max-width: 70%;
  padding: 12px 16px;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

.ai-bubble p {
  margin: 0;
  padding: 0;
}

.ai-bubble strong {
  font-weight: 700;
  color: inherit;
}

.ai-bubble em {
  font-style: italic;
  color: inherit;
}

/* Message Icon */
.ai-msg-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.ai-msg-row.assistant-msg .ai-msg-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Empty State */
.ai-empty-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  text-align: center;
}

.ai-empty-modern i {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.3;
  animation: float 3s ease-in-out infinite;
}

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

.ai-empty-modern p {
  font-size: 16px;
  margin: 0 0 8px 0;
  font-weight: 500;
}

.ai-empty-modern small {
  font-size: 13px;
  opacity: 0.6;
}

/* ─── Input Area (COMPACT) ─── */
.ai-input-modern {
  padding: 8px 8px;
  background: rgba(15, 14, 31, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  max-height: 220px;
  overflow-y: auto;
}

.ai-input-row-modern {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.ai-input-field-modern {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  min-width: 0;
}

.ai-input-field-modern::placeholder {
  color: #94a3b8;
}

.ai-input-field-modern:focus {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  transform: scale(1.02);
}

/* ─── Modern Buttons ─── */
.ai-btn-modern {
  padding: 10px 12px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.ai-btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s;
  z-index: -1;
}

.ai-btn-modern:hover::before {
  left: 0;
}

/* Voice Button */
.ai-btn-voice-modern {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
  font-size: 16px;
}

.ai-btn-voice-modern:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(255, 107, 107, 0.4);
}

.ai-btn-voice-modern:active {
  transform: scale(0.95);
}

/* Send Button */
.ai-btn-send-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
  padding: 10px 14px;
  font-size: 13px;
}

.ai-btn-send-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.ai-btn-send-modern:active {
  transform: translateY(0);
}

/* ─── Quick Action Buttons (COMPACT) ─── */
.ai-quick-btns-modern {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.ai-quick-btn-modern {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-quick-btn-modern:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.4);
  color: #667eea;
  transform: scale(1.05);
}

/* ─── Action Buttons Grid (2x2) ─── */
.ai-action-btns-modern {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-action-btn-modern {
  padding: 8px 10px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: white;
  white-space: nowrap;
}

.ai-action-btn-primary-modern {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
}

.ai-action-btn-primary-modern:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.35);
}

.ai-action-btn-secondary-modern {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.25);
}

.ai-action-btn-secondary-modern:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(33, 150, 243, 0.35);
}

.ai-action-btn-tertiary-modern {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
}

.ai-action-btn-tertiary-modern:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.35);
}

.ai-action-btn-ghost-modern {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

.ai-action-btn-ghost-modern:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

/* ─── Loading Animation ─── */
.ai-loading-modern {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px;
}

.ai-loading-modern span {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  animation: loadingBounce 1.4s ease-in-out infinite;
}

.ai-loading-modern span:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-modern span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingBounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
