/* SchoolKit Documentation Styles */

/* Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #334155;
    background-color: #ffffff;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #1e293b;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
}

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

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.25;
    color: #1e293b;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.875rem;
    margin-bottom: 0.875rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.625rem;
    margin-top: 1.25rem;
}

p {
    margin: 0 0 1rem 0;
}

a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Header Styles */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-nav {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.nav-brand .brand-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}

.nav-brand .brand-link:hover {
    text-decoration: none;
}

.brand-logo {
    height: 32px;
    width: auto;
    display: block;
    transition: opacity 0.2s ease;
}

.nav-brand .brand-link:hover .brand-logo {
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    padding: 0.5rem 0;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #3b82f6;
    text-decoration: none;
}

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    min-width: 12rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: all 0.15s ease;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #64748b;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.dropdown-link:hover {
    background-color: #f8fafc;
    color: #3b82f6;
    text-decoration: none;
}

/* Main Layout */
.main {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

.sidebar {
    width: 16rem;
    padding: 2rem 1rem;
    background-color: #f8fafc;
    border-right: 1px solid #e2e8f0;
    position: sticky;
    top: 4rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.sidebar-link:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    text-decoration: none;
}

.sidebar-link.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.sidebar-link.active:hover {
    background-color: #2563eb;
    color: #ffffff;
}

.sidebar-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.content {
    flex: 1;
    padding: 2rem;
}

.content.full-width {
    max-width: none;
}

.content.with-sidebar {
    max-width: calc(100% - 16rem);
}

/* Sections and Spacing */
section + section {
    margin-top: 2.5rem;
}

.section {
    margin-bottom: 2.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #2563eb;
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #e2e8f0;
    color: #334155;
    text-decoration: none;
}

.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin: -2rem -2rem 2rem -2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 2rem;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.15s ease;
}

.card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card-link {
    text-decoration: none;
    color: inherit;
}

.card-link:hover {
    text-decoration: none;
    color: inherit;
}

.card-link:hover .card-title {
    color: #3b82f6;
}

.card-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: #3b82f6;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
    transition: color 0.15s ease;
}

.card-description {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* API Reference Cards */
.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.api-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    transition: all 0.15s ease;
}

.api-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.api-method {
    font-size: 1rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.25rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.api-signature {
    font-size: 0.75rem;
    color: #64748b;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #f1f5f9;
}

.api-card p {
    margin: 0;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.4;
}

/* API Method Links */
.api-method-link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 0.25rem;
    padding: 0.25rem;
    margin: -0.25rem;
    transition: background-color 0.15s ease;
}

.api-method-link:hover {
    background-color: rgba(59, 130, 246, 0.05);
    text-decoration: none;
}

.api-method-link:hover .api-method {
    color: #2563eb;
}

.api-method-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    background-color: rgba(59, 130, 246, 0.05);
}

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

/* Add some padding to method sections for anchor positioning */
.method[id] {
    scroll-margin-top: 2rem;
}

/* Code Blocks */
.code-block {
    position: relative;
    margin: 1.5rem 0;
}

.code-block + .code-block {
    margin-top: 1.5rem;
}

pre.code {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

pre.code code {
    background: none;
    padding: 0;
    border: none;
    font-size: inherit;
    color: #1e293b;
}

code {
    background: #f1f5f9;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875em;
    color: #be185d;
}

/* Copy Button */
.copy {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.8;
}

.copy:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
    opacity: 1;
}

.copy:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.copy.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

table + table {
    margin-top: 1.5rem;
}

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

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

tr:nth-child(even) {
    background: #f8fafc;
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    color: #92400e;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Method Documentation */
.method {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    overflow: hidden;
}

.method-header {
    background: #f8fafc;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.method-name {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #be185d;
}

.method-signature {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.method-body {
    padding: 1rem;
}

.method-description {
    margin-bottom: 1rem;
    color: #475569;
}

.method-example {
    margin-top: 1rem;
}

/* Footer */
.footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.footer-credit {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .content {
        max-width: none;
        padding: 1rem;
    }
    
    .hero {
        padding: 2rem 0;
        margin: -1rem -1rem 2rem -1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Prism.js Overrides */
code[class*="language-"],
pre[class*="language-"] {
    color: #1e293b;
    background: none;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    tab-size: 4;
    hyphens: none;
}

pre[class*="language-"] {
    padding: 1rem;
    margin: 0;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #94a3b8;
}

.token.punctuation {
    color: #64748b;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
    color: #dc2626;
}

.token.boolean,
.token.number {
    color: #7c3aed;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #059669;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
    color: #0891b2;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
    color: #ea580c;
}

.token.keyword {
    color: #3b82f6;
}

.token.regex,
.token.important {
    color: #be185d;
}

.token.important,
.token.bold {
    font-weight: bold;
}

.token.italic {
    font-style: italic;
}
