/* CodeBodh - Main Frontend CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --color-primary: #6366F1;
  --color-primary-hover: #4F46E5;
  --color-dark: #0B0F19;
  --color-dark-surface: #121826;
  --color-border-dark: #1E293B;
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --text-main: #334155;
  --text-heading: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
}

html.dark {
  --bg-body: #0B0F19;
  --bg-surface: #121826;
  --bg-card: #121826;
  --text-main: #CBD5E1;
  --text-heading: #F8FAFC;
  --text-muted: #94A3B8;
  --border-color: #1E293B;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

html.dark, html.dark body {
  background-color: #0B0F19 !important;
  color: #CBD5E1 !important;
}

/* Form Inputs & Controls (Light Mode by default) */
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1.5px solid #CBD5E1 !important;
  background-color: #FFFFFF !important;
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: #0F172A !important;
  outline: none;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.form-input::placeholder,
.form-textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: #94A3B8 !important;
  opacity: 1;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* Button Styles for Frontend */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s ease-in-out;
  line-height: 1.25;
}

.btn-primary {
  background-color: #6366F1 !important;
  color: #FFFFFF !important;
  border-color: #6366F1 !important;
}

.btn-primary:hover {
  background-color: #4F46E5 !important;
  border-color: #4F46E5 !important;
  color: #FFFFFF !important;
}

.btn-secondary {
  background-color: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #334155 !important;
}

.btn-secondary:hover {
  background-color: #F8FAFC !important;
  border-color: #94A3B8 !important;
  color: #0F172A !important;
}

/* Custom Prose for Content Pages (e.g. /publish, /faq) */
.prose-custom {
  color: #334155;
}
.prose-custom h1, .prose-custom h2, .prose-custom h3, .prose-custom h4 {
  color: #0F172A;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.prose-custom h1 { font-size: 1.75rem; }
.prose-custom h2 { font-size: 1.375rem; }
.prose-custom h3 { font-size: 1.125rem; }
.prose-custom p {
  color: #334155;
  margin-bottom: 0.875rem;
  line-height: 1.65;
}
.prose-custom ul, .prose-custom ol {
  color: #334155;
  margin-left: 1.25rem;
  margin-bottom: 1rem;
  list-style-type: disc;
}
.prose-custom li {
  margin-bottom: 0.375rem;
  line-height: 1.6;
}
.prose-custom strong, .prose-custom b {
  color: #0F172A;
  font-weight: 700;
}
.prose a, .prose-custom a {
  color: #4F46E5 !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
  transition: color 0.15s ease;
}
.prose a:hover, .prose-custom a:hover {
  color: #4338CA !important;
}

/* External Link Indicator & Safety */
.prose-custom a[target="_blank"] {
  position: relative;
}

/* Tables inside Prose / Blog Content */
.table-responsive-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
}
html.dark .table-responsive-wrapper {
  border-color: #1E293B;
  background: #121826;
}
.prose-custom table,
article table,
.content-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: left;
}
.prose-custom th,
article th,
.content-body th {
  background-color: #F8FAFC;
  color: #0F172A;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #E2E8F0;
  border-right: 1px solid #E2E8F0;
  white-space: nowrap;
}
html.dark .prose-custom th,
html.dark article th,
html.dark .content-body th {
  background-color: #161F30;
  color: #F1F5F9;
  border-bottom-color: #1E293B;
  border-right-color: #1E293B;
}
.prose-custom td,
article td,
.content-body td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #E2E8F0;
  border-right: 1px solid #E2E8F0;
  color: #334155;
}
.prose-custom td:last-child,
.prose-custom th:last-child,
article td:last-child,
article th:last-child,
.content-body td:last-child,
.content-body th:last-child {
  border-right: none;
}
html.dark .prose-custom td,
html.dark article td,
html.dark .content-body td {
  border-color: #1E293B;
  color: #CBD5E1;
}
.prose-custom tr:nth-child(even) td,
article tr:nth-child(even) td,
.content-body tr:nth-child(even) td {
  background-color: #F8FAFC;
}
html.dark .prose-custom tr:nth-child(even) td,
html.dark article tr:nth-child(even) td,
html.dark .content-body tr:nth-child(even) td {
  background-color: rgba(30, 41, 59, 0.35);
}
.prose-custom tr:hover td,
article tr:hover td,
.content-body tr:hover td {
  background-color: rgba(99, 102, 241, 0.05);
}
html.dark .prose-custom tr:hover td,
html.dark article tr:hover td,
html.dark .content-body tr:hover td {
  background-color: rgba(99, 102, 241, 0.12);
}

