
/* Material Design 3 CSS Variables */
:root {
    /* Primary Colors */
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: #21005D;

    /* Secondary Colors */
    --md-sys-color-secondary: #625B71;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #E8DEF8;
    --md-sys-color-on-secondary-container: #1D192B;

    /* Surface Colors */
    --md-sys-color-surface: #FEF7FF;
    --md-sys-color-on-surface: #1D1B20;
    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-on-surface-variant: #49454F;
    --md-sys-color-surface-container: #F3EDF7;
    --md-sys-color-surface-container-high: #ECE6F0;
    --md-sys-color-surface-container-highest: #E6E0E9;

    /* Outline Colors */
    --md-sys-color-outline: #79747E;
    --md-sys-color-outline-variant: #CAC4D0;

    /* Error Colors */
    --md-sys-color-error: #BA1A1A;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #FFDAD6;
    --md-sys-color-on-error-container: #410002;

    /* Typography Scale */
    --md-sys-typescale-display-large-font-size: 57px;
    --md-sys-typescale-display-large-line-height: 64px;
    --md-sys-typescale-display-large-font-weight: 400;

    --md-sys-typescale-display-medium-font-size: 45px;
    --md-sys-typescale-display-medium-line-height: 52px;
    --md-sys-typescale-display-medium-font-weight: 400;

    --md-sys-typescale-headline-large-font-size: 32px;
    --md-sys-typescale-headline-large-line-height: 40px;
    --md-sys-typescale-headline-large-font-weight: 400;

    --md-sys-typescale-headline-medium-font-size: 28px;
    --md-sys-typescale-headline-medium-line-height: 36px;
    --md-sys-typescale-headline-medium-font-weight: 400;

    --md-sys-typescale-headline-small-font-size: 24px;
    --md-sys-typescale-headline-small-line-height: 32px;
    --md-sys-typescale-headline-small-font-weight: 400;

    --md-sys-typescale-title-large-font-size: 22px;
    --md-sys-typescale-title-large-line-height: 28px;
    --md-sys-typescale-title-large-font-weight: 400;

    --md-sys-typescale-title-medium-font-size: 16px;
    --md-sys-typescale-title-medium-line-height: 24px;
    --md-sys-typescale-title-medium-font-weight: 500;

    --md-sys-typescale-body-large-font-size: 16px;
    --md-sys-typescale-body-large-line-height: 24px;
    --md-sys-typescale-body-large-font-weight: 400;

    --md-sys-typescale-body-medium-font-size: 14px;
    --md-sys-typescale-body-medium-line-height: 20px;
    --md-sys-typescale-body-medium-font-weight: 400;

    --md-sys-typescale-label-large-font-size: 14px;
    --md-sys-typescale-label-large-line-height: 20px;
    --md-sys-typescale-label-large-font-weight: 500;

    /* Spacing */
    --md-sys-spacing-xs: 4px;
    --md-sys-spacing-sm: 8px;
    --md-sys-spacing-md: 16px;
    --md-sys-spacing-lg: 24px;
    --md-sys-spacing-xl: 32px;
    --md-sys-spacing-xxl: 48px;
    --md-sys-spacing-xxxl: 64px;

    /* Elevation */
    --md-sys-elevation-level0: none;
    --md-sys-elevation-level1: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level2: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level3: 0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level4: 0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level5: 0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);

    /* Border Radius */
    --md-sys-shape-corner-none: 0px;
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;

    /* Animation */
    --md-sys-motion-duration-short1: 50ms;
    --md-sys-motion-duration-short2: 100ms;
    --md-sys-motion-duration-short3: 150ms;
    --md-sys-motion-duration-short4: 200ms;
    --md-sys-motion-duration-medium1: 250ms;
    --md-sys-motion-duration-medium2: 300ms;
    --md-sys-motion-duration-medium3: 350ms;
    --md-sys-motion-duration-medium4: 400ms;
    --md-sys-motion-duration-long1: 450ms;
    --md-sys-motion-duration-long2: 500ms;
    --md-sys-motion-duration-long3: 550ms;
    --md-sys-motion-duration-long4: 600ms;

    --md-sys-motion-easing-linear: cubic-bezier(0, 0, 1, 1);
    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
    --md-sys-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
    --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
    --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
}

