/* ═══════════════════════════════════════════════════════════
   RIS - Rezept Index System
   Modul D - RIS Rezept-Assistent (Spezifische Styles)
   ═══════════════════════════════════════════════════════════ */

/* Info-Box */
.chat-info-box {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.chat-info-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.chat-info-icon {
  font-size: var(--font-2xl);
}

.chat-info-title {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.chat-info-text {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-xl);
}

.chat-info-examples {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.chat-info-examples-label {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.chat-example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.chat-example-chip {
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}

.chat-example-chip:hover {
  background: var(--bg-base);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Chat Container */
.chat-container {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 400px);
  min-height: 500px;
  max-height: 700px;
}

/* Messages Feed */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--bg-border);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Message Bubble */
.chat-message {
  display: flex;
  gap: var(--space-md);
  max-width: 80%;
  animation: messageSlideIn 0.3s ease;
}

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

/* User Message (rechtsbündig) */
.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

/* Assistant Message (linksbündig) */
.chat-message.assistant {
  align-self: flex-start;
}

/* Avatar */
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--font-lg);
  font-weight: var(--font-weight-semibold);
}

.chat-message.user .chat-avatar {
  background: var(--accent);
  color: var(--bg-base);
}

.chat-message.assistant .chat-avatar {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
}

/* Message Content */
.chat-message-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.chat-message-bubble {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  line-height: var(--line-height-relaxed);
}

.chat-message.user .chat-message-bubble {
  background: var(--accent);
  color: var(--bg-base);
}

.chat-message.assistant .chat-message-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-primary);
}

.chat-message-timestamp {
  font-size: var(--font-sm);
  color: var(--text-muted);
  padding: 0 var(--space-sm);
}

.chat-message.user .chat-message-timestamp {
  text-align: right;
}

/* Typing Indicator */
.chat-typing-indicator {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  width: fit-content;
}

.chat-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-typing-dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Input Container */
.chat-input-container {
  border-top: 1px solid var(--bg-border);
  padding: var(--space-xl);
  background: var(--bg-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.chat-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.chat-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-base);
  font-family: inherit;
  line-height: var(--line-height-base);
  resize: none;
  transition: all var(--transition-base);
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-char-count {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.chat-char-count.warning {
  color: var(--status-warn);
}

.chat-char-count.error {
  color: var(--status-error);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--bg-base);
  font-size: var(--font-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: scale(1);
}

.chat-clear-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
  font-size: var(--font-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  margin-right: var(--space-sm);
}

.chat-clear-btn:hover {
  background: var(--status-error);
  border-color: var(--status-error);
  color: white;
  transform: scale(1.05);
}

.chat-clear-icon {
  font-size: 18px;
}

.chat-send-icon {
  display: block;
  transform: rotate(0deg);
  transition: transform var(--transition-base);
}

.chat-send-btn:hover:not(:disabled) .chat-send-icon {
  transform: rotate(-10deg);
}

/* Responsive */
@media (max-width: 768px) {
  .chat-container {
    height: calc(100vh - 300px);
  }
  
  .chat-message {
    max-width: 90%;
  }
  
  .chat-info-box {
    padding: var(--space-xl);
  }
  
  .chat-example-chips {
    flex-direction: column;
  }
  
  .chat-example-chip {
    width: 100%;
    text-align: left;
  }
}
