/* ============================================
   Documentation Styles - Bootstrap 5 Theme
   ============================================ */

:root {
    --docs-sidebar-width: 280px;
    /* Must track --ms-nav-h in site.css — the docs nav uses the same component. */
    --docs-navbar-height: 68px;
    --docs-primary: var(--ms-brand-600, #4f46e5);
    --docs-sidebar-bg: var(--ms-canvas, #f7f9fc);
    --docs-border-color: var(--ms-line, #e6eaf2);
}

/* Layout */
.docs-wrapper {
    display: flex;
    padding-top: var(--docs-navbar-height);
    min-height: 100vh;
}

/* Sidebar */
.docs-sidebar {
    position: fixed;
    top: var(--docs-navbar-height);
    left: 0;
    width: var(--docs-sidebar-width);
    height: calc(100vh - var(--docs-navbar-height));
    background: var(--docs-sidebar-bg);
    border-right: 1px solid var(--docs-border-color);
    overflow-y: auto;
    z-index: 100;
}

.docs-sidebar-inner {
    padding: 1.5rem;
}

/* Sidebar Search */
.docs-search {
    margin-bottom: 1.5rem;
}

.docs-search .input-group-text {
    border-color: var(--docs-border-color);
}

.docs-search .form-control {
    border-color: var(--docs-border-color);
}

.docs-search .form-control:focus {
    border-color: var(--docs-primary);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

/* Sidebar Navigation */
.docs-nav-section {
    margin-bottom: 1.5rem;
}

.docs-nav-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.docs-nav-title i {
    font-size: 1rem;
}

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

.docs-nav-list li {
    margin-bottom: 2px;
}

.docs-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #495057;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.docs-nav-link:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--docs-primary);
}

.docs-nav-link.active {
    background: var(--docs-primary);
    color: #fff;
    font-weight: 500;
}

.docs-nav-home {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main Content */
.docs-content {
    flex: 1;
    margin-left: var(--docs-sidebar-width);
    padding: 2rem 3rem;
    max-width: 900px;
}

/* Breadcrumb */
.docs-breadcrumb {
    margin-bottom: 1rem;
}

.docs-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.docs-breadcrumb .breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.docs-breadcrumb .breadcrumb-item a:hover {
    color: var(--docs-primary);
}

/* Page Actions */
.docs-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

/* Article */
.docs-article {
    line-height: 1.7;
}

.docs-article h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #212529;
}

.docs-article h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--docs-border-color);
    color: #212529;
}

.docs-article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #212529;
}

.docs-article h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.docs-article p {
    margin-bottom: 1rem;
    color: #495057;
}