/* Dark Theme Override */
@media (prefers-color-scheme: dark) {
    :root {
        --md-sys-color-primary: #D0BCFF;
        --md-sys-color-on-primary: #381E72;
        --md-sys-color-primary-container: #4F378B;
        --md-sys-color-on-primary-container: #EADDFF;

        --md-sys-color-secondary: #CCC2DC;
        --md-sys-color-on-secondary: #332D41;
        --md-sys-color-secondary-container: #4A4458;
        --md-sys-color-on-secondary-container: #E8DEF8;

        --md-sys-color-surface: #141218;
        --md-sys-color-on-surface: #E6E0E9;
        --md-sys-color-surface-variant: #49454F;
        --md-sys-color-on-surface-variant: #CAC4D0;
        --md-sys-color-surface-container: #211F26;
        --md-sys-color-surface-container-high: #2B2930;
        --md-sys-color-surface-container-highest: #36343B;

        --md-sys-color-outline: #938F99;
        --md-sys-color-outline-variant: #49454F;
    }
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: var(--md-sys-typescale-body-large-font-size);
    line-height: var(--md-sys-typescale-body-large-line-height);
    font-weight: var(--md-sys-typescale-body-large-font-weight);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.theme-transitioning {
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.theme-transitioning * {
    transition: background-color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
                color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
                border-color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--md-sys-spacing-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--md-sys-spacing-lg);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--md-sys-spacing-xl);
    }
}

/* Typography */
h1 {
    font-size: var(--md-sys-typescale-display-medium-font-size);
    line-height: var(--md-sys-typescale-display-medium-line-height);
    font-weight: var(--md-sys-typescale-display-medium-font-weight);
    margin-bottom: var(--md-sys-spacing-lg);
}

h2 {
    font-size: var(--md-sys-typescale-headline-large-font-size);
    line-height: var(--md-sys-typescale-headline-large-line-height);
    font-weight: var(--md-sys-typescale-headline-large-font-weight);
    margin-top: var(--md-sys-spacing-xxl);
    margin-bottom: var(--md-sys-spacing-lg);
    color: var(--md-sys-color-primary);
}

h3 {
    font-size: var(--md-sys-typescale-headline-medium-font-size);
    line-height: var(--md-sys-typescale-headline-medium-line-height);
    font-weight: var(--md-sys-typescale-headline-medium-font-weight);
    margin-top: var(--md-sys-spacing-xl);
    margin-bottom: var(--md-sys-spacing-md);
    color: var(--md-sys-color-on-surface);
}

h4 {
    font-size: var(--md-sys-typescale-headline-small-font-size);
    line-height: var(--md-sys-typescale-headline-small-line-height);
    font-weight: var(--md-sys-typescale-headline-small-font-weight);
    margin-top: var(--md-sys-spacing-lg);
    margin-bottom: var(--md-sys-spacing-md);
}

p {
    margin-bottom: var(--md-sys-spacing-md);
    color: var(--md-sys-color-on-surface-variant);
}

ul, ol {
    margin-bottom: var(--md-sys-spacing-md);
    padding-left: var(--md-sys-spacing-lg);
}

li {
    margin-bottom: var(--md-sys-spacing-sm);
    color: var(--md-sys-color-on-surface-variant);
}

strong {
    font-weight: var(--md-sys-typescale-label-large-font-weight);
    color: var(--md-sys-color-on-surface);
}

a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    border-radius: var(--md-sys-shape-corner-extra-small);
    padding: var(--md-sys-spacing-xs);
    margin: calc(-1 * var(--md-sys-spacing-xs));
}

a:hover {
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

hr {
    border: none;
    height: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin: var(--md-sys-spacing-xl) 0;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: var(--md-sys-typescale-headline-large-font-size);
        line-height: var(--md-sys-typescale-headline-large-line-height);
    }

    h2 {
        font-size: var(--md-sys-typescale-headline-medium-font-size);
        line-height: var(--md-sys-typescale-headline-medium-line-height);
    }

    h3 {
        font-size: var(--md-sys-typescale-headline-small-font-size);
        line-height: var(--md-sys-typescale-headline-small-line-height);
    }
}

/* Navigation */
.nav-bar {
    background-color: var(--md-sys-color-surface-container);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-md);
    min-height: 64px;
}

.nav-logo {
    font-size: var(--md-sys-typescale-title-large-font-size);
    font-weight: var(--md-sys-typescale-title-large-font-weight);
    color: var(--md-sys-color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
}

.nav-logo:hover {
    background-color: transparent;
    color: var(--md-sys-color-primary);
}

.nav-links {
    display: flex;
    gap: var(--md-sys-spacing-sm);
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-small);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    font-weight: var(--md-sys-typescale-label-large-font-weight);
}

.nav-link:hover {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.nav-link.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--md-sys-spacing-sm);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
}

