/* OMS Help Center Styles - Inspired by Sapo Help Center (help.sapo.vn) */

:root {
    --brand-primary: #ea580c;
    --brand-primary-hover: #c2410c;
    --brand-light: #fff7ed;
    --brand-border: #fed7aa;
    --sidebar-width: 310px;
    --toc-width: 250px;
}

/* Custom Slim Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Left Sidebar Styles */
.sidebar-scroll {
    max-height: calc(100vh - 4.5rem);
    scrollbar-gutter: stable;
}

.nav-group-btn {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-group-btn.expanded .arrow-icon {
    transform: rotate(90deg);
}

.arrow-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-link {
    position: relative;
    transition: all 0.2s ease;
}

.nav-item-link.active {
    background-color: #fff7ed;
    color: #ea580c;
    font-weight: 600;
}

.nav-item-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3.5px;
    background-color: #ea580c;
    border-radius: 0 4px 4px 0;
}

/* Article Typography and Callouts */
.article-body h2 {
    color: #0f172a;
}

.article-body p {
    color: #334155;
    line-height: 1.75;
}

.step-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.step-card:hover {
    border-color: #fdba74;
    box-shadow: 0 2px 8px -2px rgba(234, 88, 12, 0.08);
}

.step-badge {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.25);
}

/* Right TOC Active State */
.toc-link {
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    color: #ea580c;
    border-left-color: #fed7aa;
}

.toc-link.active {
    color: #ea580c;
    font-weight: 600;
    border-left-color: #ea580c;
}

/* Search Dropdown Modal / List */
.search-results-box {
    max-height: 420px;
    scrollbar-gutter: stable;
}

.search-result-item:hover {
    background-color: #fff7ed;
}

/* Mobile Responsiveness & Utilities */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Strict Right TOC responsive visibility: Never display as sidebar below xl (1280px) */
@media (max-width: 1279px) {
    #rightTocContainer {
        display: none !important;
    }
}

/* Responsive safeguards for images, code, and text inside articles */
.article-content img,
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

.article-content pre,
.article-body pre {
    max-width: 100%;
    overflow-x: auto;
}

.article-content code,
.article-body code {
    word-break: break-word;
}

/* Mobile Table Optimization */
.article-content table,
.article-body table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 640px) {
    .article-content table,
    .article-body table {
        min-width: 540px;
    }
    .article-content table th,
    .article-content table td,
    .article-body table th,
    .article-body table td {
        padding: 0.625rem 0.625rem !important;
        font-size: 0.75rem !important;
        line-height: 1.45 !important;
    }
}

/* Mobile Floating Quick Bar Animation */
#mobileQuickBar {
    animation: floatUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Optimization */
@media print {
    header,
    aside,
    #mobileQuickBar,
    .toc-container,
    .article-footer,
    .feedback-box,
    .print-hide {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    main {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .article-body {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .callout {
        border-left-width: 4px !important;
        background-color: #f8fafc !important;
    }
}

/* Floating Chat Pulse Animation */
.pulse-btn {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.6);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(234, 88, 12, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
    }
}
