/* Mobile Viewport and Height Fixes */
:root {
  --app-height: 100dvh;
}

html {
  height: 100%;
}

body {
  height: 100%;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

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

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

/* Markdown styling inside messages */
.prose-content {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.prose-content p {
  margin-bottom: 0.85rem;
}

.prose-content p:last-child {
  margin-bottom: 0;
}

.prose-content h1, .prose-content h2, .prose-content h3, .prose-content h4 {
  font-weight: 700;
  color: #f8fafc;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.prose-content h1 { font-size: 1.4rem; }
.prose-content h2 { font-size: 1.2rem; }
.prose-content h3 { font-size: 1.05rem; }

.prose-content ul, .prose-content ol {
  margin-left: 1.5rem;
  margin-bottom: 0.85rem;
}

.prose-content ul { list-style-type: disc; }
.prose-content ol { list-style-type: decimal; }

.prose-content li {
  margin-bottom: 0.35rem;
}

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

.prose-content a {
  color: #818cf8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose-content a:hover {
  color: #a5b4fc;
}

/* Inline Code */
.prose-content code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  background-color: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 0.15rem 0.4rem;
  border-radius: 0.375rem;
  font-size: 0.85em;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Code Blocks */
.code-block-wrapper {
  position: relative;
  margin: 1rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #334155;
  background: #0f172a;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  padding: 0.5rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #94a3b8;
  border-bottom: 1px solid #334155;
}

.code-copy-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

.code-copy-btn:hover {
  color: #ffffff;
  background: #334155;
}

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

/* Smooth message slide in */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-animate {
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slideDown {
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Image Shimmer Loading Animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.image-shimmer {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

.ai-image-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ai-image-card:hover {
  transform: scale(1.01);
}
