/* docs.css - Premium Documentation Theme */

:root {
    --color-arsenic: #3B4B41;
    --color-sand: #E6CFA6;
    --color-off-white: #F7F6F3;
    --popup-right: 85px;
    --color-text-main: #2c3e50;
    --color-text-muted: #6c757d;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-off-white);
    color: var(--color-text-main);
    line-height: 1.6;
}

/* --- OVERRIDES --- */
a {
    text-decoration: none;
    color: var(--color-arsenic);
    transition: all 0.2s;
}

.credit-text {
    color: var(--color-sand);
}

a:hover {
    color: #5a6e60;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-arsenic);
}

/* --- LAYOUT COMPONENTS --- */

/* Navbar */
.navbar {
    background-color: var(--color-arsenic) !important;
    padding: 0.75rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    color: #fff !important;
}

.btn-cta {
    background-color: var(--color-sand);
    color: var(--color-arsenic);
    font-weight: 700;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
}

.btn-cta:hover {
    background-color: #f0dec0;
    color: var(--color-arsenic);
}

/* Search Hero (Index) */
.hero-section {
    background: var(--color-arsenic);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(230, 207, 166, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.2) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: white !important;
    padding: 5rem 0 8rem 0;
    text-align: center;
    border-bottom: 2px solid rgba(230, 207, 166, 0.1);
    position: relative;
    overflow: hidden;
}

.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section p {
    color: white !important;
}

.hero-section h1 {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Subtle gloss effect */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.hero-search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hero-input {
    border-radius: 50px;
    padding: 1.2rem 2rem;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-size: 1.1rem;
}

.hero-input:focus {
    box-shadow: 0 10px 40px rgba(230, 207, 166, 0.3);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    margin-top: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    color: var(--color-text-main);
    text-align: left;
    display: none;
    /* Hidden by default */
}

.search-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background-color: #f8f9fa;
}

.search-item small {
    color: var(--color-text-muted);
}

/* Category Cards */
.cat-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--color-sand);
}

