/* docs/css/site.css */
/* World-class documentation styling for Axiom01 */

:root {
    --sidebar-width: 280px;
    --header-height: 70px;
    --docs-primary: var(--a-color-primary);
    --docs-surface: var(--a-color-surface);
    --docs-surface-variant: var(--a-color-surface-variant);
    --docs-on-surface: var(--a-color-on-surface);
    --docs-on-surface-variant: var(--a-color-on-surface-variant);
    --docs-outline: var(--a-color-outline);
}

/* Base styling */
body {
    font-family: var(--a-font-family-sans) !important;
    font-size: var(--a-font-size-base);
    line-height: var(--a-line-height-base);
    color: var(--docs-on-surface);
    background-color: var(--docs-surface);
    overflow: hidden;
    margin: 0;
}

.docs-layout {
    display: flex;
    height: 100vh;
    background-color: var(--docs-surface);
}

/* Professional sidebar styling */
.docs-sidebar {
    width: var(--sidebar-width);
    background-color: var(--docs-surface-variant);
    border-right: 1px solid var(--docs-outline);
    padding: var(--a-space-l);
    overflow-y: auto;
    height: 100vh;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: var(--a-space-xl);
    padding-bottom: var(--a-space-l);
    border-bottom: 1px solid var(--docs-outline);
}

.sidebar-header .brand {
    font-family: var(--a-font-family-mono);
    font-weight: var(--a-font-weight-bold);
    font-size: var(--a-font-size-lg, 1.25rem);
    color: var(--docs-primary);
    text-decoration: none;
}

.sidebar-header .primary {
    color: var(--docs-primary);
}

/* Main content area */
.docs-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Professional header */
.main-header {
    height: var(--header-height);
    background-color: var(--docs-surface);
    border-bottom: 1px solid var(--docs-outline);
    padding: 0 var(--a-space-l);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-bar i {
    position: absolute;
    left: var(--a-space-m);
    top: 50%;
    transform: translateY(-50%);
    color: var(--docs-on-surface-variant);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: var(--a-space-s) var(--a-space-m) var(--a-space-s) calc(var(--a-space-xl) + var(--a-space-s));
    border: 1px solid var(--docs-outline);
    border-radius: var(--a-border-radius-medium);
    background-color: var(--docs-surface);
    color: var(--docs-on-surface);
    font-size: var(--a-font-size-base);
    transition: border-color 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--docs-primary);
    box-shadow: 0 0 0 2px rgba(var(--a-color-primary), 0.2);
}

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

/* Actions in header */
.actions {
    display: flex;
    align-items: center;
    gap: var(--a-space-m);
}

.github {
    display: flex;
    align-items: center;
    gap: var(--a-space-s);
    padding: var(--a-space-s) var(--a-space-m);
    background-color: var(--docs-surface-variant);
    border-radius: var(--a-border-radius-medium);
    color: var(--docs-on-surface);
    text-decoration: none;
    transition: all 0.2s ease;
}

.github:hover {
    background-color: var(--docs-outline);
}

.theme-toggle {
    background: none;
    border: none;
    padding: var(--a-space-s);
    cursor: pointer;
    color: var(--docs-on-surface);
    border-radius: var(--a-border-radius-medium);
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--docs-surface-variant);
}

/* CRITICAL: Search Results Styling */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--docs-surface);
    border: 1px solid var(--docs-outline);
    border-top: none;
    border-radius: 0 0 var(--a-border-radius-medium) var(--a-border-radius-medium);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-results.visible {
    display: block;
}

.search-result {
    padding: var(--a-space-m);
    cursor: pointer;
    border-bottom: 1px solid var(--docs-outline);
    transition: background-color 0.2s ease;
}

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

.search-result:hover,
.search-result.focused {
    background-color: var(--docs-primary);
    color: var(--a-color-on-primary);
}

.search-result-title {
    font-weight: var(--a-font-weight-semibold, 600);
    font-size: var(--a-font-size-base);
    margin-bottom: var(--a-space-xs);
}

.search-result-description {
    font-size: var(--a-font-size-sm, 0.875rem);
    color: inherit;
    opacity: 0.8;
    margin-bottom: var(--a-space-xs);
}

.search-result-category {
    font-size: var(--a-font-size-xs, 0.75rem);
    text-transform: uppercase;
    font-weight: var(--a-font-weight-medium, 500);
    opacity: 0.6;
}

.search-no-results {
    padding: var(--a-space-l);
    text-align: center;
    color: var(--docs-on-surface-variant);
    font-style: italic;
}

/* Navigation styling */
.sidebar-nav {
    font-size: 0.9rem;
    height: auto;
    overflow: visible;
}

.nav-group {
    margin-bottom: var(--a-space-l);
}

.nav-group h4 {
    font-size: var(--a-font-size-sm, 0.875rem);
    font-weight: var(--a-font-weight-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--docs-on-surface-variant);
    margin: 0 0 var(--a-space-s) 0;
}

.nav-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-group li {
    margin-bottom: var(--a-space-xs);
}

.nav-group a {
    display: block;
    padding: var(--a-space-s) var(--a-space-m);
    color: var(--docs-on-surface);
    text-decoration: none;
    border-radius: var(--a-border-radius-small, 0.25rem);
    transition: all 0.2s ease;
    font-size: var(--a-font-size-sm, 0.875rem);
}

.nav-group a:hover {
    background-color: var(--docs-outline);
}

.nav-group a.active {
    background-color: var(--docs-primary);
    color: var(--a-color-on-primary);
    font-weight: var(--a-font-weight-medium, 500);
}

/* FIXED: Ensure component list can expand to show all items */
#component-list {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

/* Content container and iframe */
.content-container {
    flex: 1;
    overflow: hidden;
}

.content-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background-color: var(--docs-surface);
}

/* Dark mode support */
[data-theme="dark"] {
    --docs-surface: #1a1a1a;
    --docs-surface-variant: #2a2a2a;
    --docs-on-surface: #ffffff;
    --docs-on-surface-variant: #cccccc;
    --docs-outline: #404040;
}

/* Responsive design */
@media (max-width: 768px) {
    .docs-layout {
        flex-direction: column;
    }

    .docs-sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--docs-outline);
    }

    .main-header {
        padding: 0 var(--a-space-m);
    }

    .search-bar {
        max-width: 300px;
    }

    .actions {
        gap: var(--a-space-s);
    }

    .github span {
        display: none;
    }
}
