/**
 * SenseCAP Documentation Center Stylesheet
 * 76-docs-center.css
 */

.docs-hub-wrapper {
    background: #f8fafc;
    min-height: 100vh;
    padding-bottom: 80px;
    color: #1e293b;
    font-family: inherit;
}

/* ── Hero Banner ── */
.docs-hero-banner {
    position: relative !important;
    isolation: isolate;
    overflow: hidden !important;
    border-top: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background-color: var(--mc-pages-hero-overlay-col, #060a12) !important;
    background-image: var(--mc-hero-bg-black) !important;
    background-size: cover !important;
    background-position: center 35% !important;
    background-repeat: no-repeat !important;
    color: var(--mc-hero-title, #ffffff) !important;
    padding: var(--mc-pages-hero-pad-desk, 56px) 20px 48px !important;
    box-sizing: border-box !important;
}

.docs-hero-banner::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, .6), transparent);
    mask-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, .6), transparent);
}

.docs-hero-banner > * {
    position: relative !important;
    z-index: 2 !important;
}

@media (max-width: 620px) {
    .docs-hero-banner {
        padding-top: var(--mc-pages-hero-pad-mob, 34px) !important;
        padding-bottom: var(--mc-pages-hero-pad-mob, 34px) !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        min-height: var(--mc-pages-hero-minh-mob, auto) !important;
    }
}

.docs-hero-container {
    max-width: 1200px;
    margin: 0 auto;
}

.docs-hero-content {
    max-width: 780px;
}

.docs-badge-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #34d399;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.docs-hero-title {
    font-size: clamp(2rem, 3.6vw, 2.85rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: #ffffff;
    margin: 0 0 14px 0;
}

.docs-hero-desc {
    font-size: clamp(0.95rem, 1.3vw, 1.05rem);
    line-height: 1.6;
    color: #94a3b8;
    margin: 0 0 28px 0;
}

/* ── Search Input ── */
.docs-search-box {
    position: relative;
    max-width: 600px;
    display: flex;
    align-items: center;
}

.docs-search-icon {
    position: absolute;
    left: 16px;
    color: #64748b;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.docs-search-box input {
    width: 100%;
    padding: 14px 44px 14px 44px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #0f172a;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.docs-search-box input:focus {
    outline: none;
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.docs-search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.docs-search-clear:hover {
    color: #0f172a;
}

/* ── Main Layout Container ── */
.docs-main-container {
    max-width: 1560px;
    width: 96%;
    margin: 36px auto 0;
    padding: 0 16px;
    box-sizing: border-box;
}

.docs-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr) 250px;
    gap: 28px;
    align-items: stretch;
}

/* ── Mobile Navigation Trigger ── */
.docs-mobile-nav-bar {
    display: none;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.btn-docs-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #0f766e;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0;
    transition: background 0.18s ease, transform 0.1s ease;
}

.btn-docs-mobile-toggle:hover {
    background: #0d655e;
}

.btn-docs-mobile-toggle svg {
    flex-shrink: 0;
}

.docs-mobile-active-label {
    font-size: 0.78rem;
    color: #475569;
    font-weight: 600;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
    text-align: right;
    display: block;
}

/* ── Left Sidebar Navigation ── */
.docs-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: -webkit-sticky;
    position: sticky;
    top: 90px;
    align-self: start;
    height: fit-content;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
    z-index: 10;
}

.docs-sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.docs-sidebar-header h3 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
}

.docs-sidebar-count {
    font-size: 0.7rem;
    color: #0f766e;
    background: #ccfbf1;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.docs-sidebar-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 6px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    flex: 1;
    min-height: 0;
}

