/* Ezra AI Chat Styles */

/* Panel */
.ezra-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ezra-panel.open {
  right: 0;
}

/* Header */
.ezra-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.ezra-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
}

.ezra-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ezra-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.ezra-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Session Notice */
.ezra-session-notice {
  padding: 8px 20px;
  background: #f0f4ff;
  color: #667eea;
  font-size: 12px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

/* Messages Area */
.ezra-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fafafa;
}

/* Welcome Message */
.ezra-welcome {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.ezra-welcome p {
  margin: 8px 0;
}

/* Message Bubbles */
.ezra-message {
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

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

.ezra-message-user {
  align-self: flex-end;
}

.ezra-message-assistant {
  align-self: flex-start;
}

.ezra-message-content {
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 14px;
}

.ezra-message-user .ezra-message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.ezra-message-assistant .ezra-message-content {
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

/* Loading Animation */
.ezra-loading {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.ezra-loading span {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

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

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

/* Sources */
.ezra-sources {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.ezra-sources-title {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.ezra-source-link {
  display: inline-block;
  margin: 4px 8px 4px 0;
  padding: 4px 10px;
  background: #f0f4ff;
  color: #667eea;
  border-radius: 12px;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.2s;
}

.ezra-source-link:hover {
  background: #e0e8ff;
}

/* Verse Links in Messages */
.ezra-verse-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.ezra-verse-link:hover {
  text-decoration: underline;
}

/* Input Area */
.ezra-input-area {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e0e0e0;
}

.ezra-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.ezra-input:focus {
  outline: none;
  border-color: #667eea;
}

.ezra-send {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}

.ezra-send:hover {
  transform: scale(1.05);
}

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

.ezra-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Disclaimer */
.ezra-disclaimer {
  padding: 8px 20px;
  background: #f5f5f5;
  color: #999;
  font-size: 11px;
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .ezra-panel {
    width: 100%;
    right: -100%;
  }

  .ezra-panel.open {
    right: 0;
  }

  .ezra-header {
    padding: 12px 16px;
  }

  .ezra-messages {
    padding: 16px;
  }

  .ezra-input-area {
    padding: 12px 16px;
  }

  .ezra-message {
    max-width: 90%;
  }
}

/* ==================== */
/* Dark Mode Support    */
/* ==================== */

[data-theme="dark"] .ezra-panel {
  background: var(--bg-primary, #1a1a2e);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .ezra-header {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

[data-theme="dark"] .ezra-session-notice {
  background: rgba(102, 126, 234, 0.1);
  color: #a0aeff;
  border-color: var(--border-color, #2a3a4a);
}

[data-theme="dark"] .ezra-messages {
  background: var(--bg-secondary, #16213e);
}

[data-theme="dark"] .ezra-welcome {
  color: var(--text-secondary, #c0c0c0);
}

[data-theme="dark"] .ezra-message-assistant .ezra-message-content {
  background: var(--bg-primary, #1a1a2e);
  color: var(--text-primary, #f0f0f0);
  border-color: var(--border-color, #2a3a4a);
}

[data-theme="dark"] .ezra-sources {
  border-color: var(--border-color, #2a3a4a);
}

[data-theme="dark"] .ezra-sources-title {
  color: var(--text-secondary, #c0c0c0);
}

[data-theme="dark"] .ezra-source-link {
  background: rgba(102, 126, 234, 0.15);
  color: #a0aeff;
}

[data-theme="dark"] .ezra-source-link:hover {
  background: rgba(102, 126, 234, 0.25);
}

[data-theme="dark"] .ezra-verse-link {
  color: #a0aeff;
}

[data-theme="dark"] .ezra-input-area {
  background: var(--bg-primary, #1a1a2e);
  border-color: var(--border-color, #2a3a4a);
}

[data-theme="dark"] .ezra-input {
  background: var(--bg-secondary, #16213e);
  border-color: var(--border-color, #2a3a4a);
  color: var(--text-primary, #f0f0f0);
}

[data-theme="dark"] .ezra-input:focus {
  border-color: #667eea;
}

[data-theme="dark"] .ezra-input::placeholder {
  color: var(--text-muted, #909090);
}

[data-theme="dark"] .ezra-send {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

[data-theme="dark"] .ezra-disclaimer {
  background: var(--bg-secondary, #16213e);
  color: var(--text-muted, #909090);
}

[data-theme="dark"] .ezra-loading span {
  background: #a0aeff;
}