/* Code Blocks & Terminal UI */
.code-terminal-wrapper {
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #1E293B;
  background: #0D1117;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}
.code-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: #161B22;
  border-bottom: 1px solid #21262D;
}
.code-terminal-wrapper pre {
  margin: 0 !important;
  padding: 1.25rem !important;
  background: #0D1117 !important;
  color: #E6EDF3 !important;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.8125rem !important;
  line-height: 1.7 !important;
}
.code-terminal-wrapper code {
  font-family: inherit;
  background: transparent !important;
  padding: 0 !important;
}

/* Inline Code Elements */
.prose-custom :not(pre) > code,
article :not(pre) > code,
.content-body :not(pre) > code {
  padding: 0.2rem 0.4rem;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', monospace;
  color: #6366F1;
  background-color: #EEF2FF;
  border-radius: 0.375rem;
  border: 1px solid #E0E7FF;
}
html.dark .prose-custom :not(pre) > code,
html.dark article :not(pre) > code,
html.dark .content-body :not(pre) > code {
  color: #A5B4FC;
  background-color: #1E1B4B;
  border-color: #312E81;
}

/* Embedded Media & Videos */
.prose-custom iframe,
article iframe,
.content-body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  border: 1px solid #E2E8F0;
}
html.dark .prose-custom iframe,
html.dark article iframe,
html.dark .content-body iframe {
  border-color: #1E293B;
}
.prose-custom video,
article video,
.content-body video {
  width: 100%;
  max-height: 500px;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  background: #000;
}
.prose-custom img,
article img,
.content-body img {
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  height: auto;
}

/* Comprehensive Dark Mode Overrides */
html.dark, html.dark body {
  background-color: #0B0F19 !important;
  color: #CBD5E1 !important;
}

html.dark .bg-white,
html.dark a.bg-white,
html.dark section.bg-white,
html.dark div.bg-white,
html.dark nav.bg-white {
  background-color: #121826 !important;
  border-color: #1E293B !important;
}

