/* --- FILE: /public/css/docs.css --- */

/* Inherit base styles from marketing, but override body for docs layout */
body.docs-body {
    padding-top: var(--header-height); /* Keep content below fixed header */
    display: block; /* Override default flex from app.css if it ever gets loaded by mistake */
}

.docs-container {
    max-width: 1400px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 280px 1fr; /* Sidebar width | Content width */
    gap: 2.5rem;
    padding: 0 2rem;
}

/* --- Sidebar Navigation --- */
.docs-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem); /* Sticks below the header */
    height: calc(100vh - var(--header-height) - 4rem);
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
    padding-right: 1.5rem;
}

.docs-nav-category {
    margin-bottom: 1.5rem;
}

.docs-nav-category h3 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

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

.docs-nav-category a {
    display: block;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.docs-nav-category a:hover {
    background-color: #eaf2ff;
    color: var(--primary-color);
}

.docs-nav-category a.active {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 500;
}


/* --- Main Content Area --- */
.docs-content {
    background-color: #ffffff;
    padding: 2rem 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.docs-content h1, .docs-content h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-top: 0;
}

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

.docs-content h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
}

.docs-content p, .docs-content li {
    line-height: 1.7;
    font-size: 1.05rem;
}

.docs-content code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.docs-content pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
}

/* --- Search Bar & Results --- */
.docs-search-container {
    position: relative;
    margin-bottom: 2rem;
}

#docs-search-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    box-sizing: border-box;
}

#docs-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#docs-search-results li a {
    display: block;
    padding: 0.6rem 1rem;
    color: #333;
    text-decoration: none;
}

#docs-search-results li a:hover {
    background-color: #eaf2ff;
}

/* --- Documentation Images & Screenshots --- */
.doc-image-container {
    margin: 2rem 0;
    text-align: center;
}

.doc-screenshot {
    max-width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-screenshot.zoomable {
    cursor: zoom-in;
}

.doc-screenshot.zoomable:hover {
    transform: scale(1.01);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Mobile frames look like a phone */
.doc-screenshot.mobile-view {
    max-width: 375px; /* Standard mobile width */
    border-width: 8px 4px; /* Simulates bezels */
    border-color: #333;
    border-radius: 20px;
}

.doc-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
}

/* --- Image Modal (Lightbox) --- */
.doc-image-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    padding-top: 50px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

.doc-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
    animation-name: zoom;
    animation-duration: 0.3s;
}

#doc-modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 50px;
}

.doc-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.doc-modal-close:hover,
.doc-modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

/* Responsive Modal */
@media only screen and (max-width: 700px){
    .doc-modal-content {
        width: 100%;
    }
}