/* ==========================================================================
   ItemTracker Documentation - Help Desk Style
   ========================================================================== */

/* Self-hosted Inter font */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-400.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-500.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-600.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-700.ttf') format('truetype');
}

/* CSS Variables */
:root {
    --docs-sidebar-width: 280px;
    --docs-toc-width: 220px;
    --docs-header-height: 64px;
    --docs-primary: #2563eb;
    --docs-primary-light: #3b82f6;
    --docs-bg-dark: #1e2a3b;
    --docs-bg-sidebar: #f8fafc;
    --docs-bg-content: #ffffff;
    --docs-text-primary: #1a1a2e;
    --docs-text-secondary: #4a5568;
    --docs-text-muted: #718096;
    --docs-border: #e2e8f0;
    --docs-code-bg: #f1f5f9;
}

/* Reset for docs pages */
.docs-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--docs-bg-content);
    min-height: 100vh;
    scroll-padding-top: calc(var(--docs-header-height) + 24px);
}

/* Ensure anchor targets account for fixed header */
.docs-page [id] {
    scroll-margin-top: calc(var(--docs-header-height) + 24px);
}

/* ==========================================================================
   Docs Header
   ========================================================================== */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--docs-header-height);
    background-color: var(--docs-bg-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.docs-header__logo {
    height: 32px;
    width: auto;
}

.docs-header__title {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
}

.docs-header__title span {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    margin-left: 8px;
}

.docs-header__search {
    flex: 1;
    max-width: 480px;
    margin: 0 48px;
}

.docs-header__search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.docs-header__search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.docs-header__search-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--docs-primary);
}

.docs-header__search-wrapper {
    position: relative;
}

.docs-header__search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.docs-header__nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.docs-header__link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.docs-header__link:hover {
    color: #ffffff;
}

.docs-header__cta {
    background-color: var(--docs-primary);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.docs-header__cta:hover {
    background-color: var(--docs-primary-light);
}

/* ==========================================================================
   Docs Layout
   ========================================================================== */
.docs-layout {
    display: flex;
    padding-top: var(--docs-header-height);
    min-height: 100vh;
}

/* ==========================================================================
   Docs Sidebar (Left)
   ========================================================================== */
.docs-sidebar {
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    bottom: 0;
    width: var(--docs-sidebar-width);
    background-color: var(--docs-bg-sidebar);
    border-right: 1px solid var(--docs-border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 100;
}

.docs-sidebar__section {
    margin-bottom: 8px;
}

.docs-sidebar__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--docs-text-primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
    /* Button reset for semantic button element */
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    line-height: inherit;
}

.docs-sidebar__title:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.docs-sidebar__title i {
    font-size: 0.75rem;
    color: var(--docs-text-muted);
    transition: transform 0.2s ease;
}

.docs-sidebar__title i {
    transform: rotate(180deg);
}

.docs-sidebar__section.collapsed .docs-sidebar__title i {
    transform: rotate(0deg);
}

.docs-sidebar__links {
    display: block;
    padding: 4px 0;
}

.docs-sidebar__section.collapsed .docs-sidebar__links {
    display: none;
}

.docs-sidebar__link {
    display: block;
    padding: 8px 20px 8px 36px;
    font-size: 0.8125rem;
    color: var(--docs-text-secondary);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.docs-sidebar__link:hover {
    color: var(--docs-primary);
    background-color: rgba(37, 99, 235, 0.04);
}

.docs-sidebar__link.active {
    color: var(--docs-primary);
    background-color: rgba(37, 99, 235, 0.08);
    border-left-color: var(--docs-primary);
    font-weight: 500;
}

/* ==========================================================================
   Docs Main Content
   ========================================================================== */
.docs-content {
    flex: 1;
    margin-left: var(--docs-sidebar-width);
    margin-right: var(--docs-toc-width);
    padding: 40px 60px;
    max-width: calc(100% - var(--docs-sidebar-width) - var(--docs-toc-width));
}

.docs-content__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--docs-text-muted);
    margin-bottom: 24px;
}