html.dark .bg-slate-50,
html.dark div.bg-slate-50,
html.dark .bg-slate-100,
html.dark .bg-\[\#F8FAFC\],
html.dark section.bg-\[\#F8FAFC\],
html.dark div.bg-\[\#F8FAFC\],
html.dark main.bg-\[\#F8FAFC\] {
  background-color: #0B0F19 !important;
  border-color: #1E293B !important;
}

html.dark .product-card,
html.dark .blog-card {
  background: #121826 !important;
  border-color: #1E293B !important;
  color: #E2E8F0 !important;
}

html.dark .product-card:hover,
html.dark .blog-card:hover {
  border-color: #6366F1 !important;
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.6) !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5 {
  color: #F8FAFC !important;
}

html.dark .text-slate-700,
html.dark .text-slate-600 {
  color: #CBD5E1 !important;
}

html.dark .text-slate-500,
html.dark .text-slate-400 {
  color: #94A3B8 !important;
}

html.dark .border-slate-200,
html.dark .border-slate-100,
html.dark .border-slate-50 {
  border-color: #1E293B !important;
}

html.dark .cat-pill {
  background-color: rgba(99, 102, 241, 0.15) !important;
  color: #818CF8 !important;
}

html.dark .tech-tag {
  background-color: #1E293B !important;
  color: #94A3B8 !important;
}

/* Dark Mode Inputs */
html.dark .form-label {
  color: #CBD5E1 !important;
}

html.dark .form-input,
html.dark .form-select,
html.dark .form-textarea,
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark input[type="url"],
html.dark input[type="number"],
html.dark select,
html.dark select option,
html.dark select optgroup,
html.dark textarea {
  border-color: #334155 !important;
  background-color: #161F36 !important;
  color: #F8FAFC !important;
}

html.dark .form-input::placeholder,
html.dark .form-textarea::placeholder,
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #94A3B8 !important;
}

html.dark .form-input:focus,
html.dark .form-select:focus,
html.dark .form-textarea:focus,
html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #818CF8 !important;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2) !important;
}

html.dark .btn-secondary {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

html.dark .btn-secondary:hover {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #FFFFFF !important;
}

/* Dark Mode Prose & Dynamic Page Content (High Contrast) */
html.dark .prose-custom,
html.dark .prose-custom *,
html.dark .prose-custom p,
html.dark .prose-custom div,
html.dark .prose-custom span,
html.dark .prose-custom ul,
html.dark .prose-custom ol,
html.dark .prose-custom li {
  color: #E2E8F0 !important;
}
html.dark .prose-custom strong,
html.dark .prose-custom b {
  color: #FFFFFF !important;
  font-weight: 700 !important;
}
html.dark .prose-custom h1,
html.dark .prose-custom h2,
html.dark .prose-custom h3,
html.dark .prose-custom h4,
html.dark .prose-custom h5,
html.dark .prose-custom h6 {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}
html.dark .prose a, html.dark .prose-custom a {
  color: #818CF8 !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
}
html.dark .prose a:hover, html.dark .prose-custom a:hover {
  color: #A5B4FC !important;
}

/* SVG Icon Safety Sizing */
svg {
  display: inline-block;
  vertical-align: middle;
}
svg.w-3, svg.w-3\.5 { width: 0.875rem; height: 0.875rem; }
svg.w-4 { width: 1rem; height: 1rem; }
svg.w-5 { width: 1.25rem; height: 1.25rem; }
svg.w-6 { width: 1.5rem; height: 1.5rem; }
svg.w-8 { width: 2rem; height: 2rem; }
svg.w-10 { width: 2.5rem; height: 2.5rem; }
svg.w-12 { width: 3rem; height: 3rem; }

/* Utilities */
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.hidden { display: none; }
.inline-block { display: inline-block; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

@media (min-width: 640px) {
  .sm\:block { display: block; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1 / span 1; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

/* Padding & Margin */
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-16 { padding-top: 4rem; }
.pb-12 { padding-bottom: 3rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-20 { margin-top: 5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-center { text-align: center; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }

/* Colors */
.text-white { color: #FFFFFF; }
.text-slate-200 { color: #E2E8F0; }
.text-slate-300 { color: #CBD5E1; }
.text-slate-400 { color: #94A3B8; }
.text-slate-500 { color: #64748B; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1E293B; }
.text-slate-900 { color: #0F172A; }
.text-indigo-400 { color: #818CF8; }
.text-indigo-600 { color: #4F46E5; }
.text-red-500 { color: #EF4444; }
.text-red-600 { color: #DC2626; }
.bg-white { background-color: #FFFFFF; }
.bg-slate-50 { background-color: #F8FAFC; }
.bg-slate-100 { background-color: #F1F5F9; }
.bg-slate-800 { background-color: #1E293B; }
.bg-slate-900 { background-color: #0F172A; }
.bg-indigo-600 { background-color: #6366F1; }
.bg-indigo-50 { background-color: #EEF2FF; }

/* Borders & Shadows */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-slate-200 { border-color: #E2E8F0; }
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1E293B; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }

/* Custom Product & Blog Cards (Matching Images 2, 3, 4) */
.product-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.12);
  border-color: #CBD5E1;
}

.blog-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.12);
}

/* Sale Discount Badge (Matching Images 3 & 4) */
.badge-discount {
  background-color: #EF4444;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  letter-spacing: 0.025em;
  z-index: 10;
}

/* Free Product Ribbon & Badges */
.ribbon-free-corner,
.ribbon-free-badge {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 30 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  max-width: max-content !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 10px !important;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  color: #FFFFFF !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  transform: none !important;
  pointer-events: none !important;
}

.ribbon-free-corner span,
.ribbon-free-badge span {
  display: inline-block !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  transform: none !important;
}

/* Category Pill */
.cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #EEF2FF;
  color: #4F46E5;
}

/* Tech Tag */
.tech-tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  background-color: #F1F5F9;
  color: #475569;
}

/* Hero Gradient Text (Matching Image 3: "Smarter Builders") */
.gradient-text {
  background: linear-gradient(135deg, #60A5FA 0%, #818CF8 50%, #C084FC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Tab Navigation for Product Detail (Matching Image 4) */
.product-tabs {
  display: flex;
  border-bottom: 2px solid #E2E8F0;
  gap: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.75rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748B;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-btn:hover { color: #1E293B; }
.tab-btn.active {
  color: #6366F1;
  border-bottom-color: #6366F1;
}

/* Code Blocks with Copy Button (Matching Image 5) */
.code-block {
  background-color: #0F172A;
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 1.25rem 0;
  border: 1px solid #1E293B;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: #1E293B;
  border-bottom: 1px solid #334155;
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #94A3B8;
  text-transform: lowercase;
}
.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #E2E8F0;
  padding: 0.25rem 0.625rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.2); }
.code-block pre {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #F8FAFC;
  overflow-x: auto;
  line-height: 1.6;
}

/* Step Badges (Matching Image 5) */
.article-step {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
}
.step-badge {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background-color: #6366F1;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}
.step-content { flex: 1; }

/* Callout Box (Matching Image 5) */
.alert-box {
  display: flex;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background-color: #F5F3FF;
  border-left: 4px solid #8B5CF6;
  color: #4C1D95;
  font-size: 0.875rem;
  margin: 1.5rem 0;
}
.alert-icon { flex-shrink: 0; color: #7C3AED; }

/* =========================================================
   UI/UX PRO MAX - ADVANCED DESIGN SYSTEM
   ========================================================= */

/* Reading Progress Bar (Fixed top viewport indicator) */
#readingProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366F1, #8B5CF6, #EC4899);
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* Ambient Radial Mesh Lighting (Vercel / Stripe Style) */
.mesh-glow-hero {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(139, 92, 246, 0.12) 40%, rgba(11, 15, 25, 0) 70%);
  pointer-events: none;
  filter: blur(80px);
  z-index: 0;
}

.mesh-glow-subtle {
  position: absolute;
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(59, 130, 246, 0.06) 45%, transparent 70%);
  pointer-events: none;
  filter: blur(60px);
}

/* Glassmorphism Surface Panels */
.glass-panel {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

html.dark .glass-panel {
  background: rgba(18, 24, 38, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(30, 41, 59, 0.8);
}

/* Enhanced Product & Blog Cards */
.product-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(99, 102, 241, 0.2);
}

html.dark .product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 38px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.4);
}



/* Discount Badge */
.badge-discount {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

/* Keyboard Shortcut Tag (<kbd>) */
.kbd-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #94A3B8;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Command Palette (Cmd + K Modal) */
#commandPaletteModal {
  transition: opacity 0.2s ease-out, visibility 0.2s;
}

#commandPaletteModal.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Back to Top Floating Button */
#backToTopBtn {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: #1E293B !important;
  color: #FFFFFF !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid #334155 !important;
  cursor: pointer !important;
  z-index: 50 !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  transform: translateY(16px) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#backToTopBtn.visible {
  display: flex !important;
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#backToTopBtn:hover {
  background: #6366F1 !important;
  border-color: #6366F1 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4) !important;
}

/* Micro Toast Notification */
#globalToastContainer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: #0F172A;
  color: #FFFFFF;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  animation: toastPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastPop {
  0% { transform: scale(0.9) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Sleek Table of Contents Scrollspy Active Highlight */
.toc-link {
  transition: color 0.15s, border-color 0.15s, padding-left 0.15s;
}
.toc-link.active {
  color: #6366F1 !important;
  font-weight: 700;
  border-left-color: #6366F1 !important;
  padding-left: 0.75rem !important;
}

/* Custom Selection Highlight */
::selection {
  background: rgba(99, 102, 241, 0.25);
  color: inherit;
}

