/* Modern Documentation CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

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

body {
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: #1a1a1a;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    color: #0f172a;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25rem;
}

h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: #475569;
}

/* Modern Links */
a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

a:visited {
    color: #6366f1;
}

/* Code Elements */
code, tt {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875em;
    background-color: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

pre {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

pre.example {
    background-color: #fefce8;
    border-color: #facc15;
}

/* Lists */
ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin: 0.5rem 0;
}

ul {
    list-style-type: disc;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

table.module_list,
table.function_list {
    border: none;
}

table.module_list td,
table.function_list td,
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}

table.module_list td.name,
table.function_list td.name {
    background-color: #f8fafc;
    font-weight: 600;
    min-width: 200px;
}

/* Layout Components */
#container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    min-height: 100vh;
}

#product {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    border-bottom: none;
}

#product big {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgb(0 0 0 / 0.3);
}

/* Modern Sidebar */
#navigation {
    float: left;
    width: 280px;
    background-color: #f8fafc;
    border-right: 1px solid #e2e8f0;
    min-height: calc(100vh - 120px);
    position: sticky;
    top: 0;
    overflow-y: auto;
}

#navigation h2 {
    background-color: #e2e8f0;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    margin: 0;
    border: none;
    border-bottom: 1px solid #cbd5e1;
}

#navigation ul {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

#navigation li {
    margin: 0;
    display: block;
    text-indent: 0;
}

#navigation li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

#navigation li a:hover {
    background-color: #e2e8f0;
    color: #3b82f6;
    border-left-color: #3b82f6;
    text-decoration: none;
}

#navigation li li a {
    padding-left: 2rem;
    font-size: 0.875rem;
}

/* Main Content */
#content {
    margin-left: 280px;
    padding: 2rem;
    max-width: none;
    border: none;
    background-color: #ffffff;
    min-height: calc(100vh - 120px);
}

#main {
    background-color: #ffffff;
    border: none;
}

/* Footer */
#about {
    clear: both;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.875rem;
}

/* Special Elements */
blockquote {
    border-left: 4px solid #3b82f6;
    background-color: #f8fafc;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 2rem 0;
}

.parameter {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-weight: 600;
    color: #7c3aed;
}

.parameter:after { content: ":"; }
.types:before { content: "("; }
.types:after { content: ")"; }
.type {
    font-weight: 600;
    font-style: italic;
    color: #dc2626;
}

/* Target highlighting */
a:target + * {
    background-color: #fef3c7;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid #f59e0b;
}

/* Definition lists */
dl.table dt,
dl.function dt {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    font-weight: 600;
}

dl.table dd,
dl.function dd {
    padding-bottom: 1rem;
    margin: 0.5rem 0 0 1.5rem;
    color: #475569;
}

dl.table h3,
dl.function h3 {
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Syntax highlighting for code */
pre .comment { color: #6b7280; font-style: italic; }
pre .constant { color: #dc2626; }
pre .escape { color: #7c2d12; }
pre .keyword { color: #7c3aed; font-weight: 600; }
pre .library { color: #059669; }
pre .marker {
    color: #92400e;
    background: #fef3c7;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
}
pre .string { color: #2563eb; }
pre .number { color: #dc2626; }
pre .function-name { color: #7c3aed; font-weight: 600; }
pre .operator { color: #374151; font-weight: 600; }
pre .preprocessor, pre .prepro { color: #be185d; }
pre .global { color: #7c3aed; }
pre .user-keyword { color: #7c3aed; }
pre .prompt { color: #059669; font-weight: 600; }
pre .url { color: #2563eb; text-decoration: underline; }

/* Responsive Design */
@media (max-width: 1024px) {
    #container {
        max-width: 100%;
    }

    #navigation {
        width: 240px;
    }

    #content {
        margin-left: 240px;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    #navigation {
        float: none;
        width: 100%;
        position: static;
        min-height: auto;
    }

    #content {
        margin-left: 0;
        padding: 1rem;
    }

    #product {
        padding: 1.5rem;
    }

    #product big {
        font-size: 2rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Print Styles */
@media print {
    body {
        font-family: 'Times New Roman', serif;
        font-size: 12pt;
        line-height: 1.5;
    }

    #navigation {
        display: none;
    }

    #container {
        box-shadow: none;
        max-width: 100%;
    }

    #content {
        margin-left: 0;
        padding: 0;
    }

    #product {
        background: none;
        color: black;
        border-bottom: 2px solid black;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    pre {
        border: 1px solid black;
        page-break-inside: avoid;
    }

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

/* Utility Classes */
.nowrap {
    overflow: auto;
    white-space: nowrap;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth scrolling for internal links */
html {
    scroll-behavior: smooth;
}

/* Loading animation for better UX */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#content > * {
    animation: fadeIn 0.3s ease-out;
}