/* ==========================================================================
   DoYouPrompt Design System - Modern CSS Reset
   ========================================================================== */

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

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

/* Prevent font-size inflation on mobile */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  tab-size: 4;
}

/* Sensible body defaults */
body {
  min-height: 100vh;
  min-height: 100dvh;
  line-height: var(--line-height-normal, 1.5);
  font-family: var(--font-family-sans, system-ui, sans-serif);
  font-size: var(--font-size-base, 1rem);
  color: var(--color-text-primary, #0F172A);
  background-color: var(--color-bg, #F8FAFC);
  text-rendering: optimizeLegibility;
}

/* Headings and interactive elements reset */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  overflow-wrap: break-word;
}

/* Balanced text wrapping for headings */
h1, h2, h3, h4 {
  text-wrap: balance;
}

/* Paragraph wrapping */
p {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

/* Remove list styles (class-based styling) */
ul[role='list'],
ol[role='list'],
ul[class],
ol[class] {
  list-style: none;
}

/* Anchor defaults */
a {
  color: inherit;
  text-decoration: inherit;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
  color: var(--color-text-link, currentColor);
}

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

/* SVG defaults */
svg {
  fill: currentColor;
}

svg:not([fill]) {
  fill: currentColor;
}

/* Inherit fonts for form elements */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Button reset */
button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* Textarea defaults */
textarea {
  resize: vertical;
}

/* Table reset */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Fieldset reset */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Legend reset */
legend {
  padding: 0;
}

/* Remove animations for reduced motion preference */
@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 visible styles */
:focus-visible {
  outline: 2px solid var(--color-primary, #4F46E5);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Remove default summary marker */
summary {
  cursor: pointer;
}

/* Dialog reset */
dialog {
  padding: 0;
}

/* Selection styling */
::selection {
  background-color: var(--color-primary-100, #E0E7FF);
  color: var(--color-primary-900, #312E81);
}

/* Hidden attribute */
[hidden] {
  display: none !important;
}

/* 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-width: 0;
}
