/* ============================================
   MODERN CSS RESET v2.0
   Улучшенный сброс стилей для кроссбраузерности
   ============================================ */

/* 1. Убираем внутренние отступы и границы */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 2. Убираем стандартные стили списков */
ul,
ol {
    list-style: none;
}

/* 3. Убираем подчеркивание у ссылок */
a {
    text-decoration: none;
    color: inherit;
}

/* 4. Наследование шрифтов для форм */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
}

/* 5. Убираем стрелки у input[type="number"] */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* 6. Убираем стандартные стили для кнопок */
button {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* 7. Для изображений и видео */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 8. Настройки для таблиц */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* 9. Скрываем элементы с hidden атрибутом */
[hidden] {
    display: none !important;
}

/* 10. Убираем стандартные отступы у текстовых элементов */
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
dl, dd, figure {
    margin: 0;
}

/* 11. Правильное отображение элементов fieldset и legend */
fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

legend {
    padding: 0;
}

/* 12. Убираем стандартный внешний вид details/summary */
details > summary {
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

/* 13. Настройка скроллбара (опционально) */
html {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Для WebKit браузеров */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 14. Плавная прокрутка */
html:focus-within {
    scroll-behavior: smooth;
}

/* 15. Улучшение рендеринга текста */
body {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 16. Убираем анимации для пользователей, которые их отключили */
@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;
    }
}

/* 17. Для элементов с contenteditable */
[contenteditable] {
    outline: none;
}

/* 18. Сброс для meter и progress */
meter,
progress {
    vertical-align: baseline;
}

/* 19. Убираем стандартный фон у поискового input */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

/* 20. Обнуление стилей для iframe */
iframe {
    border: 0;
}

/* 21. Правильное отображение hr */
hr {
    border: none;
    border-top: 1px solid;
    margin: 1em 0;
}

/* 22. Сброс для abbr */
abbr[title] {
    text-decoration: none;
    cursor: help;
}

/* 23. Улучшение доступности для фокуса */
:focus-visible {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* 24. Убираем стандартный внешний вид date/time inputs */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    appearance: none;
    -webkit-appearance: none;
}

/* 25. Базовые стили для body (можно переопределить в design-system) */
body {
    min-height: 100vh;
    line-height: 1.5;
}