/**
 * SAW LMS Design System - Base Styles
 * 
 * Reset and base element styling
 */

/* ================================
   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(--saw-font-sans);
    font-size: var(--saw-text-base);
    line-height: var(--saw-leading-normal);
    color: var(--saw-text);
    background: var(--saw-bg);
    min-height: 100vh;
}

/* ================================
   TYPOGRAPHY
   ================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--saw-font-semibold);
    line-height: var(--saw-leading-tight);
    color: var(--saw-text);
}

h1 {
    font-size: var(--saw-text-4xl);
}

h2 {
    font-size: var(--saw-text-3xl);
}

h3 {
    font-size: var(--saw-text-2xl);
}

h4 {
    font-size: var(--saw-text-xl);
}

h5 {
    font-size: var(--saw-text-lg);
}

h6 {
    font-size: var(--saw-text-base);
}

p {
    margin-bottom: var(--saw-space-4);
}

a {
    color: var(--saw-text-link);
    text-decoration: none;
    transition: color var(--saw-duration-fast) var(--saw-ease-default);
}

a:hover {
    color: var(--saw-primary-hover);
}

strong,
b {
    font-weight: var(--saw-font-semibold);
}

small {
    font-size: var(--saw-text-sm);
}

/* ================================
   LISTS
   ================================ */
ul,
ol {
    padding-left: var(--saw-space-6);
    margin-bottom: var(--saw-space-4);
}

li {
    margin-bottom: var(--saw-space-2);
}

/* ================================
   MEDIA
   ================================ */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

figure {
    margin: 0;
}

/* ================================
   CODE
   ================================ */
code,
kbd,
pre,
samp {
    font-family: var(--saw-font-mono);
    font-size: 0.875em;
}

code {
    padding: 0.125em 0.375em;
    background: var(--saw-bg-alt);
    border-radius: var(--saw-radius-sm);
}

pre {
    padding: var(--saw-space-4);
    background: var(--saw-bg-alt);
    border-radius: var(--saw-radius);
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: none;
}

/* ================================
   FORMS BASE
   ================================ */
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--saw-primary);
    outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ================================
   TABLES
   ================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: var(--saw-space-3);
    text-align: left;
    border-bottom: 1px solid var(--saw-border);
}

th {
    font-weight: var(--saw-font-semibold);
    color: var(--saw-text-secondary);
}

/* ================================
   HR
   ================================ */
hr {
    border: none;
    border-top: 1px solid var(--saw-border);
    margin: var(--saw-space-6) 0;
}

/* ================================
   SELECTION
   ================================ */
::selection {
    background: var(--saw-primary);
    color: var(--saw-white);
}

/* ================================
   SCROLLBAR
   ================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--saw-bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--saw-gray-400);
    border-radius: var(--saw-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--saw-gray-500);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--saw-gray-400) var(--saw-bg-alt);
}

/* ================================
   GLOBAL BACKGROUND EFFECTS
   Premium gradient + grid pattern
   (Same as product-single page)
   ================================ */
.saw-global-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 140% 120% at 50% -20%, rgba(0, 101, 153, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse 100% 80% at 100% 0%, rgba(0, 136, 204, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 0% 10%, rgba(79, 172, 254, 0.08) 0%, transparent 50%);
}

[data-theme="dark"] .saw-global-bg {
    background:
        radial-gradient(ellipse 140% 120% at 50% -20%, rgba(0, 101, 153, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse 100% 80% at 100% 0%, rgba(0, 136, 204, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 0% 10%, rgba(79, 172, 254, 0.18) 0%, transparent 50%);
}

/* Gradient Glow Animation */
.saw-global-bg__gradient {
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 180%;
    height: 700px;
    background: linear-gradient(135deg, #006599 0%, #0088cc 50%, #4facfe 100%);
    opacity: 0.15;
    filter: blur(80px);
    animation: globalGradientPulse 8s ease-in-out infinite;
}

[data-theme="dark"] .saw-global-bg__gradient {
    opacity: 0.25;
}

@keyframes globalGradientPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.07;
    }

    50% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.1;
    }
}

[data-theme="dark"] .saw-global-bg__gradient {
    animation-name: globalGradientPulseDark;
}

@keyframes globalGradientPulseDark {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.15;
    }

    50% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.25;
    }
}

/* Grid Pattern */
.saw-global-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 101, 153, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 101, 153, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: linear-gradient(180deg, black 0%, transparent 70%);
    -webkit-mask-image: linear-gradient(180deg, black 0%, transparent 70%);
}

[data-theme="dark"] .saw-global-bg__grid {
    background-image:
        linear-gradient(rgba(79, 172, 254, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 172, 254, 0.08) 1px, transparent 1px);
}