.docs-sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Category Item */
.docs-nav-category {
    margin-bottom: 4px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.docs-category-toggle {
    width: 100%;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    color: #1e293b;
    font-size: 0.86rem;
    font-weight: 600;
    transition: all 0.18s ease;
}

.docs-category-toggle:hover {
    background: #f1f5f9;
    color: #0f766e;
}

.docs-nav-category.is-active > .docs-category-toggle {
    color: #0f766e;
    background: #f0fdfa;
}

.docs-cat-icon {
    display: flex;
    align-items: center;
    color: #64748b;
    flex-shrink: 0;
}

.docs-nav-category.is-active .docs-cat-icon {
    color: #0f766e;
}

.docs-cat-title {
    flex: 1;
    min-width: 0;
    white-space: normal;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: break-word;
    font-size: 0.93rem;
    font-weight: 600;
}

.docs-cat-badge {
    display: none;
}

.docs-cat-arrow {
    display: flex;
    align-items: center;
    color: #94a3b8;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.docs-nav-category.is-expanded .docs-cat-arrow {
    transform: rotate(180deg);
}

/* Subpages List */
.docs-subpages-list {
    list-style: none;
    margin: 0;
    padding: 4px 0 8px 14px;
    display: none;
}

.docs-nav-category.is-expanded .docs-subpages-list {
    display: block;
}

.docs-subpage-item {
    margin-bottom: 2px;
}

.docs-subpage-link {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 8px;
    font-size: 0.84rem;
    color: #334155;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.docs-link-text {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.docs-subpage-link:hover {
    color: #0f766e;
    background: #f8fafc;
}

.docs-link-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.docs-subpage-item.is-active .docs-subpage-link {
    color: #0f766e;
    font-weight: 600;
    background: #f0fdfa;
}

.docs-subpage-item.is-active .docs-link-dot {
    background: #0f766e;
    transform: scale(1.4);
}

/* ── Main Content Area ── */
.docs-content-area {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 36px 44px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
    min-height: 600px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* Breadcrumbs */
.docs-breadcrumbs {
    margin-bottom: 24px;
    font-size: 0.82rem;
}

.docs-breadcrumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #64748b;
}

.docs-breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: #cbd5e1;
}

.docs-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
}

.docs-breadcrumbs a:hover {
    color: #0f766e;
}

.docs-breadcrumbs li:last-child {
    color: #0f172a;
    font-weight: 600;
}

/* Article Body Typography */
.docs-article-body {
    line-height: 1.7;
    color: #334155;
    animation: docsFadeIn 0.22s ease-out;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
}

.docs-article-body * {
    max-width: 100%;
    box-sizing: border-box;
}

@keyframes docsFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.docs-article-body h2 {
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.docs-article-body h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 32px 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.docs-article-body h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 20px 0 8px 0;
}

.docs-article-body p {
    margin: 0 0 18px 0;
    font-size: 0.95rem;
}

.doc-lead {
    font-size: 1.08rem !important;
    line-height: 1.68;
    color: #475569;
    margin-bottom: 24px !important;
}

/* Callout Boxes */
.doc-callout {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 24px 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.doc-callout-info {
    background: #f0fdfa;
    border-left: 4px solid #0f766e;
    color: #134e4a;
}

.doc-callout-warning {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

/* Tables */
.doc-table-responsive {
    overflow-x: auto;
    margin: 20px 0 28px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.doc-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 700;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}

.doc-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    vertical-align: top;
}

.doc-table tr:last-child td {
    border-bottom: none;
}

.doc-table tr:hover td {
    background: #fafbfc;
}

/* Steps list */
.doc-steps {
    list-style: none;
    counter-reset: doc-step-counter;
    margin: 24px 0;
    padding: 0;
}

.doc-steps li {
    counter-increment: doc-step-counter;
    position: relative;
    padding-left: 46px;
    margin-bottom: 24px;
}

.doc-steps li::before {
    content: counter(doc-step-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0f766e;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.doc-steps h4 {
    margin: 0 0 6px 0;
}

/* Checklist */
.doc-checklist {
    list-style: none;
    margin: 18px 0;
    padding: 0;
}

.doc-checklist li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
    font-size: 0.93rem;
}

.doc-checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #0f766e;
    font-weight: 900;
    font-size: 0.95rem;
}

/* FAQ Details */
.doc-faq-group {
    margin: 20px 0;
}

.doc-faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #ffffff;
}

.doc-faq-item summary {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.92rem;
    color: #1e293b;
    cursor: pointer;
    background: #f8fafc;
}

.doc-faq-item summary:hover {
    color: #0f766e;
}

.doc-faq-item p {
    padding: 14px 18px;
    margin: 0;
    font-size: 0.9rem;
    border-top: 1px solid #f1f5f9;
}

