/* Custom styles for Parsley form validation errors */
.parsley-errors-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.5rem 0;
  font-size: 0.875rem; /* smaller font size */
}

.parsley-errors-list li {
  color: #ef4444; /* red color using Tailwind red-500 to match the theme */
  margin: 0.125rem 0;
  padding: 0;
  line-height: 1.4;
}

.parsley-errors-list.filled {
  display: block;
}

/* Optional: Add a small icon or bullet for better visual hierarchy */
.parsley-errors-list li::before {
  content: "⚠ ";
  margin-right: 0.25rem;
  font-size: 0.75rem;
}

/* Ensure proper spacing when multiple error messages are shown */
.parsley-errors-list li + li {
  margin-top: 0.125rem;
}

/* Style for when parsley errors are shown next to form fields */
.form-group .parsley-errors-list,
.form-floating .parsley-errors-list {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* ===== KNOWLEDGE BASE ARTICLE STYLES ===== */

/* Table of Contents Styling - Override tocbot styles */
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list-item {
  margin: 0;
}

.toc-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #52525b;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
}

.toc-link:hover {
  color: #9333ea;
  background-color: #f3e8ff;
  text-decoration: none;
}

.toc-link.active {
  color: #9333ea;
  background-color: #f3e8ff;
  border-left: 3px solid #9333ea;
  padding-left: 0.6875rem; /* Adjust for border */
}

/* Nested list styling */
.toc-list .toc-list {
  margin-left: 1rem;
  margin-top: 0.25rem;
}

.toc-list .toc-list .toc-link {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

/* Content heading anchor links */
.heading-anchor {
  opacity: 0;
  transition: opacity 0.2s ease;
  text-decoration: none;
  color: #9333ea;
  margin-left: 0.5rem;
}

.heading-anchor:hover {
  text-decoration: none;
}

h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor {
  opacity: 1;
}

/* Article content styling */
.article-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #18181b;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #27272a;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #3f3f46;
}

.article-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #52525b;
}

.article-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.article-content blockquote {
  border-left: 4px solid #9333ea;
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #52525b;
}

.article-content code {
  background-color: #f4f4f5;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 0.875rem;
}

.article-content pre {
  background-color: #f4f4f5;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* Link styling */
.article-content a {
  color: #9333ea;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.article-content a:hover {
  color: #7e22ce;
  text-decoration: underline;
}

.article-content a:visited {
  color: #8b5cf6;
}

/* Table styling */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  border: 1px solid #d4d4d8;
  border-radius: 0.5rem;
  overflow: hidden;
}

.article-content table thead {
  background-color: #f4f4f5;
}

.article-content table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #18181b;
  border-bottom: 1px solid #d4d4d8;
  border-right: 1px solid #d4d4d8;
}

.article-content table th:last-child {
  border-right: none;
}

.article-content table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e4e4e7;
  border-right: 1px solid #e4e4e7;
  vertical-align: top;
}

.article-content table td:last-child {
  border-right: none;
}

.article-content table tbody tr:last-child td {
  border-bottom: none;
}

.article-content table tbody tr:hover {
  background-color: #fafafa;
}

/* Responsive table */
@media (max-width: 768px) {
  .article-content table {
    font-size: 0.75rem;
  }
  
  .article-content table th,
  .article-content table td {
    padding: 0.5rem 0.75rem;
  }
}

/* Scroll offset for sticky header */
h1[id], h2[id], h3[id], h4[id] {
  scroll-margin-top: 5rem;
}

/* ===== NAGWARE BANNER STYLES ===== */

/* Adjust body padding when nagware banner is visible */
body.has-nagware-banner {
  padding-top: 60px; /* Approximate height of the banner */
}

/* Adjust header position when nagware banner is visible */
body.has-nagware-banner header {
  top: 60px;
}

/* Pulsing animation for the nagware banner to make it more attention-grabbing */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }
  50% {
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.2);
  }
}

#credits-nagware-banner {
  animation: pulse-glow 3s ease-in-out infinite;
  background: linear-gradient(90deg, #dc2626, #ea580c) !important;
  color: white !important;
}

#credits-nagware-banner * {
  color: white !important;
}

#credits-nagware-banner .text-yellow-200 {
  color: #fef08a !important;
}

/* Fix button styling in nagware banner */
#credits-nagware-banner a {
  background-color: white !important;
  color: #dc2626 !important;
  border: 2px solid white !important;
}

#credits-nagware-banner a * {
  color: #dc2626 !important;
}

#credits-nagware-banner a:hover {
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
}

#credits-nagware-banner a:hover * {
  color: #b91c1c !important;
}

/* Ensure proper spacing for the credit card icon */
#credits-nagware-banner a i.ph-credit-card {
  margin-right: 0.375rem !important;
}

/* AI Suggestions nagware styling - toned down amber theme */
#ai-suggestions-container .bg-amber-50 {
  background-color: #fffbeb !important;
  border-color: #fbbf24 !important;
}

#ai-suggestions-container .bg-amber-50 .text-amber-600 {
  color: #d97706 !important;
}

#ai-suggestions-container .bg-amber-50 .text-amber-700 {
  color: #b45309 !important;
}

#ai-suggestions-container .bg-amber-50 .text-amber-800 {
  color: #92400e !important;
}

#ai-suggestions-container .bg-amber-50 a {
  background-color: #d97706 !important;
  color: white !important;
}

#ai-suggestions-container .bg-amber-50 a * {
  color: white !important;
}

#ai-suggestions-container .bg-amber-50 a:hover {
  background-color: #b45309 !important;
  color: white !important;
}

#ai-suggestions-container .bg-amber-50 a:hover * {
  color: white !important;
}

/* Ensure proper spacing for credit card icon in AI suggestions */
#ai-suggestions-container a i.ph-credit-card {
  margin-right: 0.5rem !important;
}