/* ============================================================
   HELP DOCUMENTATION — DEDICATED STYLESHEET
   CustomerPortal_Laravel — Saurashtra Freight Pvt. Ltd.
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --portal-primary-color: #1677f2;
    --help-sidebar-w: 280px;
    --help-accent: var(--portal-primary-color, #1677f2);
    --help-accent-hover: #0c5bc9;
    --help-secondary: #ff8f3d;
    --help-bg: #f4f7fb;
    --help-sidebar-bg: #ffffff;
    --help-content-bg: #ffffff;
    --help-border: rgba(91, 111, 138, 0.18);
    --help-text: #20314e;
    --help-text-muted: #607089;
    --help-heading: #0f1f39;
    --help-code-bg: #edf4fb;
    --help-tree-hover: #eef6ff;
    --help-tree-active: #d0e4ff;
    --help-tree-active-text: #0c5bc9;
    --help-screenshot-bg: #f0f4f8;
    --help-screenshot-border: #d0d7e2;
    --help-badge-bg: #eef6ff;
    --help-badge-text: #1677f2;
    --help-shadow: 0 4px 18px rgba(15, 30, 60, 0.06);
    --help-shadow-md: 0 10px 30px rgba(15, 30, 60, 0.09);
    --help-radius: 12px;
    --help-radius-sm: 8px;
    --help-transition: .2s ease;
}

/* Dark mode overrides */
body.dark-mode,
.dark-mode {
    --help-bg: #0f172a;
    --help-sidebar-bg: #1e293b;
    --help-content-bg: #1e293b;
    --help-border: rgba(255, 255, 255, 0.12);
    --help-text: #cbd5e1;
    --help-text-muted: #94a3b8;
    --help-heading: #f8fafc;
    --help-code-bg: #0f172a;
    --help-tree-hover: rgba(22, 119, 242, 0.15);
    --help-tree-active: rgba(22, 119, 242, 0.28);
    --help-tree-active-text: #60a5fa;
    --help-screenshot-bg: #0f172a;
    --help-screenshot-border: #334155;
    --help-badge-bg: rgba(22, 119, 242, 0.2);
    --help-badge-text: #60a5fa;
    --help-shadow: 0 4px 18px rgba(0, 0, 0, .3);
    --help-shadow-md: 0 10px 30px rgba(0, 0, 0, .4);
}

/* ---------- Shell Layout ---------- */
.help-doc-shell {
    display: flex;
    min-height: calc(100vh - 57px);
    background: var(--help-bg);
}

/* ---------- Sidebar ---------- */
.help-doc-sidebar {
    position: sticky;
    top: 57px;
    align-self: flex-start;
    width: var(--help-sidebar-w);
    min-width: var(--help-sidebar-w);
    height: calc(100vh - 57px);
    max-height: calc(100vh - 57px);
    overflow-y: auto;
    background: var(--help-sidebar-bg);
    border-right: 1px solid var(--help-border);
    padding: 0;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: var(--help-border) transparent;
    transition: transform var(--help-transition);
}

.help-doc-sidebar::-webkit-scrollbar {
    width: 5px;
}

.help-doc-sidebar::-webkit-scrollbar-thumb {
    background: var(--help-border);
    border-radius: 10px;
}

/* Sidebar Header */
.help-doc-sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid var(--help-border);
    background: var(--help-sidebar-bg);
}

.help-doc-sidebar-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: .98rem;
    color: var(--help-heading);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-doc-sidebar-title i {
    color: var(--help-accent);
    font-size: 1.1rem;
}

/* Search */
.help-doc-search {
    position: relative;
}

.help-doc-search input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid var(--help-border);
    border-radius: var(--help-radius-sm);
    font-size: .84rem;
    font-family: 'Inter', sans-serif;
    color: var(--help-text);
    background: var(--help-bg);
    transition: border-color var(--help-transition), box-shadow var(--help-transition);
    outline: none;
}

.help-doc-search input:focus {
    border-color: var(--help-accent);
    box-shadow: 0 0 0 3px rgba(22, 119, 242, .15);
}

.help-doc-search input::placeholder {
    color: var(--help-text-muted);
}

.help-doc-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--help-text-muted);
    font-size: .8rem;
    pointer-events: none;
}