.docs-content__breadcrumb a {
    color: var(--docs-primary);
}

.docs-content__breadcrumb a:hover {
    text-decoration: underline;
}

.docs-content__breadcrumb span {
    color: var(--docs-text-muted);
}

.docs-content__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--docs-text-primary);
    margin-bottom: 16px;
    line-height: 1.3;
}

.docs-content__description {
    font-size: 1.0625rem;
    color: var(--docs-text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--docs-border);
}

/* Content sections */
.docs-section {
    margin-bottom: 40px;
}

.docs-section__title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--docs-text-primary);
    margin-bottom: 16px;
    padding-top: 16px;
}

.docs-section__subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--docs-text-primary);
    margin: 24px 0 12px 0;
}

.docs-section p {
    font-size: 0.9375rem;
    color: var(--docs-text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.docs-section ul,
.docs-section ol {
    margin: 16px 0;
    padding-left: 24px;
}

.docs-section li {
    font-size: 0.9375rem;
    color: var(--docs-text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}

.docs-section ul li {
    list-style-type: disc;
}

.docs-section ol li {
    list-style-type: decimal;
}

.docs-section a {
    color: var(--docs-primary);
}

.docs-section a:hover {
    text-decoration: underline;
}

/* Code blocks */
.docs-code {
    background-color: var(--docs-code-bg);
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
    overflow-x: auto;
}

.docs-code code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8125rem;
    color: var(--docs-text-primary);
    line-height: 1.6;
}

.docs-inline-code {
    background-color: var(--docs-code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8125rem;
    color: #e53e3e;
}

/* Info boxes */
.docs-note {
    background-color: #eff6ff;
    border-left: 4px solid var(--docs-primary);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.docs-note__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--docs-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-note p {
    margin: 0;
    font-size: 0.875rem;
}

.docs-warning {
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.docs-warning .docs-note__title {
    color: #b45309;
}

.docs-tip {
    background-color: #ecfdf5;
    border-left: 4px solid #10b981;
}

.docs-tip .docs-note__title {
    color: #059669;
}

/* Tables */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.875rem;
}

.docs-table th,
.docs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--docs-border);
}

.docs-table th {
    background-color: var(--docs-bg-sidebar);
    font-weight: 600;
    color: var(--docs-text-primary);
}

.docs-table td {
    color: var(--docs-text-secondary);
}

/* Images */
.docs-image {
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.docs-image img {
    width: 100%;
    display: block;
}

.docs-image__caption {
    font-size: 0.8125rem;
    color: var(--docs-text-muted);
    text-align: center;
    padding: 12px;
    background-color: var(--docs-bg-sidebar);
}

/* ==========================================================================
   Table of Contents (Right Sidebar)
   ========================================================================== */
.docs-toc {
    position: fixed;
    top: var(--docs-header-height);
    right: 0;
    bottom: 0;
    width: var(--docs-toc-width);
    padding: 32px 20px;
    overflow-y: auto;
    border-left: 1px solid var(--docs-border);
    background-color: var(--docs-bg-content);
}

.docs-toc__title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--docs-text-muted);
    margin-bottom: 16px;
}

.docs-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-toc__link {
    display: block;
    padding: 6px 0;
    font-size: 0.8125rem;
    color: var(--docs-text-secondary);
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -12px;
    transition: all 0.2s ease;
}

.docs-toc__link:hover {
    color: var(--docs-primary);
}

.docs-toc__link.active {
    color: var(--docs-primary);
    border-left-color: var(--docs-primary);
}

.docs-toc__link--sub {
    padding-left: 24px;
    font-size: 0.75rem;
}

/* ==========================================================================
   Footer Navigation
   ========================================================================== */
.docs-footer-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--docs-border);
}

.docs-footer-nav__item {
    max-width: 45%;
}

