/* Shadcn UI Inspired Documentation Style Sheet */
@import url('https://fonts.googleapis.com/css2?family=Geist+Sans:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;
    --radius: 0.5rem;
    --sidebar-width: 260px;
}

[data-theme="dark"] {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-color: hsl(var(--border));
}

html {
    scroll-behavior: smooth;
    font-family: 'Geist Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: hsl(var(--background) / 80%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: hsl(var(--foreground));
}

.logo svg {
    width: 20px;
    height: 20px;
    color: hsl(var(--foreground));
}

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

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.375rem 0.75rem 0.375rem 2rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.825rem;
    width: 200px;
    transition: all 0.15s ease-in-out;
}

.search-input:focus {
    outline: none;
    border-color: hsl(var(--foreground));
    width: 240px;
}

.search-icon {
    position: absolute;
    left: 0.625rem;
    color: hsl(var(--muted-foreground));
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.search-kbd {
    position: absolute;
    right: 0.5rem;
    pointer-events: none;
    font-size: 0.7rem;
    background-color: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-family: inherit;
    transition: opacity 0.15s;
}

.search-input:focus ~ .search-kbd {
    opacity: 0;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 200;
    display: none;
    scrollbar-width: thin;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: hsl(var(--foreground));
    border-bottom: 1px solid hsl(var(--border) / 50%);
    cursor: pointer;
    transition: background-color 0.15s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: hsl(var(--secondary));
    outline: none;
}

.search-result-icon {
    margin-top: 0.2rem;
    width: 14px;
    height: 14px;
    color: hsl(var(--muted-foreground));
}

.search-result-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.search-result-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.search-result-snippet {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 250px;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
    font-size: 0.85rem;
}

@keyframes flash-highlight {
    0% {
        background-color: hsla(217, 91%, 60%, 0.25);
    }
    100% {
        background-color: transparent;
    }
}

.highlight-flash {
    animation: flash-highlight 1.5s ease-out;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid hsl(var(--border));
    cursor: pointer;
    color: hsl(var(--foreground));
    padding: 0.375rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.theme-toggle-btn:hover {
    background-color: hsl(var(--secondary));
}

.theme-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    margin-top: 60px;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - 60px);
    position: fixed;
    top: 60px;
    left: 0;
    background-color: hsl(var(--background));
    border-right: 1px solid hsl(var(--border));
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 90;
}

.nav-group {
    margin-bottom: 1.75rem;
}

.nav-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.nav-links {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.nav-link svg {
    width: 14px;
    height: 14px;
}

.nav-link:hover, .nav-link.active {
    color: hsl(var(--foreground));
    background-color: hsl(var(--secondary));
}

.nav-link.active {
    font-weight: 600;
}

/* Main Content */
main {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 3rem 4rem 6rem;
    max-width: 900px;
    min-height: calc(100vh - 60px);
}

section {
    padding-top: 70px;
    margin-top: -70px;
    margin-bottom: 4rem;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    color: hsl(var(--foreground));
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid hsl(var(--border));
    letter-spacing: -0.02em;
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2 svg {
    width: 20px;
    height: 20px;
    color: hsl(var(--muted-foreground));
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    letter-spacing: -0.015em;
    color: hsl(var(--foreground));
}

p {
    font-size: 0.95rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1.25rem;
}

a {
    color: hsl(var(--foreground));
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 500;
}

a:hover {
    color: hsl(var(--muted-foreground));
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.725rem;
    font-weight: 500;
    border-radius: 9999px;
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

/* Callouts */
.callout {
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
    margin-bottom: 2rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.callout svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.callout.warning {
    background-color: hsla(38, 92%, 50%, 0.05);
    border-color: hsla(38, 92%, 50%, 0.3);
}

.callout.warning svg {
    color: hsl(38, 92%, 50%);
}

.callout.info {
    background-color: hsla(217, 91%, 60%, 0.05);
    border-color: hsla(217, 91%, 60%, 0.3);
}

.callout.info svg {
    color: hsl(217, 91%, 60%);
}

.callout-content {
    flex-grow: 1;
}

.callout-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: hsl(var(--foreground));
}

.callout-content p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Code Blocks */
pre {
    background-color: hsl(var(--secondary));
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.75rem;
    position: relative;
    border: 1px solid hsl(var(--border));
}

code {
    font-family: 'Geist Mono', 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

pre code {
    color: hsl(var(--foreground));
}

p code, li code {
    background-color: hsl(var(--secondary));
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    color: hsl(var(--foreground));
    font-size: 0.825rem;
    border: 1px solid hsl(var(--border));
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: hsl(var(--background));
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-size: 0.725rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Geist Sans', sans-serif;
    font-weight: 500;
}

.copy-btn:hover {
    background-color: hsl(var(--secondary));
    color: hsl(var(--foreground));
}

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

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

th {
    font-weight: 600;
    color: hsl(var(--muted-foreground));
}

tr:hover td {
    background-color: hsl(var(--secondary));
}

/* Bullets */
ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

li {
    font-size: 0.95rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.375rem;
}

/* Responsive design */
@media (max-width: 1024px) {
    header {
        padding: 0 1rem;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    main {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }
}
