/* ============================================================
   Claude AI Plugin — styles for both admin and frontend
   ============================================================ */

/* ---- Admin: AI Assist panel in post editor ---- */

.ai-assist-panel {
  border: 1.5px solid #e8d5ff;
  background: linear-gradient(135deg, #faf5ff 0%, #f5f0ff 100%);
  border-radius: 8px;
}

[data-theme="dark"] .ai-assist-panel {
  border-color: #4c1d95;
  background: linear-gradient(135deg, #1e1030 0%, #150a2a 100%);
}

.ai-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.ai-tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: white;
  border: 1.5px solid #d8b4fe;
  border-radius: 6px;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.ai-tool-btn:hover {
  background: #7c3aed;
  border-color: #7c3aed;
  color: white;
}

.ai-tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

[data-theme="dark"] .ai-tool-btn {
  background: #2d1b4e;
  border-color: #6d28d9;
  color: #c4b5fd;
}

[data-theme="dark"] .ai-tool-btn:hover {
  background: #7c3aed;
  color: white;
}

.ai-result-area {
  margin-top: 10px;
}

.ai-result-text {
  font-size: 12px;
  line-height: 1.6;
  color: #374151;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px;
  min-height: 0;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  display: none;
}

[data-theme="dark"] .ai-result-text {
  background: #1a0a30;
  border-color: #4c1d95;
  color: #e9d5ff;
}

.ai-result-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.ai-apply-btn,
.ai-copy-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  border: 1.5px solid;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-apply-btn {
  background: #7c3aed;
  border-color: #7c3aed;
  color: white;
}
.ai-apply-btn:hover { background: #6d28d9; border-color: #6d28d9; }

.ai-copy-btn {
  background: white;
  border-color: #d1d5db;
  color: #374151;
}
.ai-copy-btn:hover { border-color: #7c3aed; color: #7c3aed; }

[data-theme="dark"] .ai-copy-btn {
  background: transparent;
  border-color: #4b5563;
  color: #9ca3af;
}

.ai-loader {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #7c3aed;
  margin-top: 10px;
}

.ai-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e8d5ff;
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

/* ---- Frontend: AI Summary panel on post pages ---- */

.ai-summary-panel {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1.5px solid #e8d5ff;
  border-radius: 10px;
  background: linear-gradient(135deg, #faf5ff 0%, #f5f0ff 100%);
}

[data-theme="dark"] .ai-summary-panel {
  border-color: #4c1d95;
  background: linear-gradient(135deg, #1e1030 0%, #150a2a 100%);
}

.ai-summary-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c3aed;
  margin-bottom: 10px;
}

[data-theme="dark"] .ai-summary-header { color: #c4b5fd; }

.ai-summary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.ai-summary-btn:hover { background: #6d28d9; }
.ai-summary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ai-summary-result {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
}

[data-theme="dark"] .ai-summary-result { color: #e9d5ff; }
