/**
 * ═══════════════════════════════════════════════════════════════════════════
 * BASE STYLES & CSS RESET
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ─── Modern CSS Reset ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

/* ─── Animated Gradient Background ─── */
body.bg-animated {
    background: linear-gradient(135deg,
            var(--gradient-color-1, #0f0f0f) 0%,
            var(--gradient-color-2, #1a1a2e) 50%,
            var(--gradient-color-3, #16213e) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

body.bg-animated.speed-fast {
    animation-duration: 8s;
}

body.bg-animated.speed-medium {
    animation-duration: 12s;
}

body.bg-animated.speed-slow {
    animation-duration: 20s;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ─── Static Gradient Background ─── */
body.bg-gradient {
    background: linear-gradient(135deg,
            var(--gradient-color-1, #0f0f0f) 0%,
            var(--gradient-color-2, #1a1a2e) 50%,
            var(--gradient-color-3, #16213e) 100%);
}

/* ─── Solid Background ─── */
body.bg-solid {
    background-color: var(--solid-bg-color, var(--color-bg-primary));
}

/* ─── Typography Base ─── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

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

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

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

input,
textarea,
select {
    font: inherit;
}

ul,
ol {
    list-style: none;
}

/* ─── Focus Styles (Accessibility) ─── */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Remove default focus outline, use focus-visible instead */
:focus:not(:focus-visible) {
    outline: none;
}

/* ─── Selection ─── */
::selection {
    background-color: var(--color-accent);
    color: white;
}

/* ─── Scrollbar Styling ─── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* ─── Main Container ─── */
.page-container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-8) var(--container-padding) var(--space-12);
}

.content-wrapper {
    width: 100%;
    max-width: var(--max-width);
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

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

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    body.bg-animated {
        animation: none;
    }
}