/**
 * reset.css - Modern CSS Reset
 * Normalizes browser defaults for consistent styling
 */

/* ==========================================================================
   Box Sizing Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ==========================================================================
   Document Reset
   ========================================================================== */

html {
  /* Prevent font size adjustments after orientation changes */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  
  /* Smooth scrolling for the whole page */
  scroll-behavior: smooth;
  
  /* Better text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  
  /* Set base font size for rem calculations */
  font-size: 16px;
  
  /* Prevent horizontal scroll */
  overflow-x: hidden;
}

/* Focus visible for accessibility */
html:focus-within {
  scroll-behavior: smooth;
}

/* ==========================================================================
   Body Reset
   ========================================================================== */

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: var(--line-height-normal, 1.5);
  font-family: var(--font-sans);
  font-weight: var(--font-weight-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography Reset
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

p {
  margin: 0;
  padding: 0;
}

/* Remove default quotes */
blockquote,
q {
  quotes: none;
  margin: 0;
  padding: 0;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: '';
  content: none;
}

/* ==========================================================================
   List Reset
   ========================================================================== */

ul,
ol,
li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ==========================================================================
   Link Reset
   ========================================================================== */

a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  cursor: pointer;
}

a:active,
a:hover {
  outline-width: 0;
}

/* ==========================================================================
   Media Reset
   ========================================================================== */

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-style: none;
  /* Remove the border on images inside links in IE 10 */
  border: 0;
  /* Preserve aspect ratio */
  object-fit: cover;
}

svg {
  /* Allow SVG to scale properly */
  fill: currentColor;
  vertical-align: middle;
}

/* Hide overflow in IE */
svg:not(:root) {
  overflow: hidden;
}

/* ==========================================================================
   Form Reset
   ========================================================================== */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button,
select {
  text-transform: none;
}

/* Remove default button styles */
button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button;
  appearance: button;
  background-color: transparent;
  background-image: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Remove inner border and padding in Firefox */
button::-moz-focus-inner,
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/* Restore focus styles unset by previous rule */
button:-moz-focusring,
[type='button']:-moz-focusring,
[type='reset']:-moz-focusring,
[type='submit']:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/* Remove default input styles */
input {
  background-color: transparent;
  border: none;
  padding: 0;
}

input:focus {
  outline: none;
}

/* Remove spinner 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 */
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;
}

/* Textarea reset */
textarea {
  overflow: auto;
  resize: vertical;
  background-color: transparent;
  border: none;
}

/* Select reset */
select {
  background-color: transparent;
  border: none;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

select::-ms-expand {
  display: none;
}

/* Fieldset reset */
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* Legend reset */
legend {
  display: table;
  max-width: 100%;
  padding: 0;
  color: inherit;
  white-space: normal;
}

/* Progress reset */
progress {
  vertical-align: baseline;
}

/* ==========================================================================
   Table Reset
   ========================================================================== */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

td,
th {
  padding: 0;
  text-align: left;
}

/* ==========================================================================
   Interactive Elements Reset
   ========================================================================== */

details {
  display: block;
}

summary {
  display: list-item;
  cursor: pointer;
}

/* Remove outline for mouse users, keep for keyboard */
[tabindex='-1']:focus:not(:focus-visible) {
  outline: 0 !important;
}

/* ==========================================================================
   Accessibility Helpers
   ========================================================================== */

/* Hide content visually but keep accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-4);
  z-index: var(--z-max);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ==========================================================================
   Disable Animations for Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
  }

  abbr[title]::after {
    content: ' (' attr(title) ')';
  }

  a[href^='#']::after,
  a[href^='javascript:']::after {
    content: '';
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

/* ==========================================================================
   Selection Styles
   ========================================================================== */

::selection {
  background-color: var(--color-primary);
  color: var(--text-inverse);
  text-shadow: none;
}

::-moz-selection {
  background-color: var(--color-primary);
  color: var(--text-inverse);
  text-shadow: none;
}

/* ==========================================================================
   Scrollbar Styles
   ========================================================================== */

/* Width */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

/* Track */
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-full);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-secondary) var(--bg-secondary);
}