/**
 * 🎯 Modern CSS Reset
 * Based on Josh Comeau's Custom CSS Reset + PWA optimizations
 */

/* Box sizing reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Remove default margin & padding */
* {
  margin: 0;
  padding: 0;
}

/* Improve text rendering */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Set core root defaults */
html, body {
  height: 100%;
  overflow-x: hidden;
}

/* Set core body defaults */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  
  /* Prevent text size adjustment on iOS */
  -webkit-text-size-adjust: 100%;
  
  /* Disable pull-to-refresh on Chrome */
  overscroll-behavior-y: contain;
  
  /* Disable tap highlight on mobile */
  -webkit-tap-highlight-color: transparent;
}

/* Make images easier to work with */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* Inherit fonts for inputs and buttons */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* Remove button styling */
button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

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

/* Remove default link styling */
a {
  text-decoration: none;
  color: inherit;
}

/* Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Remove default fieldset styling */
fieldset {
  border: none;
}

/* App container */
#app {
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  isolation: isolate;
}

/* Accessibility: Respect user motion preferences */
@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;
  }
}

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

/* Selection styles */
::selection {
  background: var(--primary);
  color: var(--white);
}

/* Scrollbar styling (WebKit) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

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

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

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400) var(--bg-secondary);
}
