/**
 * DMS Smart Monitor v1 - CSS Reset
 * 
 * Modern CSS reset based on:
 * - Andy Bell's Modern CSS Reset
 * - Josh Comeau's Custom CSS Reset
 * - Tailwind's Preflight
 * 
 * @phase W2-01 - Design System Base
 */

/* ============================================
   BOX MODEL RESET
   ============================================ */

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

/* ============================================
   MARGIN RESET
   ============================================ */

* {
    margin: 0;
    padding: 0;
}

/* ============================================
   TYPOGRAPHY RESET
   ============================================ */

html {
    /* Prevent font size inflation on mobile */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Smooth scrolling - respects user's preference */
    scroll-behavior: smooth;
}

body {
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure minimum height */
    min-height: 100vh;
    min-height: 100dvh;
    /* Line height inheritance */
    line-height: var(--line-height-normal);
}

/* ============================================
   MEDIA RESET
   ============================================ */

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

/* ============================================
   FORM ELEMENTS RESET
   ============================================ */

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

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

/* Reset textarea */
textarea {
    resize: vertical;
}

/* ============================================
   TABLE RESET
   ============================================ */

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ============================================
   LIST RESET
   ============================================ */

ul,
ol {
    list-style: none;
}

/* ============================================
   ANCHOR RESET
   ============================================ */

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   HEADING RESET
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
    line-height: var(--line-height-tight);
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Remove animations for users who prefer 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;
    }
}

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

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   UTILITY RESETS
   ============================================ */

/* Screen reader only content */
.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;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-tooltip);
    padding: var(--space-2) var(--space-4);
    background: var(--color-primary-600);
    color: var(--color-text-inverse);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-medium);
    transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    top: var(--space-4);
}