/* Sidebar Tree */
.help-doc-tree {
    list-style: none;
    margin: 0;
    padding: 10px 8px 30px;
}

.help-doc-tree-label {
    font-size: .70rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--help-text-muted);
    padding: 14px 12px 6px;
    user-select: none;
}

.help-doc-tree-item {
    margin-bottom: 2px;
}

.help-doc-tree-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--help-radius-sm);
    font-size: .85rem;
    font-weight: 500;
    color: var(--help-text);
    text-decoration: none !important;
    transition: background var(--help-transition), color var(--help-transition);
    cursor: pointer;
    user-select: none;
}

.help-doc-tree-link:hover {
    background: var(--help-tree-hover);
    color: var(--help-accent);
}

.help-doc-tree-link.active {
    background: var(--help-tree-active);
    color: var(--help-tree-active-text);
    font-weight: 700;
}

.help-doc-tree-link .tree-icon {
    font-size: .9rem;
    width: 18px;
    text-align: center;
    color: var(--help-accent);
    flex-shrink: 0;
}

.help-doc-tree-link.active .tree-icon {
    color: var(--help-tree-active-text);
}

.help-doc-tree-toggle {
    margin-left: auto;
    font-size: .75rem;
    color: var(--help-text-muted);
    transition: transform var(--help-transition);
}

.help-doc-tree-item.open>.help-doc-tree-link .help-doc-tree-toggle {
    transform: rotate(90deg);
}

/* Subtree */
.help-doc-subtree {
    list-style: none;
    margin: 2px 0 4px 16px;
    padding: 0 0 0 8px;
    border-left: 2px solid var(--help-border);
    display: none;
}

.help-doc-tree-item.open>.help-doc-subtree {
    display: block;
}

.help-doc-subtree .help-doc-tree-link {
    font-size: .81rem;
    padding: 6px 10px;
}

/* ---------- Content Area ---------- */
.help-doc-content {
    flex: 1;
    min-width: 0;
    padding: 30px 40px 60px;
    background: var(--help-content-bg);
}

.help-doc-breadcrumb {
    font-size: .82rem;
    color: var(--help-text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-doc-breadcrumb a {
    color: var(--help-accent);
    text-decoration: none;
}

.help-doc-breadcrumb a:hover {
    text-decoration: underline;
}

/* TOC Box */
.help-doc-toc {
    background: var(--help-bg);
    border: 1px solid var(--help-border);
    border-radius: var(--help-radius);
    padding: 24px;
    margin-bottom: 36px;
    box-shadow: var(--help-shadow);
}

.help-doc-toc h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--help-heading);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-doc-toc h3 i {
    color: var(--help-accent);
}

.help-doc-toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px 18px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-doc-toc-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .86rem;
    color: var(--help-text);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--help-radius-sm);
    transition: background var(--help-transition), color var(--help-transition);
}

.help-doc-toc-list a:hover {
    background: var(--help-tree-hover);
    color: var(--help-accent);
}

.help-doc-toc-list a i {
    font-size: .7rem;
    color: var(--help-accent);
}

/* Sections */
.help-doc-section {
    padding-top: 24px;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--help-border);
    padding-bottom: 40px;
}

.help-doc-section:last-child {
    border-bottom: none;
}

.help-doc-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.help-doc-section-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--help-radius-sm);
    background: var(--help-badge-bg);
    color: var(--help-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.help-doc-section-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--help-heading);
    margin: 0;
    letter-spacing: -.02em;
}

.help-doc-section-desc {
    font-size: .93rem;
    line-height: 1.7;
    color: var(--help-text);
    margin-bottom: 24px;
}

/* Sub-sections / Feature Cards */
.help-doc-card {
    background: var(--help-bg);
    border: 1px solid var(--help-border);
    border-radius: var(--help-radius);
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: var(--help-shadow);
}

.help-doc-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--help-heading);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-doc-card-title i {
    color: var(--help-accent);
}

.help-doc-card-body {
    font-size: .88rem;
    line-height: 1.65;
    color: var(--help-text);
}

/* Steps List */
.help-doc-steps {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    counter-reset: help-step;
}

.help-doc-step-item {
    position: relative;
    padding-left: 44px;
    margin-bottom: 16px;
    font-size: .88rem;
    line-height: 1.6;
    color: var(--help-text);
}

