/**
 * Barcodes Generator - Base CSS, Modern Reset & Typography
 */

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

html {
  font-size: 16px;
  line-height: 1.6;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Accessibility: Skip to Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  background: var(--color-primary);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid #ffffff;
}

/* Focus styles for keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Text Selection */
::selection {
  background-color: rgba(var(--color-primary-rgb), 0.25);
  color: var(--color-primary-dark);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(2rem, 4vw + 1rem, var(--text-5xl));
  font-weight: var(--font-weight-extrabold);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw + 0.5rem, var(--text-3xl));
  margin-top: 1.5rem;
}

h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, var(--text-2xl));
  margin-top: 1.25rem;
}

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

p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: var(--text-base);
  line-height: 1.7;
}

p.lead {
  font-size: clamp(1.125rem, 1vw + 0.75rem, var(--text-xl));
  color: var(--text-muted);
  line-height: 1.6;
}

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

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

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

/* Code & Pre */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 0.75rem 0 0.75rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

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

/* Form Resets */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: var(--text-sm);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-surface-subtle);
  font-weight: var(--font-weight-semibold);
  color: var(--text-main);
}
