/**
 * EduMonitor - Sistema de Gestão Escolar
 * Reset CSS - Normalização de estilos
 * 
 * Baseado em modern-normalize com adições customizadas
 */

/* ========================================
   BOX SIZING
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ========================================
   DOCUMENTO
   ======================================== */
html {
    /* Prevent adjustments of font size after orientation changes in iOS */
    -webkit-text-size-adjust: 100%;
    /* Improve consistency of default fonts */
    -moz-tab-size: 4;
    tab-size: 4;
    /* Smooth scrolling */
    scroll-behavior: smooth;
}

/* ========================================
   BODY
   ======================================== */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: inherit;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ========================================
   SEÇÕES
   ======================================== */
main {
    display: block;
}

/* ========================================
   TIPOGRAFIA
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

p {
    margin: 0;
}

/* ========================================
   LISTAS
   ======================================== */
ol,
ul,
menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ========================================
   LINKS
   ======================================== */
a {
    color: inherit;
    text-decoration: inherit;
}

/* ========================================
   MÍDIA
   ======================================== */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    display: block;
    max-width: 100%;
    height: auto;
}

img,
video {
    vertical-align: middle;
}

/* ========================================
   TABELAS
   ======================================== */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ========================================
   FORMULÁRIOS
   ======================================== */
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
    background-color: transparent;
    background-image: none;
    cursor: pointer;
}

/* Remove inner border and padding in Firefox */
::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

/* Restore focus styles unset by the previous rule */
:-moz-focusring {
    outline: auto;
}

/* Remove additional ':invalid' styles in Firefox */
:-moz-ui-invalid {
    box-shadow: none;
}

/* Remove padding in Safari */
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
    height: auto;
}

/* Style search inputs correctly */
[type="search"] {
    -webkit-appearance: textfield;
    outline-offset: -2px;
}

::-webkit-search-decoration {
    -webkit-appearance: none;
}

/* Style file input button */
::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

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

/* Placeholder color */
::placeholder {
    color: var(--color-text-tertiary);
    opacity: 1;
}

/* Disabled state */
:disabled {
    cursor: not-allowed;
}

/* ========================================
   FIELDSET & LEGEND
   ======================================== */
fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

legend {
    padding: 0;
}

/* ========================================
   CITAÇÕES
   ======================================== */
blockquote,
q {
    quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
    content: '';
}

/* ========================================
   LINHAS HORIZONTAIS
   ======================================== */
hr {
    height: 0;
    border: 0;
    border-top: 1px solid var(--color-border-light);
    margin: 0;
}

/* ========================================
   ABREVIAÇÕES
   ======================================== */
abbr[title] {
    text-decoration: underline dotted;
}

/* ========================================
   CÓDIGO
   ======================================== */
code,
kbd,
samp,
pre {
    font-family: var(--font-family-mono);
    font-size: 1em;
}

pre {
    margin: 0;
    overflow-x: auto;
}

/* ========================================
   FORMATAÇÃO DE TEXTO
   ======================================== */
b,
strong {
    font-weight: bolder;
}

small {
    font-size: 80%;
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */
/* Hide visually but keep accessible */
.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 visible para acessibilidade por teclado */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Remove outline para cliques do mouse */
:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   SELEÇÃO DE TEXTO
   ======================================== */
::selection {
    background-color: var(--color-primary-200);
    color: var(--color-primary-900);
}

/* ========================================
   SCROLLBAR CUSTOMIZADA
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: var(--border-radius-full);
}

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

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

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-300) var(--color-gray-100);
}

/* ========================================
   HIDDEN
   ======================================== */
[hidden] {
    display: none !important;
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    *,
    *::before,
    *::after {
        background: transparent;
        color: #000;
        box-shadow: none;
        text-shadow: none;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    img {
        page-break-inside: avoid;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}
