/* ============================================================
   ALP Base — base.css
   Reset, Typography & Foundational Styles
   ============================================================ */

/* ── Font Import ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Reset ────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  tab-size: 4;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Remove default list styles */
ul, ol {
  list-style: none;
}

/* Anchor reset */
a {
  color: inherit;
  text-decoration: none;
}

/* Image defaults */
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form element resets */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Table resets */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove spin buttons from number inputs */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
}

/* Remove clear button from search inputs in IE/Edge */
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* ── Selection ────────────────────────────────────────────── */
::selection {
  background-color: var(--accent-primary);
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--accent-primary);
  color: #ffffff;
}

/* ── Focus-Visible ────────────────────────────────────────── */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

/* ── Typography Scale ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-md);
  font-weight: var(--font-medium);
}

p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

strong, b {
  font-weight: var(--font-semibold);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-tertiary);
  color: var(--accent-primary-hover);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: var(--space-4);
  color: var(--text-secondary);
  font-style: italic;
}

hr {
  border: none;
  height: 1px;
  background: var(--border-primary);
  margin: var(--space-6) 0;
}

/* ── Utility Text Classes ─────────────────────────────────── */
.text-xs      { font-size: var(--text-xs);   }
.text-sm      { font-size: var(--text-sm);   }
.text-base    { font-size: var(--text-base); }
.text-md      { font-size: var(--text-md);   }
.text-lg      { font-size: var(--text-lg);   }
.text-xl      { font-size: var(--text-xl);   }
.text-2xl     { font-size: var(--text-2xl);  }
.text-3xl     { font-size: var(--text-3xl);  }
.text-4xl     { font-size: var(--text-4xl);  }

.text-primary   { color: var(--text-primary);   }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted);     }
.text-accent    { color: var(--accent-primary);  }
.text-success   { color: var(--color-success);   }
.text-warning   { color: var(--color-warning);   }
.text-danger    { color: var(--color-danger);    }
.text-info      { color: var(--color-info);      }

.font-medium    { font-weight: var(--font-medium);   }
.font-semibold  { font-weight: var(--font-semibold); }
.font-bold      { font-weight: var(--font-bold);     }
.font-mono      { font-family: var(--font-mono);     }

.text-center    { text-align: center; }
.text-right     { text-align: right;  }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Spacing Helpers ──────────────────────────────────────── */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ── Layout Helpers ───────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.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; }
.flex-1      { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.grid { display: grid; }

.relative { position: relative; }
.absolute { position: absolute; }

.hidden      { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Misc ─────────────────────────────────────────────────── */
.no-select {
  -webkit-user-select: none;
  user-select: none;
}

.cursor-pointer {
  cursor: pointer;
}

.opacity-50  { opacity: 0.5; }
.opacity-70  { opacity: 0.7; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-full{ border-radius: var(--radius-pill); }
