/* ============================================================
   AIOAS Prototype - Common Styles
   ============================================================ */

/* ---- Animations ---- */
@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes scale-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes pulse-slow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes slide-up {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.animate-slide-in { animation: slide-in 0.3s ease-out; }
.animate-scale-in { animation: scale-in 0.2s ease-out; }
.animate-fade-in { animation: fade-in 0.3s ease-out; }
.animate-slide-up { animation: slide-up 0.2s ease-out; }
.animate-blink { animation: blink 1s step-end infinite; }

/* ---- Typing Indicator ---- */
.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  margin: 0 2px;
}
.typing-dot:nth-child(1) { animation: typing-dot 1.4s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation: typing-dot 1.4s ease-in-out 0.2s infinite; }
.typing-dot:nth-child(3) { animation: typing-dot 1.4s ease-in-out 0.4s infinite; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.dark-scroll::-webkit-scrollbar-thumb { background: #4b5563; }
.dark-scroll::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* ---- Markdown Content ---- */
.md-content h1 { font-size: 1.5em; font-weight: 700; margin: 0.8em 0 0.4em; color: #111827; }
.md-content h2 { font-size: 1.25em; font-weight: 600; margin: 0.8em 0 0.4em; color: #1f2937; }
.md-content h3 { font-size: 1.1em; font-weight: 600; margin: 0.6em 0 0.3em; color: #374151; }
.md-content p { margin: 0.4em 0; line-height: 1.7; }
.md-content ul, .md-content ol { padding-left: 1.5em; margin: 0.4em 0; }
.md-content li { margin: 0.2em 0; line-height: 1.6; }
.md-content strong { font-weight: 600; color: #111827; }
.md-content code {
  background: #f3f4f6; padding: 0.15em 0.4em; border-radius: 4px;
  font-size: 0.875em; font-family: 'SF Mono', 'Fira Code', monospace; color: #dc2626;
}
.md-content pre {
  background: #1f2937; color: #e5e7eb; padding: 1em; border-radius: 8px;
  overflow-x: auto; margin: 0.6em 0; font-size: 0.85em;
}
.md-content pre code { background: transparent; color: inherit; padding: 0; }
.md-content table { width: 100%; border-collapse: collapse; margin: 0.6em 0; font-size: 0.9em; }
.md-content th { background: #f9fafb; font-weight: 600; text-align: left; padding: 8px 12px; border: 1px solid #e5e7eb; }
.md-content td { padding: 8px 12px; border: 1px solid #e5e7eb; }
.md-content tr:hover td { background: #f9fafb; }
.md-content blockquote {
  border-left: 3px solid #3b82f6; padding-left: 1em; margin: 0.6em 0;
  color: #6b7280; font-style: italic;
}
.md-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 1em 0; }

/* ---- RAG Reference ---- */
.rag-ref {
  background: #eff6ff; border-left: 3px solid #3b82f6; border-radius: 0 6px 6px 0;
  padding: 8px 12px; margin-top: 10px; font-size: 0.8em;
}
.rag-ref-header { color: #2563eb; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.rag-ref-header:hover { color: #1d4ed8; }
.rag-ref-body { margin-top: 6px; color: #4b5563; display: none; }
.rag-ref-body.show { display: block; }

/* ---- Skill Result Card ---- */
.skill-result-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd; border-radius: 10px; padding: 14px; margin-top: 10px;
}
.skill-result-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.skill-result-badge {
  background: #0ea5e9; color: white; font-size: 0.7em; padding: 2px 8px;
  border-radius: 9999px; font-weight: 600;
}

/* ---- Chat Bubble Styles ---- */
.msg-user .msg-bubble {
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
  border-radius: 18px 18px 4px 18px;
}
.msg-assistant .msg-bubble {
  background: #ffffff; color: #1f2937; border: 1px solid #e5e7eb;
  border-radius: 18px 18px 18px 4px;
}

/* ---- Empty State ---- */
.empty-state-icon {
  width: 80px; height: 80px; background: linear-gradient(135deg, #dbeafe, #ede9fe);
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 2em; margin-bottom: 16px;
}

/* ---- Skill Cards (empty state) ---- */
.skill-card {
  background: white; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 16px; cursor: pointer; transition: all 0.2s;
}
.skill-card:hover {
  border-color: #3b82f6; box-shadow: 0 4px 12px rgba(59,130,246,0.15);
  transform: translateY(-2px);
}

/* ---- Stat Card ---- */
.stat-card {
  background: white; border-radius: 12px; padding: 20px;
  border: 1px solid #e5e7eb; transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

/* ---- Data Table ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #f9fafb; font-weight: 600; text-align: left;
  padding: 10px 16px; font-size: 0.8em; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #e5e7eb;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; font-size: 0.875em; }
.data-table tr:hover td { background: #f9fafb; }

/* ---- Status Badge ---- */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 0.75em; font-weight: 500; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-amber { background: #fef3c7; color: #92400e; }

/* ---- Sidebar active indicator ---- */
.nav-active { background: #1f2937; color: white; border-right: 2px solid #3b82f6; }

/* ---- Pulse dot ---- */
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  animation: pulse-slow 2s ease-in-out infinite;
}

/* ---- Form focus ---- */
input:focus, textarea:focus, select:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
