/**
 * BYD Shares and Stocks - CSS Reset
 * 
 * A modern CSS reset based on best practices.
 * Normalizes browser defaults and provides a clean foundation.
 */

/* ============================================
   1. BOX SIZING
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ============================================
   2. RESET MARGINS & PADDING
   ============================================ */
* {
  margin: 0;
  padding: 0;
}

/* ============================================
   3. ROOT & BODY
   ============================================ */
html {
  /* Prevent font size inflation on mobile */
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  
  /* Smooth scrolling for anchor links */
  scroll-behavior: smooth;
  
  /* Better font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  font-family: var(--font-secondary);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  
  /* Prevent horizontal scroll */
  overflow-x: hidden;
}

/* ============================================
   4. TYPOGRAPHY RESET
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ============================================
   5. MEDIA ELEMENTS
   ============================================ */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ============================================
   6. FORM ELEMENTS
   ============================================ */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Remove default textarea resize */
textarea {
  resize: vertical;
}

/* Remove default fieldset styles */
fieldset {
  border: none;
}

/* ============================================
   7. LINKS
   ============================================ */
a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   8. LISTS
   ============================================ */
ul,
ol {
  list-style: none;
}

/* ============================================
   9. TABLES
   ============================================ */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ============================================
   10. FOCUS STYLES
   ============================================ */
/* Remove default focus outline */
:focus {
  outline: none;
}

/* Visible focus for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   11. SELECTION
   ============================================ */
::selection {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ============================================
   12. SCROLLBAR STYLING (Webkit)
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-medium);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-dark);
}

/* Firefox scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-medium) var(--color-bg-secondary);
}

/* ============================================
   13. REDUCED MOTION
   ============================================ */
@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;
  }
}

/* ============================================
   14. 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;
  }
  
  img {
    max-width: 100% !important;
  }
  
  @page {
    margin: 2cm;
  }
}