.help-doc-step-item::before {
    counter-increment: help-step;
    content: counter(help-step);
    position: absolute;
    left: 0;
    top: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--help-accent);
    color: #ffffff;
    font-weight: 700;
    font-size: .78rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-doc-step-title {
    font-weight: 700;
    color: var(--help-heading);
    margin-bottom: 2px;
}

/* Callouts / Alerts */
.help-doc-callout {
    padding: 14px 18px;
    border-left: 4px solid var(--help-accent);
    background: var(--help-badge-bg);
    border-radius: 0 var(--help-radius-sm) var(--help-radius-sm) 0;
    margin: 18px 0;
    font-size: .86rem;
    line-height: 1.6;
    color: var(--help-text);
}

.help-doc-callout--info {
    border-left-color: #1677f2;
    background: rgba(22, 119, 242, 0.08);
}

.help-doc-callout--warning {
    border-left-color: #ff8f3d;
    background: rgba(255, 143, 61, 0.1);
}

.help-doc-callout--tip {
    border-left-color: #13b8a6;
    background: rgba(19, 184, 166, 0.1);
}

.help-doc-callout-title {
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Screenshot Frame */
.help-doc-screenshot {
    max-width: 680px;
    width: 100%;
    margin: 20px 0 24px;
    border: 1px solid var(--help-screenshot-border);
    border-radius: var(--help-radius-sm);
    overflow: hidden;
    background: var(--help-screenshot-bg);
    box-shadow: var(--help-shadow);
}

.help-doc-screenshot-header {
    background: var(--help-border);
    padding: 8px 14px;
    font-size: .76rem;
    font-weight: 600;
    color: var(--help-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-doc-screenshot-body {
    padding: 12px;
    text-align: center;
}

.help-doc-screenshot img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.help-doc-screenshot-caption {
    font-size: .78rem;
    color: var(--help-text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* Tables */
.help-doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: .86rem;
}

.help-doc-table th {
    background: var(--help-bg);
    color: var(--help-heading);
    font-weight: 700;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--help-border);
}

.help-doc-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--help-border);
    color: var(--help-text);
}

/* Badge */
.help-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
    background: var(--help-badge-bg);
    color: var(--help-badge-text);
}

/* Mobile Toggle */
.help-doc-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--help-accent);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 991.98px) {
    .help-doc-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1050;
        box-shadow: 0 0 20px rgba(0, 0, 0, .2);
    }

    .help-doc-sidebar.show {
        left: 0;
    }

    .help-doc-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 1040;
    }

    .help-doc-sidebar-overlay.show {
        display: block;
    }

    .help-doc-content {
        padding: 20px 16px 40px;
    }

    .help-doc-mobile-toggle {
        display: flex;
    }
}

/* ---------- Portal public layout overrides for help page ---------- */
.portal-public-help,
.portal-public-help .wrapper,
.portal-public-help .content-wrapper,
.portal-public-help .content,
.portal-public-help .portal-page-shell {
    overflow: visible !important;
}

.portal-public-help .portal-content-wrapper,
.portal-public-help .content-wrapper {
    margin-left: 0 !important;
}

.portal-public-help .main-sidebar {
    display: none !important;
}

.portal-public-help .portal-page-shell {
    padding: 0;
    max-width: none;
}

.portal-public-help .content.pt-3,
.portal-public-help .content.pt-1 {
    padding-top: 0 !important;
}

/* ---------- Feature Cards Grid ---------- */
.help-doc-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 20px 0 28px;
}

.help-doc-feature-card {
    background: var(--help-bg);
    border: 1px solid var(--help-border);
    border-radius: var(--help-radius-sm);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--help-shadow);
}

.help-doc-feature-card i {
    font-size: 1.25rem;
    color: var(--help-accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.help-doc-feature-card div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.help-doc-feature-card strong {
    font-size: .88rem;
    color: var(--help-heading);
}

.help-doc-feature-card span {
    font-size: .78rem;
    color: var(--help-text-muted);
    line-height: 1.5;
}

/* Sub-sections */
.help-doc-subsection {
    margin: 32px 0 28px;
    padding-top: 20px;
    border-top: 1px dashed var(--help-border);
}

.help-doc-subsection-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.help-doc-subsection-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--help-badge-bg);
    color: var(--help-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
}

.help-doc-subsection-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--help-heading);
    margin: 0;
}

