/* ====================================
   CSS Reset & Base Styles (IMPROVED)
   REDitors - Complete Reset
   ==================================== */

/* Box sizing reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* HTML & Body defaults */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Remove default margins */
body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
    margin: 0;
}

/* Remove list styles */
ul[role='list'],
ol[role='list'],
ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
    max-width: 100%;
    display: block;
    height: auto;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Remove all button styles */
button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

/* Remove spinners from number inputs */
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;
    appearance: textfield;
}

/* Remove search input styling */
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 {
    -webkit-appearance: none;
    appearance: none;
}

/* Make sure textareas resize vertically only */
textarea {
    resize: vertical;
}

/* Remove default focus outline */
:focus {
    outline: none;
}

/* Add visible focus for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent, #ffffff);
    outline-offset: 2px;
}

/* Selection styling */
::selection {
    background: var(--accent, #ffffff);
    color: var(--bg, #000000);
    text-shadow: none;
}

::-moz-selection {
    background: var(--accent, #ffffff);
    color: var(--bg, #000000);
    text-shadow: none;
}

/* Scrollbar styling - Webkit browsers */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg, #050505);
}

::-webkit-scrollbar-thumb {
    background: var(--gray, #1a1a1a);
    border-radius: 5px;
    border: 2px solid var(--bg, #050505);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent, #ffffff);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray, #1a1a1a) var(--bg, #050505);
}

/* Remove animations for people who've turned them off */
@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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Improved text rendering */
h1, h2, h3, h4, h5, h6 {
    text-rendering: optimizeLegibility;
    font-weight: inherit;
    line-height: 1.2;
}

/* Prevent text overflow */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Better table defaults */
table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* Form elements normalization */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

legend {
    padding: 0;
}

/* Remove default button appearance */
button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
    appearance: button;
}

/* Ensure consistent font inheritance */
input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Remove default iOS input styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}

/* Fix iOS zoom on input focus */
@media screen and (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* Isolate content */
#root,
#__next,
.app {
    isolation: isolate;
}

/* Remove tap highlight on mobile */
a,
button,
input,
textarea,
select {
    -webkit-tap-highlight-color: transparent;
}

/* Better default cursor */
body {
    cursor: default;
}

a,
button,
[role="button"],
input[type="submit"],
input[type="button"],
label[for] {
    cursor: pointer;
}

input[disabled],
button[disabled],
select[disabled],
textarea[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
    
    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr,
    img {
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
    
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
}

/* Hidden utility */
[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;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent, #fff);
    color: var(--bg, #000);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}