/* Documentation Styles */

/* Fix header visibility for docs pages - ensure header is visible from start */
/* Override the index-page transparent header for docs pages */
body:has(.docs-main) .header {
    --background-color: rgba(40, 58, 90, 0.9) !important;
    --heading-color: #ffffff !important;
    --nav-color: #ffffff !important;
}

/* Fallback for browsers that don't support :has() */
.docs-page .header {
    --background-color: rgba(40, 58, 90, 0.9) !important;
    --heading-color: #ffffff !important;
    --nav-color: #ffffff !important;
}

/* Main docs layout */
.docs-main {
    padding-top: 88px;
    min-height: 100vh;
}

.docs-main .container-fluid {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Sidebar styles */
.docs-sidebar {
    background: #f8f9fa;
    min-height: calc(100vh - 88px);
    padding: 0;
    border-right: 1px solid #e9ecef;
}

.docs-sidebar-wrapper {
    position: sticky;
    top: 88px;
    height: calc(100vh - 88px);
    overflow-y: auto;
    padding: 20px 0;
}

.docs-sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.docs-sidebar-header h4 {
    color: #37517e;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Navigation styles */
.docs-nav {
    padding: 0 10px;
}

.docs-section {
    margin-bottom: 10px;
}

.docs-section-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 12px 15px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: #37517e;
    font-weight: 600;
    font-size: 14px;
}

.docs-section-toggle:hover {
    background: #e9ecef;
}

.docs-section-toggle i:first-child {
    margin-right: 8px;
    font-size: 16px;
    color: #47b2e4;
}

.docs-section-toggle .toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.docs-section-toggle .toggle-icon.rotated {
    transform: rotate(180deg);
}

/* Menu styles */
.docs-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    opacity: 0;
}

.docs-menu.expanded {
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.4s ease-in-out, opacity 0.2s ease-in-out 0.1s;
}

.docs-menu li {
    margin: 0;
}

.docs-menu a {
    display: block;
    padding: 8px 15px 8px 45px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.docs-menu a:hover {
    background: #e9ecef;
    color: #37517e;
}

.docs-menu a.active {
    background: #47b2e4;
    color: white;
}

.docs-menu a.active::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

/* Content area */
.docs-content {
    padding: 30px;
    background: white;
}

.docs-content h1 {
    color: #37517e;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #47b2e4;
}

.docs-content h2 {
    color: #37517e;
    font-size: 24px;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 15px;
}

.docs-content h3 {
    color: #37517e;
    font-size: 20px;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 12px;
}

.docs-content p {
    line-height: 1.7;
    margin-bottom: 15px;
    color: #666;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.docs-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #666;
}

/* Code blocks */
.docs-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.docs-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    color: #e83e8c;
}

.docs-content pre code {
    background: none;
    padding: 0;
    color: #333;
}

/* Alert boxes */
.docs-alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.docs-alert.info {
    background: #e7f3ff;
    border-color: #47b2e4;
    color: #0c5aa6;
}

.docs-alert.warning {
    background: #fff8e1;
    border-color: #ffc107;
    color: #8a6d00;
}

.docs-alert.success {
    background: #e8f5e8;
    border-color: #28a745;
    color: #155724;
}

.docs-alert.danger {
    background: #f8e8e8;
    border-color: #dc3545;
    color: #721c24;
}

/* Screenshots and images */
.docs-screenshot {
    max-width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.docs-screenshot-placeholder {
    max-width: 100%;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 200px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.docs-screenshot-placeholder img,
.docs-content img {
    max-width: 65%;
    height: auto !important;
    object-fit: contain;
}

.docs-screenshot-placeholder:hover {
    border-color: #47b2e4;
    background: #e7f3ff;
}

.docs-screenshot-placeholder i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 10px;
}

.docs-screenshot-placeholder p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
}

.docs-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .docs-image-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Step-by-step guides */
.docs-steps {
    counter-reset: step-counter;
}

.docs-step {
    counter-increment: step-counter;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

.docs-step::before {
    content: counter(step-counter);
    position: absolute;
    top: -10px;
    left: 20px;
    background: #47b2e4;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.docs-step h4 {
    margin-top: 10px;
    margin-bottom: 10px;
    color: #37517e;
}

/* Navigation buttons */
.docs-navigation {
    display: none;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.docs-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #47b2e4;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.docs-nav-btn:hover {
    background: #3a9bc1;
    color: white;
}

.docs-nav-btn i {
    margin: 0 5px;
}

/* Responsive design */
@media (max-width: 992px) {
    .docs-main {
        padding-top: 66px;
    }

    .docs-sidebar {
        position: fixed;
        top: 66px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 66px);
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .docs-sidebar.show {
        left: 0;
    }

    .docs-content {
        padding: 50px 15px 20px 15px !important;
    }

    .docs-sidebar-wrapper {
        top: 66px;
        height: calc(100vh - 66px);
    }
}

@media (max-width: 768px) {
    .docs-content h1 {
        font-size: 24px;
    }

    .docs-content h2 {
        font-size: 20px;
    }

    .docs-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .docs-nav-btn {
        justify-content: center;
    }
}

/* Mobile menu toggle */
.docs-mobile-toggle {
    display: none;
    position: fixed;
    top: 95px;
    left: 20px;
    z-index: 1001;
    background: #47b2e4;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    padding: 0;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
}

.docs-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.docs-mobile-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 992px) {
    .docs-mobile-toggle {
        display: block;
    }
}