/* Styling system variables - mapped exactly to next.js globals.css */
:root {
  --background: #f9fafb;
  --foreground: #111827;
  
  --primary: #4f46e5;
  --on-primary: #ffffff;
  --secondary: #6366f1;
  --on-secondary: #ffffff;
  --surface: #ffffff;
  --on-surface: #111827;
  --surface-container-low: #f9fafb;
  --surface-container-high: #f3f4f6;
  --on-surface-variant: #4b5563;
  --outline-variant: #e5e7eb;
  --primary-container: #e0e7ff;
  --on-primary-container: #4338ca;
  --secondary-container: #eef2ff;
  --on-secondary-container: #3730a3;
  --error: #ef4444;
  --status-success: #22c55e;
  --status-warning: #f59e0b;
}

.dark {
  --background: #0b0f19;
  --foreground: #f3f4f6;
  
  --primary: #6366f1;
  --on-primary: #ffffff;
  --secondary: #818cf8;
  --on-secondary: #ffffff;
  --surface: #111827;
  --on-surface: #f3f4f6;
  --surface-container-low: #0f172a;
  --surface-container-high: #1e293b;
  --on-surface-variant: #9ca3af;
  --outline-variant: #334155;
  --primary-container: #1e1b4b;
  --on-primary-container: #e0e7ff;
  --secondary-container: #312e81;
  --on-secondary-container: #eef2ff;
  --error: #f87171;
  --status-success: #22c55e;
  --status-warning: #f59e0b;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Public Sans', sans-serif;
}

/* Material Symbols Icon Configuration */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 10px;
}
.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
::-webkit-scrollbar-thumb:hover {
  background: #d1d5db;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Premium Card Effects */
.card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  box-shadow: 0 4px 20px -2px rgba(79, 70, 229, 0.08);
}
.dark .card:hover {
  box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.15);
}

/* Active Nav States */
.nav-item.active {
  background-color: var(--primary-container);
  color: var(--on-primary-container);
}
.nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* Markdown Reader Layout/Typography overrides */
.prose {
  font-family: 'Inter', sans-serif;
  line-height: 1.625;
  color: var(--on-surface);
}
.prose h1 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
  border-bottom: 2px solid var(--outline-variant);
  padding-bottom: 0.5rem;
}
.prose h2 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}
.prose h3 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.prose p {
  margin-bottom: 1rem;
  color: var(--on-surface-variant);
  font-size: 0.925rem;
}
.prose code {
  background-color: var(--surface-container-high);
  color: var(--primary);
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
}
.prose pre {
  background-color: var(--surface-container-high);
  padding: 1rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--outline-variant);
}
.prose pre code {
  background-color: transparent;
  color: inherit;
  font-weight: normal;
  padding: 0;
  border-radius: 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}
.prose th, .prose td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--outline-variant);
  text-align: left;
}
.prose th {
  background-color: var(--surface-container-high);
  font-weight: 700;
  color: var(--foreground);
}
.prose ul, .prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  list-style-type: disc;
}
.prose li {
  margin-bottom: 0.375rem;
  color: var(--on-surface-variant);
}
.prose blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: var(--on-surface-variant);
}

/* Light / Dark toggles UI settings */
.theme-icon-light, .theme-icon-dark {
  font-size: 20px;
}
.dark .theme-icon-light {
  display: none;
}
.dark .theme-icon-dark {
  display: inline-block;
}

/* Interactive SVG DFD styles */
.dfd-node {
  transition: transform 0.2s, filter 0.2s;
  cursor: pointer;
}
.dfd-node:hover {
  filter: brightness(1.05) drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}
.dfd-process {
  fill: var(--primary-container);
  stroke: var(--primary);
  stroke-width: 2;
}
.dfd-entity {
  fill: var(--secondary-container);
  stroke: var(--secondary);
  stroke-width: 2;
}
.dfd-store {
  fill: var(--surface);
  stroke: var(--on-surface-variant);
  stroke-width: 2;
}
.dfd-link {
  stroke: var(--on-surface-variant);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  animation: dash 30s linear infinite;
  fill: none;
}
.dfd-link:hover {
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-dasharray: none;
}
.dfd-text {
  fill: var(--foreground);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}
.dfd-label {
  fill: var(--on-surface-variant);
  font-size: 9px;
  font-weight: 500;
}

@keyframes dash {
  to {
    stroke-dashoffset: -1000;
  }
}

/* Interactive ERD Hover Styles */
.erd-card {
  transition: all 0.2s ease-in-out;
}
.erd-card.highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-container), 0 4px 12px rgba(79, 70, 229, 0.15);
  transform: translateY(-2px);
}
.erd-card.faint {
  opacity: 0.4;
  filter: grayscale(40%);
}

.erd-field-row {
  transition: background-color 0.15s;
}
.erd-field-row:hover {
  background-color: var(--surface-container-high);
}
