/* AIMS Documentation Stylesheet */

/* ===== CSS Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-bg-alt: #f9fafb;
    --color-border: #e5e7eb;
    --color-code-bg: #f3f4f6;
    --color-link: #2563eb;
    --color-link-hover: #1e40af;
    --color-success: #059669;
    --color-warning: #d97706;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;

    --max-width: 900px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

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

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background: #faf8f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    line-height: 1.3;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 300;
}
h2 {
    font-size: 1.875rem;
    border-bottom: 2px solid #ffe8e0;
    padding-bottom: var(--spacing-xs);
    margin-top: var(--spacing-xl);
    font-weight: 400;
}
h3 {
    font-size: 1.5rem;
    font-weight: 500;
}
h4 {
    font-size: 1.25rem;
    font-weight: 500;
}
h5 {
    font-size: 1.125rem;
    font-weight: 500;
}
h6 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: var(--spacing-sm);
}

.lead {
    font-size: 1.25rem;
    color: #6b7280;
    font-weight: 300;
    line-height: 1.8;
}

/* ===== Links ===== */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

/* ===== Layout ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== Header ===== */
.doc-header {
    background: white;
    border-bottom: 1px solid #ffe8e0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 300;
    margin: 0;
    letter-spacing: -0.02em;
    font-family: var(--font-sans);
}

.logo h1 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.logo h1 a:hover {
    color: #ff6b3d;
    text-decoration: none;
}

.subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 300;
    padding-left: 1rem;
    border-left: 1px solid #e5e7eb;
}

.back-link {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 300;
}

.back-link:hover {
    background: #fff5f2;
    color: #ff6b3d;
    text-decoration: none;
}

.version {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: #f59e0b;
    color: white;
    border-radius: 16px;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.date {
    color: #9ca3af;
    font-weight: 300;
}

/* ===== Main Content ===== */
main {
    padding: var(--spacing-xl) var(--spacing-md);
    background: white;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: calc(var(--max-width) + 4rem);
}

.intro {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.intro h2 {
    border-bottom: none;
    margin-top: 0;
    font-size: 1.875rem;
    font-weight: 300;
    line-height: 1.4;
    color: #1f2937;
}

.intro p {
    text-align: left;
}

/* ===== Key Features ===== */
.key-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 900px;
}

.feature {
    padding: 1.5rem;
    background: #fafaf9;
    border-left: 3px solid #ff6b3d;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.feature h3 {
    font-size: 1.125rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1f2937;
}

.feature p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0;
    font-weight: 300;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .key-features {
        grid-template-columns: 1fr;
    }
}

/* ===== Buttons ===== */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2.5rem 0;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background: #ff6b3d;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 61, 0.25);
}

.btn-primary:hover {
    background: #f04e1f;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 107, 61, 0.35);
}

.btn-secondary {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #faf8f5;
    border-color: #ff6b3d;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ===== Table of Contents ===== */
.toc {
    margin: 3rem 0;
    padding: 2rem;
    background: #faf8f5;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
}

.toc > h2 {
    margin-top: 0;
    font-size: 1.75rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 2rem;
}

.toc-section {
    margin: 1.5rem 0;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toc-section h3 {
    font-size: 0.75rem;
    margin-bottom: 1rem;
    color: #ff6b3d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ffe8e0;
}

.toc-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
}

.toc-list li {
    margin: 0;
}

.toc-list a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 400;
    color: #4b5563;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.toc-list a:hover {
    background: #fff5f2;
    text-decoration: none;
    border-left-color: #ff6b3d;
    color: #1f2937;
    transform: translateX(4px);
}

.toc-list ol {
    counter-reset: item;
    list-style: none;
    padding: 0;
    display: block;
}

.toc-list ol li {
    counter-increment: item;
}

.toc-list ol li a::before {
    content: counter(item) ". ";
    font-weight: 600;
    color: #9ca3af;
    margin-right: 0.5rem;
    min-width: 1.5rem;
}

/* ===== Status & Info Boxes ===== */
.status,
.contributing,
.about {
    margin: 2.5rem 0;
}

.status h2,
.contributing h2,
.about h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    text-align: center;
}

.status-box,
.contributing,
.about {
    background: #fafaf9;
    border-left: 4px solid #ff6b3d;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.status-box p,
.contributing p,
.about p {
    text-align: left;
}

.status-box ul,
.contributing ul,
.contributing ol {
    text-align: left;
}

.status-box strong,
.contributing strong,
.about strong {
    color: #f04e1f;
    font-weight: 500;
}

/* ===== Code ===== */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-code-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    color: var(--color-text);
}

pre {
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: var(--spacing-md);
    overflow-x: auto;
    margin: var(--spacing-md) 0;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ===== Lists ===== */
ul, ol {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
}

li {
    margin: 0.25rem 0;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
}

th, td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-bg-alt);
    font-weight: 600;
}

/* ===== Blockquotes ===== */
blockquote {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-md);
    border-left: 4px solid var(--color-border);
    color: var(--color-text-light);
    font-style: italic;
}

/* ===== Footer ===== */
.doc-footer {
    border-top: 1px solid #f3f4f6;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 300;
}

.doc-footer a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.doc-footer a:hover {
    color: #ff6b3d;
    text-decoration: none;
}

.doc-footer p {
    margin: 0.5rem 0;
}

/* ===== External Link Icon ===== */
.link-external::after {
    content: " ↗";
    font-size: 0.875em;
    color: var(--color-text-light);
}

/* ===== Page Navigation ===== */
.page-nav {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.nav-prev,
.nav-next {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-prev:hover,
.nav-next:hover {
    background: white;
    border-color: var(--color-primary);
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-prev {
    margin-right: auto;
}

.nav-next {
    margin-left: auto;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 300;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #ff6b3d;
    text-decoration: none;
}

/* ===== Spec Content Spacing ===== */
.spec-content {
    margin: var(--spacing-lg) 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .quick-links {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .key-features {
        grid-template-columns: 1fr;
    }
}

/* ===== Print Styles ===== */
@media print {
    .doc-header,
    .doc-footer,
    .quick-links {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    a {
        color: var(--color-text);
        text-decoration: none;
    }

    pre, code {
        border: 1px solid var(--color-border);
    }
}