.cat-icon {
    width: 50px;
    height: 50px;
    background: rgba(230, 207, 166, 0.2);
    color: var(--color-arsenic);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Article Viewer */
.sidebar-sticky {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.doc-nav-link {
    display: block;
    padding: 0.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    border-left: 2px solid transparent;
    padding-left: 1rem;
}

.doc-nav-link:hover,
.doc-nav-link.active {
    color: var(--color-arsenic);
    font-weight: 600;
    border-left-color: var(--color-sand);
}

.doc-nav-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
    color: #adb5bd;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
}

/* SVG / Diagram Responsive Wrapper */
.mermaid,
.diagram-container {
    overflow-x: auto;
    padding-bottom: 1rem;
    max-width: 100%;
}

.mermaid svg {
    max-width: none !important;
    /* Allow internal scroll without squashing the diagram */
}

.article-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.75rem;
    border-bottom: 2px solid var(--color-sand);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.article-content h3 {
    margin-top: 1.5rem;
    font-size: 1.3rem;
}

.article-meta {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f0f0f0;
}

.helpful-box {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

/* Simple Footer */
footer {
    background-color: var(--color-arsenic);
    color: rgba(255, 255, 255, 0.6);
    padding: 3rem 0;
    margin-top: 4rem;
    font-size: 0.9rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--color-sand) !important;
}

/* --- MOBILE RESPONSIVE OVERRIDES --- */
@media (max-width: 991px) {
    .hero-section {
        padding: 2.5rem 0 !important;
        background-attachment: scroll;
        background-image: none !important;
        /* Remove busy pattern on mobile */
        background-color: var(--color-arsenic) !important;
    }

    .hero-section h1 {
        font-size: 1.4rem !important;
        font-weight: 600 !important;
        /* Less loud than 800 */
        margin-bottom: 0.5rem !important;
        letter-spacing: -0.01em;
    }

    .hero-section p.lead {
        font-size: 0.9rem !important;
        margin-bottom: 1.5rem !important;
        opacity: 0.85;
    }

    .article-content {
        padding: 1.5rem !important;
        /* Slightly more breathe room */
        border-radius: 12px;
        /* Keep some roundness for premium feel */
        margin: 0 10px;
        /* Force some gap from screen edges */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    .article-content h1 {
        font-size: 1.75rem !important;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    /* Mobile Bottom Sheet Navigation (Categories) */
    .mobile-nav-trigger {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 1040;
        background: var(--color-arsenic);
        color: var(--color-sand);
        width: 56px;
        height: 56px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        border: none;
        font-size: 1.2rem;
    }

    .offcanvas-docs {
        background-color: var(--color-off-white) !important;
    }

    .doc-nav-category {
        margin-top: 1rem;
        padding: 0 1.5rem;
    }

    /* Hero Buttons Polish */
    .hero-section .btn-sm {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }

    .hero-section .d-flex.gap-2 {
        gap: 0.5rem !important;
    }

    .doc-nav-link {
        padding: 0.75rem 1.5rem;
        border-left: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* Fix Hero Padding for very small screens */
    .hero-section {
        padding: 3rem 1rem !important;
    }

    .hero-section h1 {
        line-height: 1.2;
    }

    /* Ensure offcanvas doesn't overflow */
    .offcanvas-docs {
        max-width: 85% !important;
    }

    :root {
        --popup-right: 20px;
    }
}

/* Touch feedback for mobile links */
@media (hover: none) {
    .doc-nav-link:active {
        background-color: rgba(0, 0, 0, 0.03);
    }
}

/* Intelligence UI Polish */
.hover-opacity-100:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.escalation-banner-animate {
    animation: slideUpFade 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes slideUpFade {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.text-arsenic {
    color: var(--color-arsenic) !important;
}

.bg-arsenic {
    background-color: var(--color-arsenic) !important;
}

.btn-arsenic {
    border: 1px solid var(--color-arsenic);
}

.btn-arsenic:hover {
    background: #2d3a32 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Mobile Horizontal Scroll */
@media (max-width: 767px) {
    .mobile-scroll-x {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        margin-left: -1rem;
        /* Counter container padding to go edge-to-edge if needed */
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .mobile-scroll-x::-webkit-scrollbar {
        display: none;
    }

    .mobile-scroll-x {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* Intel Badge System - World Class Identity UI */
.intel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500; /* Toned down from 700 */
    letter-spacing: 0.01em;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.05),
        inset 0 0 10px rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.intel-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--color-sand);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.intel-badge i {
    color: var(--color-sand);
    font-size: 0.95rem;
    filter: none; /* Less noisy */
}

.intel-badge.white-icon i {
    color: #fff;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.intel-badge-wrapper {
    margin-bottom: 1.5rem;
    display: block;
}

/* High Contrast Variant for light backgrounds - Sophisticated Style */
.intel-badge-dark {
    background: rgba(59, 75, 65, 0.04) !important;
    border: 1px solid rgba(59, 75, 65, 0.12) !important;
    color: var(--color-arsenic) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    backdrop-filter: none; /* Cleaner on light bg */
}

.intel-badge-dark i {
    color: var(--color-arsenic) !important;
    filter: drop-shadow(0 0 5px rgba(59, 75, 65, 0.15)) !important;
}

/* Header Identity Spacing - Elegant and Precise */
.header-user-text {
    line-height: 1.4 !important;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 0.25rem;
}

/* Premium Identity Ribbon Container */
.identity-ribbon-premium {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-left: 5px solid var(--color-arsenic) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem; /* Spacing from hero */
}

.identity-ribbon-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(230, 207, 166, 0.05), transparent);
    pointer-events: none;
}

@media (max-width: 767px) {
    .identity-ribbon-premium {
        border-radius: 20px !important;
        padding: 1.25rem !important;
        margin-bottom: 1.5rem;
    }
    
    .intel-badge {
        padding: 0.4rem 1rem !important;
        font-size: 0.8rem !important;
        letter-spacing: 0.1em !important;
    }
    
    .btn-premium-action {
        background: var(--color-arsenic);
        color: var(--color-sand);
        border: none;
        border-radius: 100px; /* Pillow shape */
        padding: 0.5rem 1rem;
        font-weight: 500;
        font-size: 0.75rem;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .btn-premium-action:active {
        transform: scale(0.95);
    }
}

/* World Class Hover Shimmer */
.btn-premium-action, .btn-cta {
    position: relative;
    overflow: hidden;
}

.btn-premium-action::after, .btn-cta::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.btn-premium-action:hover::after, .btn-cta:hover::after {
    left: 100%;
    opacity: 1;
}