.help-doc-subsection-desc {
    font-size: .88rem;
    color: var(--help-text);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Badges */
.help-doc-section-badge {
    margin-left: 10px;
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(22, 119, 242, 0.12);
    color: #1677f2;
}

.help-doc-section-badge--auth {
    background: rgba(19, 184, 166, 0.12);
    color: #13b8a6;
}

/* Notes / Callout Banners */
.help-doc-note {
    padding: 14px 18px;
    border-left: 4px solid var(--help-accent);
    background: var(--help-badge-bg);
    border-radius: 0 var(--help-radius-sm) var(--help-radius-sm) 0;
    margin: 20px 0;
    font-size: .86rem;
    line-height: 1.65;
    color: var(--help-text);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.help-doc-note i {
    font-size: 1.1rem;
    color: var(--help-accent);
    margin-top: 2px;
}

.help-doc-note--info {
    border-left-color: #1677f2;
    background: rgba(22, 119, 242, 0.08);
}

.help-doc-note--tip {
    border-left-color: #13b8a6;
    background: rgba(19, 184, 166, 0.08);
}

.help-doc-note--warning {
    border-left-color: #ff8f3d;
    background: rgba(255, 143, 61, 0.1);
}

/* ---------- Gallery Grid for Multi-Image Support ---------- */
.help-doc-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.help-doc-gallery--2col {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
    .help-doc-gallery--2col {
        grid-template-columns: 1fr;
    }
}

.help-doc-gallery-item {
    background: var(--help-screenshot-bg);
    border: 1px solid var(--help-screenshot-border);
    border-radius: var(--help-radius-sm);
    padding: 10px;
    text-align: center;
    transition: all var(--help-transition);
}

.help-doc-gallery-item:hover {
    border-color: var(--help-accent);
    transform: translateY(-2px);
    box-shadow: var(--help-shadow-md);
}

.help-doc-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: top center;
    border-radius: var(--help-radius-sm);
    cursor: zoom-in;
}

.help-doc-gallery-caption {
    font-size: .78rem;
    color: var(--help-text);
    font-weight: 600;
    margin-top: 8px;
}

/* Zoomable Images */
.help-doc-zoomable,
.help-doc-screenshot.has-image img {
    cursor: zoom-in;
    transition: transform .2s ease, box-shadow .2s ease;
}

.help-doc-zoomable:hover,
.help-doc-screenshot.has-image:hover img {
    transform: scale(1.008);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.help-doc-screenshot-hint {
    font-size: .74rem;
    color: var(--help-text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: .8;
}

/* ---------- Lightbox Popup Modal ---------- */
.help-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.help-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.help-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.help-lightbox-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    max-width: 94vw;
    max-height: 94vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.help-lightbox-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.help-lightbox-counter {
    font-size: .78rem;
    font-weight: 600;
    background: rgba(22, 119, 242, 0.25);
    color: #60a5fa;
    padding: 3px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.help-lightbox-caption {
    font-size: .88rem;
    font-weight: 500;
    color: #e2e8f0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.help-lightbox-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.help-lightbox-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.help-lightbox-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-height: 200px;
    background: #090d16;
}

.help-lightbox-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 88vw;
    max-height: 80vh;
    overflow: hidden;
}

.help-lightbox-image-wrap img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.help-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.help-lightbox-nav:hover {
    background: var(--portal-primary-color, #1677f2);
    border-color: var(--portal-primary-color, #1677f2);
    transform: translateY(-50%) scale(1.08);
}

.help-lightbox-prev {
    left: 20px;
}

.help-lightbox-next {
    right: 20px;
}

.help-lightbox-nav.is-hidden {
    display: none !important;
}

/* Back to top button */
.help-doc-back-top {
    position: fixed;
    bottom: 20px;
    right: 80px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--help-sidebar-bg);
    color: var(--help-text);
    border: 1px solid var(--help-border);
    box-shadow: var(--help-shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
    z-index: 99;
}

.help-doc-back-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.help-doc-back-top:hover {
    background: var(--help-accent);
    color: #fff;
    border-color: var(--help-accent);
}