/**
 * CSS Reset
 * Normalize default browser styles
 */

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

/* Remove margins and paddings */
* {
  margin: 0;
  padding: 0;
}

/* HTML and Body */
html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--gray-50);
  min-height: 100vh;

  /* iOS smooth scrolling */
  -webkit-overflow-scrolling: touch;

  /* Safe area padding removed from body - applied to specific containers instead
     to avoid layout issues on Android devices with incorrect safe-area reporting */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
}

p {
  margin-bottom: var(--space-md);
}

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

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

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

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Forms */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  margin: 0;
}

/* iOS-specific input fixes */
input,
textarea,
select {
  /* Remove iOS default styling */
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;

  /* Prevent zoom on focus in iOS Safari */
  font-size: 16px;
}

/* Keep number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: auto;
}

button {
  cursor: pointer;

  /* Remove iOS button styling */
  -webkit-appearance: none;
  appearance: none;
}

button:disabled {
  cursor: not-allowed;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Utility Classes */
.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;
}

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

/* Selection */
::selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

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

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