.docs-article ul,
.docs-article ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-article li {
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Cards Grid */
.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.docs-card {
    display: block;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--docs-border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.docs-card:hover {
    border-color: var(--docs-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.docs-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.1);
    color: var(--docs-primary);
    border-radius: 0.5rem;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.docs-card-icon.success {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.docs-card-icon.info {
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.docs-card-icon.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.docs-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.docs-card-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

/* Callouts / Notes */
.docs-note {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.docs-note-info {
    background: rgba(13, 202, 240, 0.1);
    border-color: #0dcaf0;
}

.docs-note-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

.docs-note-danger {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

.docs-note-success {
    background: rgba(25, 135, 84, 0.1);
    border-color: #198754;
}

.docs-note-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.docs-note p:last-child {
    margin-bottom: 0;
}

/* Steps */
.docs-steps {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.docs-step {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid var(--docs-border-color);
    margin-left: 1rem;
}

.docs-step:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.docs-step::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: -1rem;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--docs-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.docs-step-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.docs-step-content {
    color: #495057;
}

/* Tables */
.docs-article table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.docs-article th,
.docs-article td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--docs-border-color);
    text-align: left;
}

.docs-article th {
    background: var(--docs-sidebar-bg);
    font-weight: 600;
    color: #212529;
}

.docs-article td {
    color: #495057;
}

/* Code */
.docs-article code {
    padding: 0.2rem 0.4rem;
    background: #f1f3f5;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #d63384;
}

.docs-article pre {
    background: #212529;
    color: #f8f9fa;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.docs-article pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Footer Navigation */
.docs-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--docs-border-color);
}

.docs-footer-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.docs-footer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--docs-sidebar-bg);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 45%;
}

.docs-footer-link:hover {
    background: rgba(79, 70, 229, 0.1);
}

.docs-footer-prev {
    justify-content: flex-start;
}

.docs-footer-next {
    justify-content: flex-end;
    margin-left: auto;
}

.docs-footer-link i {
    font-size: 1.25rem;
    color: var(--docs-primary);
}

.docs-footer-link span {
    display: flex;
    flex-direction: column;
}

.docs-footer-link small {
    font-size: 0.75rem;
    color: #6c757d;
}

.docs-footer-link strong {
    color: #212529;
    font-weight: 500;
}

/* Feedback */
.docs-feedback {
    text-align: center;
    padding: 1.5rem;
    background: var(--docs-sidebar-bg);
    border-radius: 0.5rem;
}

/* Mobile Sidebar Toggle */
.docs-sidebar-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--docs-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

/* Responsive */
@media (max-width: 991.98px) {
    .docs-sidebar {
        display: none;
    }

    .docs-content {
        margin-left: 0;
        padding: 1.5rem;
        max-width: 100%;
    }

    .docs-footer-nav {
        flex-direction: column;
    }

    .docs-footer-link {
        max-width: 100%;
    }
}

@media (min-width: 992px) {
    .docs-sidebar-toggle {
        display: none;
    }
}

/* ============================================
   Media Components - Screenshots, GIFs, Videos
   ============================================ */

/* Screenshot Component */
.docs-screenshot {
    margin: 1.5rem 0;
    padding: 0;
}

.docs-screenshot img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--docs-border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.docs-screenshot img:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.docs-screenshot figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

/* GIF Component */
.docs-gif {
    margin: 1.5rem 0;
    padding: 0;
    position: relative;
}

.docs-gif img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--docs-border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.docs-gif::before {
    content: "GIF";
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 1;
}

.docs-gif figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

/* Video Embed Component */
.docs-video {
    margin: 1.5rem 0;
}

.docs-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #000;
}

.docs-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.docs-video-caption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
}

.docs-video-caption i {
    margin-right: 0.5rem;
    color: #dc3545;
}

/* Image Gallery - Step by Step */
.docs-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

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

.docs-gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--docs-border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.docs-gallery-item img:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.docs-gallery-item figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #495057;
    text-align: center;
    font-weight: 500;
}

/* Lightbox Modal */
.docs-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.docs-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.docs-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.docs-lightbox.active img {
    transform: scale(1);
}

.docs-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.docs-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.docs-lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    max-width: 80%;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

/* Media within Steps */
.docs-step .docs-screenshot,
.docs-step .docs-gif {
    margin: 1rem 0 0.5rem 0;
}

.docs-step .docs-screenshot img,
.docs-step .docs-gif img {
    max-width: 100%;
}

/* Responsive Media */
@media (max-width: 767.98px) {
    .docs-gallery {
        grid-template-columns: 1fr;
    }

    .docs-lightbox img {
        max-width: 95%;
    }

    .docs-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

/* Print Styles */
@media print {
    .docs-sidebar,
    .docs-sidebar-toggle,
    .docs-actions,
    .docs-feedback,
    .docs-footer-nav,
    .navbar {
        display: none !important;
    }

    .docs-wrapper {
        padding-top: 0;
    }

    .docs-content {
        margin-left: 0;
        padding: 0;
        max-width: 100%;
    }

    .docs-article {
        font-size: 12pt;
    }

    .docs-article h1 {
        font-size: 18pt;
    }

    .docs-article h2 {
        font-size: 14pt;
    }

    .docs-article h3 {
        font-size: 12pt;
    }
}

/* ============================================
   Quick Start Banner & Styles
   ============================================ */

.docs-quickstart-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
}

.docs-quickstart-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.docs-quickstart-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.docs-quickstart-text {
    flex: 1;
    min-width: 200px;
}

.docs-quickstart-text h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.docs-quickstart-text p {
    margin-bottom: 0;
    opacity: 0.9;
}

.docs-quickstart-banner .btn-light {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .docs-quickstart-content {
        flex-direction: column;
        text-align: center;
    }

    .docs-quickstart-banner .btn-light {
        width: 100%;
    }
}

/* Quick Start Sidebar Link */
.docs-nav-quickstart {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
    padding: 0.75rem 1rem !important;
    margin-bottom: 0.5rem;
}

.docs-nav-quickstart:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.docs-nav-quickstart.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
}

.docs-nav-quickstart.active strong {
    color: white;
}
