/**
 * Base Styles - CSS Reset & Typography
 * Import design-tokens.css before this file
 */

/* ============================================
   CSS RESET (Modern Normalize)
   ============================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: var(--leading-normal);
}

body {
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-color, var(--gray-900));
  background-color: var(--bg-color, var(--white));
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--heading-color, var(--gray-900));
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
}

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

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

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

h5, h6 {
  font-size: var(--text-base);
}

p {
  margin-bottom: var(--space-md);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--link-color, var(--info-600));
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover-color, var(--info-700));
  text-decoration: underline;
}

a:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

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

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

code, pre {
  font-family: var(--font-family-mono);
  font-size: var(--text-sm);
}

/* ============================================
   LISTS
   ============================================ */

ul, ol {
  list-style: none;
}

/* ============================================
   FORMS (Base Reset)
   ============================================ */

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

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

input, select, textarea {
  background-color: var(--white);
  border: 1px solid var(--border-color, var(--gray-300));
}

/* Remove default appearance */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* ============================================
   IMAGES & MEDIA
   ============================================ */

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  fill: currentColor;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Screen Reader Only */
.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;
}

/* Skip to Main Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--gray-900);
  color: var(--white);
  padding: var(--space-md);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* Focus Visible Override */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Disabled State */
:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ============================================
   SCROLLBAR STYLING (Webkit)
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* ============================================
   SELECTION
   ============================================ */

::selection {
  background-color: var(--primary-color, var(--info-500));
  color: var(--white);
}

::-moz-selection {
  background-color: var(--primary-color, var(--info-500));
  color: var(--white);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  .no-print {
    display: none !important;
  }
}
