/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* --- Styles for Marked.js Generated Content --- */

/* Use a class to scope the Markdown styling */
.markdown-content ul,
.markdown-content ol {
  list-style-position: outside;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  color: #a1a1aa; /* text-gray-400 */
}

.markdown-content ul {
  list-style-type: disc;
}

.markdown-content ol {
  list-style-type: decimal;
}

.markdown-content strong {
  color: #e5e5e5; /* text-gray-200 for emphasis */
}

.markdown-content code:not(pre code) {
  /* Inline code styling */
  background-color: #3f3f46; /* bg-gray-700 */
  color: #4ade80; /* text-green-400 */
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.875rem; /* text-sm */
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  color: #cca5f8; /* text-blue-500 for sub-headings in the answer */
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Code Block Styling */
.code-block {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
}

.code-block code {
  color: #c9d1d9;
}

/* Question Card Animations */
.question-card {
  transition: all 0.3s ease;
}

.question-card:hover {
  transform: translateY(-2px);
}

/* Answer Collapse Animation */
.answer-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.answer-content.expanded {
  max-height: 2000px;
  transition: max-height 0.5s ease-in;
}

/* Difficulty Badge Styles */
.difficulty-beginner {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.difficulty-intermediate {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

/* Must Know Badge */
.must-know-badge {
  animation: pulse 2s infinite;
}

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

/* Chevron Rotation */
.chevron {
  transition: transform 0.3s ease;
}

.chevron.rotated {
  transform: rotate(180deg);
}

/* Copy Button */
.copy-btn {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

/* Search Highlight */
.highlight {
  background-color: rgba(250, 204, 21, 0.3);
  padding: 2px 0;
  border-radius: 2px;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #3b82f6;
  animation: spin 1s ease-in-out infinite;
}

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

/* Filter Active State */
.filter-active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
