/* TopRank Skills Marketplace - Documentation Page Styles */

/* Code Blocks */
.code-block {
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.code-block pre {
    margin: 0;
    background: transparent;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Inline Code */
.docs-content code {
    /* background-color: #f0f2f4; */
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.dark .docs-content code {
    background-color: #374151;
}

/* Sidebar Navigation */
.sidebar-nav a {
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark .sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* TOC Active State */
.toc-link {
    transition: all 0.2s ease;
}

.toc-link.active {
    color: #2b8cee;
    border-left-color: #2b8cee;
    font-weight: 500;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Headings with Anchor Links */
.docs-content h2,
.docs-content h3 {
    scroll-margin-top: 80px;
}

.docs-content h2:hover .heading-anchor,
.docs-content h3:hover .heading-anchor {
    opacity: 1;
}

.heading-anchor {
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
}

.heading-anchor:hover {
    color: #2b8cee;
}

/* Alert Boxes */
.alert {
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.alert-info {
    background-color: rgba(43, 140, 238, 0.05);
    border-left: 4px solid #2b8cee;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.05);
    border-left: 4px solid #f59e0b;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.05);
    border-left: 4px solid #22c55e;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.05);
    border-left: 4px solid #ef4444;
}

/* Documentation Content Spacing */
.docs-content p {
    margin-bottom: 1.5rem;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 1.5rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
}

/* Navigation Footer Cards */
.nav-footer-card {
    transition: all 0.3s ease;
}

.nav-footer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Sticky Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.sticky-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sticky-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.dark .sticky-sidebar::-webkit-scrollbar-thumb {
    background: #374151;
}

.sticky-sidebar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.dark .sticky-sidebar::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Mobile Sidebar Toggle */
@media (max-width: 1023px) {
    .mobile-sidebar-toggle {
        display: block;
    }

    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 100;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 2rem;
    }

    .dark .mobile-sidebar {
        background: #1f2937;
    }

    .mobile-sidebar.open {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Code Copy Button */
.copy-btn {
    cursor: pointer;
}

.copy-btn:hover {
    color: #fff;
}

.copy-btn.copied {
    color: #22c55e;
}

/* Prose Improvements */
.prose {
    max-width: none;
}

.prose img {
    border-radius: 0.75rem;
    margin: 2rem 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.prose table th,
.prose table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.dark .prose table th,
.dark .prose table td {
    border-color: #374151;
}

.prose table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.dark .prose table th {
    background-color: #1f2937;
}

/* Blockquote Styling */
.prose blockquote {
    border-left: 4px solid #2b8cee;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #64748b;
}

.dark .prose blockquote {
    color: #94a3b8;
}

/* Links in Content */
.docs-content a {
    color: #2b8cee;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.docs-content a:hover {
    color: #1e6dbb;
}

/* Search Highlight */
.search-highlight {
    background-color: #fef08a;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.dark .search-highlight {
    background-color: #713f12;
}

/* Print Styles */
@media print {
    aside,
    header,
    footer,
    .nav-footer-card {
        display: none !important;
    }

    main {
        max-width: 100% !important;
        padding: 0 !important;
    }

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

    .code-block {
        background-color: #f5f5f5 !important;
        color: #000 !important;
        border: 1px solid #ddd;
    }
}

/* Accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #2b8cee;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Dark Mode Transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.dark .loading-skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}