.nav-toggle:hover {
    background-color: var(--md-sys-color-surface-container-high);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--md-sys-color-surface-container);
        flex-direction: column;
        padding: var(--md-sys-spacing-md);
        border-bottom: 1px solid var(--md-sys-color-outline-variant);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        width: 100%;
        text-align: left;
    }
}

/* Breadcrumb */
.breadcrumb {
    background-color: var(--md-sys-color-surface-container);
    padding: var(--md-sys-spacing-md) 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--md-sys-typescale-body-medium-font-size);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    margin: 0;
}

.breadcrumb-separator {
    color: var(--md-sys-color-outline);
    font-size: 12px;
}

.breadcrumb-link {
    color: var(--md-sys-color-on-surface-variant);
    padding: var(--md-sys-spacing-xs) var(--md-sys-spacing-sm);
    border-radius: var(--md-sys-shape-corner-extra-small);
}

.breadcrumb-link:hover {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
}

.breadcrumb-current {
    color: var(--md-sys-color-primary);
    font-weight: var(--md-sys-typescale-label-large-font-weight);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-secondary) 100%);
    color: var(--md-sys-color-on-primary);
    padding: var(--md-sys-spacing-xxxl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: var(--md-sys-color-on-primary);
    margin-bottom: var(--md-sys-spacing-md);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: var(--md-sys-typescale-title-large-font-size);
    color: var(--md-sys-color-on-primary);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .hero {
        padding: var(--md-sys-spacing-xxl) 0;
    }
}
/* Content Area */
.content {
    padding: var(--md-sys-spacing-xxxl) 0;
    min-height: 60vh;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md-sys-spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 300px 1fr;
        gap: var(--md-sys-spacing-xxl);
    }
}

/* Table of Contents */
.toc {
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-level1);
    position: sticky;
    top: calc(64px + var(--md-sys-spacing-md));
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    order: -1;
}

.toc h3 {
    font-size: var(--md-sys-typescale-title-medium-font-size);
    font-weight: var(--md-sys-typescale-title-medium-font-weight);
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--md-sys-spacing-md) 0;
    padding-bottom: var(--md-sys-spacing-sm);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.toc-progress {
    height: 4px;
    background-color: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-small);
    margin-bottom: var(--md-sys-spacing-md);
    overflow: hidden;
}

.toc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
    border-radius: var(--md-sys-shape-corner-small);
    width: 0%;
    transition: width var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin: 0;
}

.toc-link {
    display: block;
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: var(--md-sys-typescale-body-medium-font-size);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    border-left: 3px solid transparent;
}

.toc-link:hover {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-left-color: var(--md-sys-color-primary);
}

.toc-link.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-left-color: var(--md-sys-color-primary);
    font-weight: var(--md-sys-typescale-label-large-font-weight);
}

.toc-link.sub-item {
    padding-left: var(--md-sys-spacing-xl);
    font-size: var(--md-sys-typescale-body-small-font-size);
}

@media (max-width: 1023px) {
    .toc {
        position: static;
        order: 0;
        margin-bottom: var(--md-sys-spacing-lg);
    }
}

/* Main Content */
.main-content {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-xl);
    box-shadow: var(--md-sys-elevation-level1);
}

.content-header {
    margin-bottom: var(--md-sys-spacing-xl);
    padding-bottom: var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.effective-date {
    display: inline-block;
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: var(--md-sys-typescale-body-medium-font-size);
    font-weight: var(--md-sys-typescale-label-large-font-weight);
    margin-bottom: var(--md-sys-spacing-md);
}

.section {
    scroll-margin-top: 80px;
}

.section-content {
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-lg);
    margin-bottom: var(--md-sys-spacing-lg);
    border-left: 4px solid var(--md-sys-color-primary);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: var(--md-sys-spacing-lg);
    right: var(--md-sys-spacing-lg);
    width: 56px;
    height: 56px;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-large);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--md-sys-elevation-level3);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    transform: translateY(100px);
    opacity: 0;
    z-index: 1000;
}

.back-to-top.visible {
    transform: translateY(0);
    opacity: 1;
}

.back-to-top:hover {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    box-shadow: var(--md-sys-elevation-level4);
    transform: translateY(-2px);
}

.back-to-top:active {
    transform: translateY(0);
    box-shadow: var(--md-sys-elevation-level2);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--md-sys-color-outline-variant);
    border-radius: 50%;
    border-top-color: var(--md-sys-color-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--md-sys-color-surface-container) 25%, var(--md-sys-color-surface-container-high) 50%, var(--md-sys-color-surface-container) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--md-sys-shape-corner-small);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--md-sys-spacing-sm);
}

