/* Custom styles for Personal AI Assistant */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #182234;
  --bg-card-hover: #1f2d42;
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.35);
}

/* Markdown Rendering in Chat */
.markdown-body {
  font-size: 0.965rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.markdown-body p {
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.markdown-body p:last-child {
  margin-bottom: 0;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-weight: 700;
  color: #f8fafc;
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 1.4rem;
  margin-top: 0.4rem;
  margin-bottom: 0.8rem;
}

.markdown-body li {
  margin-bottom: 0.3rem;
}

.markdown-body strong {
  color: #f1f5f9;
  font-weight: 600;
}

.markdown-body blockquote {
  border-left: 3px solid #6366f1;
  padding-left: 1rem;
  color: #94a3b8;
  margin: 0.8rem 0;
  font-style: italic;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.markdown-body th, .markdown-body td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  text-align: left;
}

.markdown-body th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.markdown-body code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
  color: #38bdf8;
}

/* Code Blocks with Header and Copy Button */
.code-block-wrapper {
  position: relative;
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d1117;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: #161b22;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #8b949e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-copy-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f0f6fc;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 12px 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Pulsing Voice Recording Indicator */
@keyframes mic-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.recording-pulse {
  animation: mic-pulse 1.4s infinite;
  background-color: #ef4444 !important;
  color: white !important;
}

/* Audio wave animation */
.audio-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.audio-bar {
  width: 3px;
  background: #ef4444;
  border-radius: 9999px;
  animation: wave 1s ease-in-out infinite;
}

.audio-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.audio-bar:nth-child(2) { height: 14px; animation-delay: 0.2s; }
.audio-bar:nth-child(3) { height: 18px; animation-delay: 0.3s; }
.audio-bar:nth-child(4) { height: 10px; animation-delay: 0.4s; }
.audio-bar:nth-child(5) { height: 5px; animation-delay: 0.5s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* Typing cursor */
.typing-cursor::after {
  content: '▋';
  display: inline-block;
  margin-left: 2px;
  color: #38bdf8;
  animation: blink 0.9s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Glassmorphism helpers */
.glass {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
}

.glass-modal {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* DeepSeek Thinking Process Styling */
.deepseek-thinking-accordion summary {
  list-style: none;
}
.deepseek-thinking-accordion summary::-webkit-details-marker {
  display: none;
}
.deepseek-thinking-accordion summary::after {
  content: '▼';
  font-size: 8px;
  color: #38bdf8;
  transition: transform 0.2s ease;
  margin-left: 8px;
}
.deepseek-thinking-accordion[open] summary::after {
  transform: rotate(180deg);
}
