:root {
    --primary: #1a3a5c;
    --accent: #2a82c9;
    --green: #28a745;
    --red: #dc3545;
    --light-bg: #f4f7fb;
    --border: #d0dce8;
}

#manual-root * { box-sizing: border-box; }
div#manual-root { 
    font-family: 'Segoe UI', Arial, sans-serif; 
    background: #f4f7fb; 
    color: #222; 
    line-height: 1.7; 
}

/* ── HEADER ── */
#manual-root .doc-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: var(--primary); color: #fff;
    height: 64px; display: flex; flex-direction: row; align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
#mobile-menu-toggle {
    display: none; background: transparent; border: none; color: #fff;
    font-size: 24px; cursor: pointer; padding: 0 15px;
}
.header-logo-zone {
    width: 280px; min-width: 280px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 18px; border-right: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}
.header-logo-zone img { max-height: 42px; width: auto; display: block; }
.header-center {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; overflow: hidden;
}
.header-center h1 { font-size: 18px; margin: 0; font-weight: 600; white-space: nowrap; color:#fff; padding:0;}
.header-center p { font-size: 12px; margin: 0; opacity: 0.85; white-space: nowrap; color:#fff; padding:0;}
.header-actions {
    display: flex; gap: 10px; padding: 0 15px; flex-shrink: 0;
}
.btn-pdf, .btn-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 4px; font-size: 13px; font-weight: 500;
    text-decoration: none; transition: 0.2s; border: none; cursor: pointer;
}
.btn-pdf { background: #fff; color: var(--primary); }
.btn-pdf:hover { background: #f0f0f0; }
.btn-back { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.3) !important;}
.btn-back:hover { background: rgba(255,255,255,0.2); }

/* ── SIDEBAR ── */
#manual-root .sidebar {
    position: fixed;
    top: 64px; bottom: 40px; left: 0;
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 15px;
    z-index: 990;
    transition: transform 0.3s ease;
}
.sidebar h3 { font-size: 16px; margin: 0 0 15px 0; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li.sidebar-chap > a {
    display: block; padding: 8px 10px; color: #333; text-decoration: none;
    font-weight: 600; border-radius: 4px; border-left: 3px solid transparent;
}
.sidebar li.sidebar-chap > a:hover { background: var(--light-bg); border-left-color: var(--accent); color: var(--accent); }
ul.sidebar-sub { padding-left: 15px; margin-top: 5px; margin-bottom: 10px; border-left: 1px solid var(--border); margin-left: 14px; }
ul.sidebar-sub li a {
    display: block; padding: 5px 10px; color: #555; text-decoration: none; font-size: 13px; border-radius: 4px;
}
ul.sidebar-sub li a:hover { background: var(--light-bg); color: var(--accent); }

/* ── CONTENT ── */
#manual-root .wrapper { display: flex; }
#main-content {
    margin-top: 64px; margin-bottom: 40px; margin-left: 280px;
    padding: 40px; width: 100%; max-width: calc(100% - 280px);
    background: #fff; min-height: calc(100vh - 104px);
    box-shadow: -1px 0 10px rgba(0,0,0,0.02);
}
.doc-section { margin-bottom: 60px; padding-bottom: 30px; border-bottom: 1px solid var(--border); }
.chapter { font-size: 28px; color: var(--primary); border-bottom: 3px solid var(--primary); padding-bottom: 10px; margin-bottom: 25px; margin-top: 0;}
.subsection { font-size: 20px; color: var(--accent); margin-top: 30px; margin-bottom: 15px; }

/* ── FOOTER ── */
.doc-footer {
    position: fixed; bottom: 0; left: 0; right: 0; height: 40px;
    background: #fff; border-top: 1px solid var(--border); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.footer-content { display: flex; gap: 20px; font-size: 13px; color: #666; }

/* ── TOC PAGE ── */
.toc-page { background: #f8fcfd; border: 1px solid var(--accent); padding: 30px; border-radius: 8px; margin-bottom: 50px; }
.toc-page h2 { color: var(--primary); margin-top: 0; border-bottom: 2px solid var(--accent); padding-bottom: 10px; }
.toc-page > ol { font-size: 16px; font-weight: 600; padding-left: 20px; margin-top: 20px;}
.toc-page > ol > li { margin-bottom: 15px; }
.toc-page > ol > li > a { color: var(--primary); text-decoration: none; }
.toc-page > ol > li > a:hover { text-decoration: underline; }
.page-subtoc { font-size: 14px; font-weight: normal; margin-top: 5px; list-style: circle; padding-left: 20px; }
.page-subtoc li { margin-bottom: 5px; }
.page-subtoc li a { color: #555; text-decoration: none; }
.page-subtoc li a:hover { color: var(--accent); text-decoration: underline; }

/* ── ELEMENTE GENERALE CSS PENTRU ARTICOLE ── */
.info-box, .warn-box, .tip-box {
    padding: 16px 20px; border-radius: 6px; margin: 20px 0;
    border-left: 5px solid; box-shadow: 0 1px 3px rgba(0,0,0,0.05); font-size: 15px;
}
.info-box { background: #e3f2fd; border-left-color: #2a82c9; color: #0c5460; }
.warn-box { background: #fee2e2; border-left-color: #dc3545; color: #721c24; }
.tip-box  { background: #fff3cd; border-left-color: #ffc107; color: #856404; }

.badge { display: inline-block; padding: 4px 8px; font-size: 12px; font-weight: 600; border-radius: 4px; text-transform: uppercase; }
.badge-green { background: #d4edda; color: #155724; }
.badge-red { background: #f8d7da; color: #721c24; }
.badge-blue { background: #cce5ff; color: #004085; }

/* PASI (Line wrapping fixed) */
.steps-list {
    counter-reset: steps; list-style: none;
    padding-left: 0 !important; margin-left: 0 !important;
}
.step {
    counter-increment: steps; position: relative;
    padding-left: 45px !important; margin: 16px 0;
    min-height: 32px; font-size: 15.5px;
}
.step span, .step strong, .step p { display: inline; }
.step::before {
    content: counter(steps); position: absolute;
    left: 0; top: -2px; width: 28px; height: 28px;
    background-color: var(--accent); color: #ffffff;
    border-radius: 50%; text-align: center; font-size: 14px;
    line-height: 28px; font-weight: bold; display: block;
}

#manual-root img { max-width: 100%; height: auto; display: block; margin: 15px 0; }

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 768px) {
    #mobile-menu-toggle { display: block; padding-right:5px;}
    .header-logo-zone { width: auto; min-width: auto; border: none; padding-left: 5px; flex-shrink:1;}
    .header-logo-zone img { max-height: 32px; }
    .header-center { display: none; } /* Hide titles on small screens to save space */
    .header-actions span { display: none; } /* Hide button texts */
    
    #manual-root .sidebar {
        transform: translateX(-100%);
        width: 100%; max-width: 100%;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        border-right: none;
    }
    #manual-root .sidebar.open {
        transform: translateX(0) !important;
    }
    
    #main-content {
        margin-left: 0; width: 100%; max-width: 100%;
        padding: 20px 15px; margin-bottom: 50px;
    }
    .doc-footer {
        flex-direction: column; height: auto; padding: 10px; center;
    }
}
/* Anchor offsets */
[id^="sec-"], [id^="sub-"] {
    scroll-margin-top: 80px;
}

/* Active Sidebar State */
.sidebar li > a.active {
    background: var(--light-bg);
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
}
ul.sidebar-sub li a.active {
    background: var(--light-bg);
    color: var(--accent);
    font-weight: 700;
}

/* Back to Top Button */



/* HIDE ANY THEME ARROWS GLOBALLY OR SPECIFIC (like .ct-back-to-top) */
.ct-back-to-top, .ast-scroll-top, #ast-scroll-top, .scroll-to-top, #scroll-to-top, #scroll-up, .scrollToTop, .back-to-top, #back-to-top, #return-to-top, .return-to-top {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* OUR CUSTOM ARROW */
#digidocs-btt {
    position: fixed;
    bottom: 60px; /* definitely above our footer */
    right: 20px;
    background: var(--accent);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 999999 !important; /* Force top */
    display: none;
    transition: background 0.3s;
}
#digidocs-btt:hover {
    background: var(--primary);
}

/* Force mobile menu overlay to actually work */
@media (max-width: 768px) {
    #manual-root .sidebar {
        transform: translateX(-100%);
        width: 100% !important;
        max-width: 100% !important;
        background: #ffffff !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        border-right: none;
    }
    #manual-root .sidebar.open {
        transform: translateX(0) !important;
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 64px) !important;
        z-index: 9999999 !important;
        background: #ffffff !important;
    }
}
