/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* ── Text ── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-mono   { font-family: var(--font-mono); }
.text-sm     { font-size: 0.875rem; }
.text-xs     { font-size: 0.75rem; }

/* ── Display ── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col    { flex-direction: column; }
.gap-sm      { gap: var(--space-sm); }
.gap-md      { gap: var(--space-md); }
.gap-lg      { gap: var(--space-lg); }
.gap-xl      { gap: var(--space-xl); }

/* ── Spacing ── */
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }
.mb-4xl { margin-bottom: var(--space-4xl); }

/* ── Accessibility ── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

.skip-link {
    position: fixed; top: -100%; left: var(--space-md);
    background: var(--accent); color: #fff;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    z-index: calc(var(--z-loader) + 1);
    font-size: 0.875rem; font-weight: 500;
    transition: top var(--transition-base);
}

.skip-link:focus { top: var(--space-md); }

/* ── Width ── */
.max-w-narrow { max-width: var(--container-narrow); }
.max-w-form   { max-width: var(--container-form); }
.mx-auto      { margin-left: auto; margin-right: auto; }

/* ── Docs Components ── */
.progress-bar {
    position: fixed; top: var(--nav-height); left: 0;
    height: 3px; background: var(--accent);
    width: 0%; z-index: var(--z-sticky);
    transition: width 0.1s;
    box-shadow: 0 0 10px var(--accent-glow);
}

.docs-layout {
    display: grid; grid-template-columns: 260px 1fr;
    gap: var(--space-4xl); padding-top: var(--space-2xl);
}

.docs-search-container {
    margin-bottom: var(--space-xl);
}

.docs-search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.docs-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 62, 51, 0.2);
}

.docs-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + var(--space-xl));
    height: calc(100vh - var(--nav-height) - var(--space-3xl));
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding-right: var(--space-xl);
    width: 100%;
    min-width: 240px;
    box-sizing: border-box;
}

.docs-sidebar.open {
    display: block;
    position: relative;
    top: auto;
    height: auto;
    max-height: 70vh;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.docs-sidebar h4 {
    color: var(--text-main); font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.08em;
    margin: var(--space-xl) 0 var(--space-md);
}

.docs-sidebar h4:first-child { margin-top: 0; }

.docs-sidebar ul { display: flex; flex-direction: column; gap: 0.75rem; }

.docs-sidebar a {
    font-size: 0.875rem; color: var(--text-dark);
    display: block; border-left: 2px solid transparent;
    padding-left: var(--space-md); margin-left: -2px;
    transition: all 0.2s var(--easing);
}

.docs-sidebar a:hover,
.docs-sidebar a.active { color: var(--text-main); border-left-color: var(--accent); }

.docs-content { max-width: 800px; width: 100%; padding-bottom: var(--space-6xl); }
.docs-content.reveal,
.docs-content.reveal.visible {
    opacity: 1;
    transform: none;
    filter: none;
}
.docs-content h1 { font-size: 2.5rem; margin-bottom: var(--space-md); }

.docs-content h2 {
    font-size: 1.75rem;
    margin: var(--space-3xl) 0 var(--space-lg);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.docs-content p { margin-bottom: var(--space-lg); font-size: 1.05rem; }

/* ── Code Blocks ── */
.code-wrapper {
    position: relative; margin: var(--space-xl) 0;
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}

.code-header {
    background: #1e1e1e; padding: 0.75rem var(--space-md);
    display: flex; justify-content: space-between; align-items: center;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    border: 1px solid var(--border); border-bottom: none;
}

.code-mac-btns { display: flex; gap: 6px; }
.code-mac-btns span { width: 10px; height: 10px; border-radius: 50%; background: #3f3f46; }
.code-mac-btns span:nth-child(1) { background: #ff5f56; }
.code-mac-btns span:nth-child(2) { background: #ffbd2e; }
.code-mac-btns span:nth-child(3) { background: #27c93f; }

.code-lang { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dark); }

.btn-copy {
    background: none; border: 1px solid var(--border-light);
    color: var(--text-muted); font-size: 0.75rem;
    padding: 0.25rem 0.75rem; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s; font-family: var(--font-sans);
}

.btn-copy:hover { color: #fff; border-color: #fff; }
.btn-copy.copied { color: var(--accent); border-color: var(--accent); }

.code-block {
    background: #0d0d0d; border: 1px solid var(--border);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    padding: var(--space-lg); overflow-x: auto;
    font-family: var(--font-mono); font-size: 0.875rem;
    color: #d4d4d8; line-height: 1.6;
}

.syntax-comment { color: #5c6370; font-style: italic; }
.syntax-func    { color: #61afef; }
.syntax-arg     { color: #d19a66; }
.syntax-string  { color: #98c379; }
.syntax-keyword { color: #c678dd; }

/* ── Contact Grid ── */
.contact-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl); max-width: 800px; margin: 0 auto;
}

.contact-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: var(--space-4xl) var(--space-xl);
    text-align: center; transition: all 0.4s var(--easing);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}

.contact-card:hover {
    border-color: var(--border-light);
    transform: translateY(-5px); box-shadow: var(--shadow-lg);
}

.contact-icon {
    width: 56px; height: 56px;
    margin-bottom: var(--space-lg); fill: var(--text-main);
    transition: transform 0.4s var(--easing-bounce);
}

.contact-card:hover .contact-icon { transform: scale(1.15); }

.contact-card h4 { font-size: 1.5rem; margin-bottom: var(--space-sm); }

/* ── Mobile Sidebar ── */
.docs-sidebar-mobile { display: none; }

.docs-sidebar-toggle {
    display: none; width: 100%; padding: var(--space-md);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); color: var(--text-main);
    font-size: 0.875rem; cursor: pointer; margin-bottom: var(--space-xl);
    text-align: left;
}