.skeleton-text:last-child {
    width: 60%;
}
/* Footer */
.footer {
    background-color: var(--md-sys-color-surface-container-high);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    padding: var(--md-sys-spacing-xl) 0;
    margin-top: var(--md-sys-spacing-xxxl);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md-sys-spacing-lg);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr auto;
        text-align: left;
        align-items: center;
    }
}

.footer-text {
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-medium-font-size);
    margin: 0;
}

.footer-links {
    display: flex;
    gap: var(--md-sys-spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .footer-links {
        justify-content: flex-end;
    }
}

.footer-link {
    color: var(--md-sys-color-on-surface-variant);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: var(--md-sys-typescale-body-medium-font-size);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.footer-link:hover {
    background-color: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
}

/* Utility Classes */
.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;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--md-sys-spacing-xs); }
.mb-2 { margin-bottom: var(--md-sys-spacing-sm); }
.mb-3 { margin-bottom: var(--md-sys-spacing-md); }
.mb-4 { margin-bottom: var(--md-sys-spacing-lg); }
.mb-5 { margin-bottom: var(--md-sys-spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--md-sys-spacing-xs); }
.mt-2 { margin-top: var(--md-sys-spacing-sm); }
.mt-3 { margin-top: var(--md-sys-spacing-md); }
.mt-4 { margin-top: var(--md-sys-spacing-lg); }
.mt-5 { margin-top: var(--md-sys-spacing-xl); }

/* Focus Management */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    text-decoration: none;
    border-radius: var(--md-sys-shape-corner-small);
    z-index: 1000;
    transition: top var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.skip-link:focus {
    top: 6px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --md-sys-color-outline: #000000;
        --md-sys-color-outline-variant: #000000;
    }

    .nav-bar,
    .breadcrumb,
    .footer {
        border-width: 2px;
    }

    .toc,
    .main-content {
        border: 2px solid var(--md-sys-color-outline);
    }
}

/* Reduced Motion Support */
@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;
    }

    .hero::before {
        animation: none;
    }

    .loading,
    .skeleton {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .nav-bar,
    .breadcrumb,
    .toc,
    .back-to-top,
    .footer {
        display: none;
    }

    .content {
        padding: 0;
    }

    .main-content {
        box-shadow: none;
        border: 1px solid #000;
    }

    .hero {
        background: none;
        color: #000;
        padding: var(--md-sys-spacing-lg) 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #000;
        page-break-after: avoid;
    }

    p, li {
        color: #000;
    }
}
/* Page Transitions */
.page-transitioning {
    opacity: 0.8;
    pointer-events: none;
    transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.page-transitioning::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--md-sys-color-surface);
    opacity: 0.5;
    z-index: 9999;
    pointer-events: none;
}

/* Enhanced Focus Styles */
.keyboard-navigation *:focus {
    outline: 2px solid var(--md-sys-color-primary) !important;
    outline-offset: 2px !important;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
}

.animate-slide-left {
    animation: slideInFromLeft var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-emphasized);
}

.animate-slide-right {
    animation: slideInFromRight var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-emphasized);
}

/* Enhanced Mobile Styles */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--md-sys-spacing-sm);
    }

    .hero {
        padding: var(--md-sys-spacing-xl) 0;
    }

    .hero h1 {
        font-size: var(--md-sys-typescale-headline-medium-font-size);
        line-height: var(--md-sys-typescale-headline-medium-line-height);
    }

    .hero p {
        font-size: var(--md-sys-typescale-body-large-font-size);
    }

    .content {
        padding: var(--md-sys-spacing-xl) 0;
    }

    .main-content {
        padding: var(--md-sys-spacing-lg);
    }

    .back-to-top {
        bottom: var(--md-sys-spacing-md);
        right: var(--md-sys-spacing-md);
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Enhanced Tablet Styles */
@media (min-width: 481px) and (max-width: 1023px) {
    .content-wrapper {
        gap: var(--md-sys-spacing-lg);
    }

    .toc {
        position: static;
        margin-bottom: var(--md-sys-spacing-lg);
    }
}

/* Large Screen Enhancements */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .content-wrapper {
        grid-template-columns: 350px 1fr;
        gap: var(--md-sys-spacing-xxxl);
    }

    .hero h1 {
        font-size: var(--md-sys-typescale-display-large-font-size);
        line-height: var(--md-sys-typescale-display-large-line-height);
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .hero::before {
        opacity: 0.3;
    }

    .section-content {
        background-color: var(--md-sys-color-surface-container);
        border-left-color: var(--md-sys-color-primary);
    }
}

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

::-webkit-scrollbar-track {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-small);
}

::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-on-surface-variant);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--md-sys-color-outline) var(--md-sys-color-surface-container);
}