/* ============================================
   Documentation Layout Styles for /anleitung/
   ============================================ */

:root {
    --docs-sidebar-width: 260px;
    --docs-orange: #F38310;
    --docs-orange-light: #ff9933;
    --docs-bg: #ffffff;
    --docs-sidebar-bg: #f8f9fa;
    --docs-text: #333333;
    --docs-text-light: #666666;
    --docs-border: #e1e4e8;
    --docs-hover-bg: #f0f0f0;
    --docs-active-bg: #fff4ed;
}

* {
    box-sizing: border-box;
}

.docs-layout {
    display: grid;
    grid-template-columns: var(--docs-sidebar-width) 1fr;
    min-height: calc(100vh - 80px); /* Adjust based on header height */
}

/* ============================================
   Sidebar Styles
   ============================================ */

.docs-sidebar {
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    background: var(--docs-sidebar-bg);
    border-right: 1px solid var(--docs-border);
    padding: 2rem 0;
}

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

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

.docs-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

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

.docs-nav li {
    margin: 0;
}

.docs-nav a {
    display: block;
    padding: 0.5rem 1.5rem 0.5rem 2rem;
    color: var(--docs-text);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.docs-nav a:hover {
    background: var(--docs-hover-bg);
    color: var(--docs-orange);
    border-left-color: var(--docs-orange-light);
}


.docs-nav a.active {
    background: var(--docs-active-bg);
    color: var(--docs-orange);
    border-left-color: var(--docs-orange);
    font-weight: 600;
}

/* Navigation Categories */
.docs-nav-category {
    padding: 1.25rem 1.5rem 0.5rem;
    color: var(--docs-text);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
}

.docs-nav-category:first-child {
    margin-top: 0;
}

/* Overview Section Spacing */
.docs-overview-section {
    padding: 1rem 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.docs-overview-section:first-of-type {
    margin-top: 2rem;
}

/* FAQ Items */
.faq-item {
    border-left: 3px solid var(--docs-border);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: 0 8px 8px 0;
    background: var(--docs-sidebar-bg);
    transition: border-color 0.2s ease;
}

.faq-item:hover {
    border-left-color: var(--docs-orange);
}

.faq-item h3 {
    font-size: 1.1rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    color: var(--docs-text) !important;
}

/* Mobile Toggle Button */
.docs-sidebar-toggle {
    display: none;
    position: fixed;
    top: 90px;
    left: 1rem;
    z-index: 1000;
    background: var(--docs-orange);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(243, 131, 16, 0.3);
    transition: all 0.2s ease;
}

.docs-sidebar-toggle:hover {
    background: var(--docs-orange-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 131, 16, 0.4);
}

.docs-sidebar-toggle:focus {
    outline: 2px solid var(--docs-orange);
    outline-offset: 2px;
}

.docs-sidebar-toggle:active {
    transform: translateY(0);
}

/* ============================================
   Content Area Styles
   ============================================ */

.docs-content {
    padding: 2rem 3rem;
    max-width: 900px;
    background: var(--docs-bg);
}

.docs-content h1 {
    font-size: 2.5rem;
    color: var(--docs-text);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.docs-content .lead {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--docs-text-light);
    margin-bottom: 2.5rem;
    margin-top: 0.5rem;
}

.docs-content h2 {
    font-size: 1.875rem;
    color: var(--docs-text);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--docs-border);
}

.docs-content h3 {
    font-size: 1.5rem;
    color: var(--docs-text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.docs-content h4 {
    font-size: 1.25rem;
    color: var(--docs-text);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.docs-content p {
    line-height: 1.7;
    margin-bottom: 1.25rem;
    color: var(--docs-text);
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.docs-content li {
    line-height: 1.7;
    margin-bottom: 0.5rem;
    color: var(--docs-text);
}

.docs-content a {
    color: var(--docs-orange);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.docs-content a:hover {
    border-bottom-color: var(--docs-orange);
}

.docs-content code {
    background: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Courier New', Courier, monospace;
}

.docs-content pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.docs-content pre code {
    background: none;
    padding: 0;
}

.docs-content blockquote {
    border-left: 4px solid var(--docs-orange);
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1.25rem;
    color: var(--docs-text-light);
    font-style: italic;
}

.docs-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

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

.docs-content th {
    background: var(--docs-sidebar-bg);
    font-weight: 600;
    color: var(--docs-text);
}

/* Callout Boxes */
.docs-callout {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.docs-callout.info {
    background: #e7f3ff;
    border-left-color: #2196F3;
}

.docs-callout.warning {
    background: #fff4e5;
    border-left-color: var(--docs-orange);
}

.docs-callout.success {
    background: #e8f5e9;
    border-left-color: #4CAF50;
}

.docs-callout.danger {
    background: #ffebee;
    border-left-color: #f44336;
}

/* ============================================
   Mobile Responsive (<900px)
   ============================================ */

@media (max-width: 899px) {
    .docs-layout {
        grid-template-columns: 1fr;
        margin-top: 70px;
    }

    .docs-sidebar-toggle {
        display: block;
    }

    .docs-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        box-shadow: none;
        padding-top: 5rem;
    }

    .docs-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }

    .docs-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .docs-sidebar-overlay.active {
        display: block;
    }

    .docs-content {
        padding: 1.5rem 1.25rem;
        padding-top: 4rem;
    }

    .docs-content h1 {
        font-size: 2rem;
    }

    .docs-content h2 {
        font-size: 1.5rem;
    }

    .docs-content h3 {
        font-size: 1.25rem;
    }
}

/* ============================================
   Tablet (600px - 899px)
   ============================================ */

@media (min-width: 600px) and (max-width: 899px) {
    .docs-content {
        padding: 2rem 2rem;
        padding-top: 4.5rem;
    }
}

/* ============================================
   Screenshot Styling
   ============================================ */

.docs-screenshot {
    margin: 2rem 0;
    text-align: center;
}

.docs-screenshot img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--docs-border);
}

.docs-screenshot figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--docs-text-light);
    font-style: italic;
}

/* ============================================
   Table of Contents (On This Page)
   ============================================ */

.docs-toc {
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.docs-toc h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
    color: var(--docs-text);
}

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

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

.docs-toc a {
    display: block;
    padding: 0.5rem 0;
    color: var(--docs-text);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.docs-toc a:hover {
    color: var(--docs-orange);
    padding-left: 0.5rem;
    border-bottom: none;
}

/* ============================================
   Pagination (Previous/Next Navigation)
   ============================================ */

.docs-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--docs-border);
}

.docs-pagination a {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--docs-bg);
}

.docs-pagination a:hover {
    background: var(--docs-sidebar-bg);
    border-color: var(--docs-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.docs-pagination-prev {
    text-align: left;
}

.docs-pagination-next {
    text-align: right;
}

.pagination-label {
    font-size: 0.85rem;
    color: var(--docs-text-light);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.pagination-title {
    font-size: 1.05rem;
    color: var(--docs-text);
    font-weight: 600;
}

.docs-pagination a:hover .pagination-title {
    color: var(--docs-orange);
}

/* ============================================
   Responsive Adjustments for New Components
   ============================================ */

@media (max-width: 600px) {
    .docs-screenshot img {
        border-radius: 8px;
    }

    .docs-pagination {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .docs-pagination-next {
        text-align: left;
    }

    .docs-toc {
        padding: 1rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .docs-sidebar,
    .docs-sidebar-toggle,
    .docs-pagination,
    .docs-toc {
        display: none;
    }

    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-content {
        max-width: 100%;
    }

    .docs-screenshot img {
        max-width: 80%;
        page-break-inside: avoid;
    }
}
