/* ============================================
   Manual Documentation Styles
   Professional, modern design for clinicians
   Source: parodontalstatus/api/css/documentation.css
   ============================================ */

/* ============================================
   1. Base Styles & Reset
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-color: #17669D;
    --secondary-color: #2196F3;
    --accent-color: #4CAF50;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --bg-code: #2d2d2d;
    --bg-code-light: #f5f5f5;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
    --font-size-base: 16px;
    --line-height: 1.6;

    /* Additional for Manual */
    --placeholder-bg: #e9ecef;
    --placeholder-text: #adb5bd;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-color);
    background: #fff;
}

/* ============================================
   2. Header
   ============================================ */
.doc-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1976D2 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.doc-header .doc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.doc-logo {
    margin-bottom: var(--spacing-md);
    color: white;
}

.doc-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.doc-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ============================================
   3. Layout
   ============================================ */
.doc-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.doc-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* ============================================
   4. Sidebar & Table of Contents
   ============================================ */
.doc-sidebar {
    position: sticky;
    top: var(--spacing-lg);
    height: fit-content;
}

.doc-toc {
    background: var(--bg-light);
    border-radius: 8px;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.doc-toc h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
    font-weight: 600;
}

.doc-toc ul {
    list-style: none;
}

.doc-toc li {
    margin-bottom: var(--spacing-xs);
}

.doc-toc a {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.doc-toc a:hover {
    background: white;
    color: var(--primary-color);
    transform: translateX(4px);
}

.doc-toc a.active {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

/* Nested TOC items (H3) */
.doc-toc ul ul {
    list-style: none;
    margin-left: var(--spacing-sm);
    margin-top: 4px;
    margin-bottom: 8px;
    border-left: 1px solid var(--border-color);
}

.doc-toc ul ul li {
    margin-bottom: 0;
}

.doc-toc ul ul a {
    font-size: 0.85rem;
    padding: 3px var(--spacing-md);
    color: var(--text-light);
    opacity: 0.85;
}

.doc-toc ul ul a:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateX(2px);
    opacity: 1;
}

.doc-toc ul ul a.active {
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    opacity: 1;
}

/* ============================================
   5. Main Content
   ============================================ */
.doc-content {
    min-width: 0;
}

.doc-section {
    margin-bottom: var(--spacing-xl);
    scroll-margin-top: var(--spacing-lg);
}

.doc-section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--primary-color);
}

.doc-section h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.doc-section h4 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.doc-section p {
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
}

.doc-section ul,
.doc-section ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

.doc-section li {
    margin-bottom: var(--spacing-xs);
}

/* ============================================
   6. Code Blocks
   ============================================ */
.code-block {
    position: relative;
    margin: var(--spacing-md) 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.code-block pre {
    margin: 0;
    padding: var(--spacing-md);
    background: var(--bg-code);
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    color: #f8f8f2;
}

.copy-btn {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    z-index: 10;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.inline-code {
    background: var(--bg-code-light);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: #c7254e;
    border: 1px solid #e1e1e8;
}

/* ============================================
   7. Image Placeholders (Manual Specific)
   ============================================ */
.img-placeholder {
    width: 100%;
    height: 400px;
    background-color: var(--placeholder-bg);
    border: 2px dashed var(--placeholder-text);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--spacing-md) 0;
    color: var(--placeholder-text);
    font-style: italic;
    position: relative;
    overflow: hidden;
}

.img-placeholder::after {
    content: '';
}

.manual-figure {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: var(--spacing-md) 0;
    display: block;
    background-color: #fff;
    padding: 10px;
}

/* ============================================
   8. Alerts
   ============================================ */
.alert {
    padding: var(--spacing-md);
    border-radius: 6px;
    margin: var(--spacing-md) 0;
    border-left: 4px solid;
}

.alert-info {
    background: #e3f2fd;
    border-color: #2196F3;
    color: #0d47a1;
}

.alert-warning {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.alert strong {
    font-weight: 600;
}

/* ============================================
   9. Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .doc-layout {
        grid-template-columns: 1fr;
    }

    .doc-sidebar {
        position: static;
        margin-bottom: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .doc-header h1 {
        font-size: 2rem;
    }

    .doc-section h2 {
        font-size: 1.5rem;
    }

    .img-placeholder {
        height: 250px;
    }
    
    .code-block pre {
        font-size: 0.8rem;
    }
}

/* ============================================
   12. Footer
   ============================================ */
.doc-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
}

.doc-footer p {
    margin-bottom: var(--spacing-xs);
}

.doc-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.doc-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   9. Print Styles
   ============================================ */
@media print {
    .doc-sidebar,
    .copy-btn {
        display: none;
    }

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

    .doc-section {
        page-break-inside: avoid;
    }
}