.docs-footer-nav__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--docs-text-muted);
    margin-bottom: 8px;
}

.docs-footer-nav__link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--docs-primary);
}

.docs-footer-nav__link:hover {
    text-decoration: underline;
}

.docs-footer-nav__item--next {
    text-align: right;
}

.docs-footer-nav__item--next .docs-footer-nav__link {
    justify-content: flex-end;
}

/* ==========================================================================
   Mobile Styles
   ========================================================================== */
.docs-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--docs-primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    z-index: 1001;
    font-size: 1.25rem;
}

@media (max-width: 1200px) {
    .docs-toc {
        display: none;
    }

    .docs-content {
        margin-right: 0;
        max-width: calc(100% - var(--docs-sidebar-width));
    }
}

@media (max-width: 900px) {
    .docs-header__search {
        display: none;
    }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }

    .docs-sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .docs-content {
        margin-left: 0;
        max-width: 100%;
        padding: 32px 24px;
    }

    .docs-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .docs-header {
        padding: 0 16px;
    }

    .docs-header__title span {
        display: none;
    }

    .docs-header__nav {
        gap: 12px;
    }

    .docs-header__link {
        display: none;
    }

    .docs-content {
        padding: 24px 16px;
    }

    .docs-content__title {
        font-size: 1.5rem;
    }

    .docs-footer-nav {
        flex-direction: column;
        gap: 24px;
    }

    .docs-footer-nav__item {
        max-width: 100%;
    }

    .docs-footer-nav__item--next {
        text-align: left;
    }

    .docs-footer-nav__item--next .docs-footer-nav__link {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.docs-hidden {
    display: none !important;
}

.docs-flex {
    display: flex;
}

.docs-flex-center {
    align-items: center;
    justify-content: center;
}

.docs-gap-sm {
    gap: 8px;
}

.docs-gap-md {
    gap: 16px;
}

.docs-mt-sm {
    margin-top: 8px;
}

.docs-mt-md {
    margin-top: 16px;
}

.docs-mt-lg {
    margin-top: 32px;
}

/* Step indicators */
.docs-steps {
    counter-reset: step-counter;
    margin: 24px 0;
}

.docs-step {
    position: relative;
    padding-left: 48px;
    margin-bottom: 24px;
    counter-increment: step-counter;
}

.docs-step::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background-color: var(--docs-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.docs-step__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--docs-text-primary);
    margin-bottom: 8px;
}

.docs-step__content {
    font-size: 0.9375rem;
    color: var(--docs-text-secondary);
    line-height: 1.7;
}

/* Feature cards */
.docs-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.docs-feature-card {
    background-color: var(--docs-bg-sidebar);
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.docs-feature-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.docs-feature-card__icon {
    width: 40px;
    height: 40px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--docs-primary);
    margin-bottom: 12px;
}

.docs-feature-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--docs-text-primary);
    margin-bottom: 8px;
}

.docs-feature-card__description {
    font-size: 0.875rem;
    color: var(--docs-text-secondary);
    line-height: 1.6;
}

/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Search results dropdown for docs header */
.docs-header__search-wrapper .search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}
.docs-header__search-wrapper .search-results__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.docs-header__search-wrapper .search-results__item:last-child {
    border-bottom: none;
}
.docs-header__search-wrapper .search-results__item:hover,
.docs-header__search-wrapper .search-results__item--active {
    background: #f1f5f9;
}
.docs-header__search-wrapper .search-results__badge {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 2px;
}
.docs-header__search-wrapper .search-results__badge--blog {
    background: #dbeafe;
    color: #1d4ed8;
}
.docs-header__search-wrapper .search-results__badge--docs {
    background: #dcfce7;
    color: #166534;
}
.docs-header__search-wrapper .search-results__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.docs-header__search-wrapper .search-results__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}
.docs-header__search-wrapper .search-results__snippet {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
}
.docs-header__search-wrapper .search-results__empty {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
}
