/* ═══════════════════════════════════════════════════════════════
   DMG Platform — Base Styles
   Reset, typography, utilities
   ═══════════════════════════════════════════════════════════════ */

@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');

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-light); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-primary);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}
code {
  background: var(--bg-input);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
  color: var(--primary-light);
}
pre {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
}

::selection {
  background: var(--primary-alpha-30);
  color: var(--text-primary);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Utility Classes ────────────────────────────────────────── */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-accent    { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-error     { color: var(--error) !important; }
.text-warning   { color: var(--warning) !important; }
.text-info      { color: var(--info) !important; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-mono   { font-family: var(--font-mono); }
.text-sm     { font-size: 0.8125rem; }
.text-xs     { font-size: 0.75rem; }
.text-lg     { font-size: 1.125rem; }
.text-xl     { font-size: 1.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }

.mt-0 { margin-top: 0; }     .mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }     .mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }  .mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mr-1 { margin-right: 0.5rem; } .ml-1 { margin-left: 0.5rem; }
.mr-2 { margin-right: 1rem; }   .ml-2 { margin-left: 1rem; }
.ml-auto { margin-left: auto; }

.p-0 { padding: 0; }        .p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }     .p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.gap-1 { gap: 0.5rem; }  .gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }  .gap-4 { gap: 2rem; }

.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-block   { display: block; }
.d-inline  { display: inline; }
.d-none    { display: none !important; }

.flex-col     { flex-direction: column; }
.flex-row     { flex-direction: row; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.hidden { display: none !important; }
.visible { display: block !important; }
.cursor-pointer { cursor: pointer; }
.no-select { user-select: none; }

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.animate-fade-in    { animation: fadeIn 0.3s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease-out; }
.animate-spin       { animation: spin 1s linear infinite; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