/* Code Snippet */
.docs-article-body code {
    background: #f1f5f9;
    color: #0f766e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Documentation Content Images & Media */
.docs-article-body img,
.doc-content-img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    margin: 22px auto;
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.docs-article-body figure {
    margin: 24px 0;
    text-align: center;
}

.docs-article-body figcaption {
    font-size: 0.84rem;
    color: #64748b;
    margin-top: 8px;
}

.docs-article-body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.92rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.docs-article-body th,
.docs-article-body td {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.docs-article-body th {
    background: #f8fafc;
    font-weight: 700;
    color: #0f172a;
}

.docs-article-body tr:hover td {
    background: #f8fafc;
}

.docs-article-body ul,
.docs-article-body ol {
    margin: 16px 0 22px 24px;
    padding: 0;
    line-height: 1.7;
}

.docs-article-body li {
    margin-bottom: 8px;
}

/* Article Pagination (Prev/Next) */
.docs-article-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.docs-pager-btn {
    display: flex;
    flex-direction: column;
    padding: 12px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
    max-width: 48%;
}

.docs-pager-btn:hover:not(:disabled) {
    background: #ffffff;
    border-color: #0f766e;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.docs-pager-next {
    text-align: right;
    margin-left: auto;
}

.docs-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.docs-pager-dir {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.docs-pager-title {
    font-size: 0.88rem;
    color: #0f172a;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Right Sidebar: Table of Contents (Sticky) ── */
.docs-toc-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 90px;
    align-self: start;
    height: fit-content;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.docs-toc-sticky-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 16px 20px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

.docs-toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #0f766e;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.docs-toc-header svg {
    color: #0f766e;
    flex-shrink: 0;
}

.docs-toc-nav {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    padding-right: 4px;
}

.docs-toc-nav::-webkit-scrollbar {
    width: 4px;
}

.docs-toc-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.docs-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 2px solid #e2e8f0;
}

.docs-toc-item {
    margin: 0;
    padding: 0;
}

.docs-toc-link {
    display: block;
    padding: 7px 12px 7px 14px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
    text-decoration: none;
    border-left: 3px solid transparent;
    margin-left: -2px;
    border-radius: 0 6px 6px 0;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-toc-link:hover {
    color: #0f766e;
    background: #f8fafc;
}

/* Active State (Scrollspy / Map highlight) */
.docs-toc-link.is-active {
    color: #0f766e !important;
    font-weight: 700 !important;
    border-left: 3px solid #0f766e !important;
    background: #f0fdfa !important;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

/* ── Mobile Collapsible On This Page ── */
.docs-mobile-toc {
    display: none;
    margin-bottom: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.docs-mobile-toc-btn {
    width: 100%;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f766e;
    transition: background 0.15s ease;
}

.docs-mobile-toc-btn:hover {
    background: #f1f5f9;
}

.docs-mobile-toc-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-mobile-toc-arrow {
    transition: transform 0.2s ease;
    color: #64748b;
}

.docs-mobile-toc-btn[aria-expanded="true"] .docs-mobile-toc-arrow {
    transform: rotate(180deg);
}

.docs-mobile-toc-content {
    display: none;
    padding: 8px 16px 14px;
    border-top: 1px solid #e2e8f0;
}

.docs-mobile-toc-content.is-open {
    display: block;
    animation: docsSlideDown 0.2s ease-out;
}

.docs-mobile-toc-content .docs-toc-list {
    border-left: 2px solid #cbd5e1;
    gap: 4px;
}

.docs-mobile-toc-content .docs-toc-link {
    padding: 7px 12px;
    font-size: 0.85rem;
}

/* Hide unstyled legacy inline TOC and Back to Top inside article */
.docs-article-body .bpress-toc-wrap,
.docs-article-body .bpress-totop-wrap {
    display: none !important;
}

/* Anchor scroll margin for smooth navigation under sticky header */
.docs-article-body [id],
.docs-article-body a[name],
.bpress-anchor-link {
    scroll-margin-top: 105px;
}

/* ── Responsive Queries ── */
@media (max-width: 1200px) {
    .docs-layout {
        grid-template-columns: 260px minmax(0, 1fr) 220px;
        gap: 20px;
    }
    .docs-content-area {
        padding: 30px 32px;
    }
}

@media (max-width: 991px) {
    .docs-layout {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 20px;
    }
    .docs-toc-sidebar {
        display: none !important;
    }
    .docs-mobile-toc {
        display: block;
    }
    .docs-content-area {
        padding: 28px 24px;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    .docs-mobile-nav-bar {
        display: flex;
    }
    .docs-sidebar {
        display: none;
        position: static;
        max-height: 480px;
        margin-bottom: 24px;
    }
    .docs-sidebar.is-open {
        display: flex;
        animation: docsSlideDown 0.25s ease-out;
    }
    .docs-toc-sidebar {
        display: none !important;
    }
    .docs-mobile-toc {
        display: block;
    }
    .docs-content-area {
        padding: 22px 16px;
    }
    .docs-article-pager {
        flex-direction: column;
    }
    .docs-pager-btn {
        max-width: 100%;
        text-align: left;
    }
    .docs-pager-next {
        text-align: left;
    }
}

@keyframes docsSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
