/* ==========================================================================
   PayPass GitBook-Style Documentation Center CSS
   ========================================================================== */

/* --- Document Layout Structure --- */
.docs-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-canvas);
    color: var(--color-text-primary);
    position: relative;
    z-index: 1;
}

/* --- Floating Ambient Glows for Docs --- */
.docs-glow-1 {
    top: -5%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: var(--accent-purple);
    opacity: 0.12;
}

.docs-glow-2 {
    bottom: -5%;
    right: -10%;
    width: 650px;
    height: 650px;
    background: var(--accent-cyan);
    opacity: 0.10;
}

/* --- Navigation Header --- */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(7, 8, 13, 0.85);
    border-bottom: 1px solid var(--border-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.docs-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.docs-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-glass);
}

.docs-logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.docs-logo-sub {
    font-size: 0.85rem;
    background: var(--gradient-solana-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Center Search Container --- */
.docs-header-center {
    flex: 1;
    max-width: 480px;
    margin: 0 40px;
}

.docs-search-container {
    position: relative;
    width: 100%;
}

.docs-search-container .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--color-text-dim);
    pointer-events: none;
}

#docs-search-input {
    width: 100%;
    height: 42px;
    background: rgba(18, 22, 33, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0 16px 0 38px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: #fff;
    outline: none;
    transition: var(--transition-smooth);
}

#docs-search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(20, 241, 149, 0.2);
    background: rgba(26, 32, 48, 0.85);
}

/* Search Dropdown Panel */
.docs-search-results {
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    max-height: 400px;
    background: rgba(12, 15, 23, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
    z-index: 1100;
    padding: 8px 0;
}

.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 12px 18px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition-smooth);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.search-res-cat {
    font-size: 0.7rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.search-res-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.search-res-snippet {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.search-res-snippet mark {
    background: rgba(20, 241, 149, 0.25);
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}

.search-no-results {
    padding: 16px 18px;
    font-size: 0.85rem;
    color: var(--color-text-dim);
    text-align: center;
}

/* --- Container Structure --- */
.docs-container {
    max-width: 1400px;
    width: 100%;
    margin: 80px auto 0 auto;
    display: flex;
    position: relative;
}

/* --- Left Sidebar --- */
.docs-sidebar {
    width: 300px;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    border-right: 1px solid var(--border-glass);
    padding: 32px 24px;
    background: rgba(7, 8, 13, 0.5);
    z-index: 500;
    transition: var(--transition-smooth);
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.sidebar-cat-group {
    margin-bottom: 28px;
}

.sidebar-cat-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.sidebar-article-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-link-item {
    display: block;
    padding: 8px 12px;
    color: var(--color-text-secondary);
    font-size: 0.88rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: var(--transition-smooth);
}

.sidebar-link-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link-item.active {
    color: var(--accent-cyan);
    font-weight: 600;
    border-left-color: var(--accent-cyan);
    background: linear-gradient(90deg, rgba(20, 241, 149, 0.06) 0%, rgba(20, 241, 149, 0) 100%);
}

/* --- Main Content Panel --- */
.docs-main {
    flex: 1;
    padding: 40px 60px 80px 60px;
    max-width: 960px;
    width: 100%;
}

/* Breadcrumbs */
.docs-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin-bottom: 24px;
}

.docs-breadcrumbs a {
    color: var(--color-text-dim);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.docs-breadcrumbs a:hover {
    color: var(--color-text-secondary);
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.1);
}

.breadcrumb-current {
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Article Copy styling */
.docs-article {
    margin-bottom: 60px;
}

.docs-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 18px;
    letter-spacing: -0.02em;
}

.docs-lead {
    font-size: 1.12rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-bottom: 32px;
}

.docs-article-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-top: 40px;
    margin-bottom: 16px;
    letter-spacing: -0.015em;
}

.docs-article-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-top: 28px;
    margin-bottom: 12px;
}

.docs-article-body p {
    font-size: 0.96rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.docs-article-body ul, 
.docs-article-body ol {
    padding-left: 24px;
    margin-bottom: 24px;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.docs-article-body li {
    margin-bottom: 8px;
    line-height: 1.65;
}

.docs-article-body strong {
    color: #fff;
    font-weight: 600;
}

.docs-article-body a {
    color: var(--accent-cyan);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-cyan);
    transition: var(--transition-smooth);
}

.docs-article-body a:hover {
    color: #fff;
    border-bottom-style: solid;
}

/* Standard HTML Table inside Docs */
.docs-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 0.9rem;
    background: rgba(18, 22, 33, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    overflow: hidden;
}

.docs-article-body th {
    background: rgba(255, 255, 255, 0.02);
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid var(--border-glass);
}

.docs-article-body td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--color-text-secondary);
}

.docs-article-body tr:last-child td {
    border-bottom: none;
}

/* Callout Boxes (Glassmorphic) */
.callout {
    display: flex;
    gap: 16px;
    background: rgba(18, 22, 33, 0.45);
    border: 1px solid var(--border-glass);
    border-left-width: 4px;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 24px 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.callout-icon {
    font-size: 1.2rem;
    line-height: 1.4;
}

.callout-content {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.callout-content strong {
    color: #fff;
    display: block;
    margin-bottom: 4px;
}

.callout.tip {
    border-left-color: var(--accent-purple);
    background: linear-gradient(135deg, rgba(153, 69, 255, 0.05) 0%, rgba(18, 22, 33, 0.45) 100%);
}

.callout.note {
    border-left-color: var(--accent-cyan);
    background: linear-gradient(135deg, rgba(20, 241, 149, 0.04) 0%, rgba(18, 22, 33, 0.45) 100%);
}

.callout.warning {
    border-left-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(255, 74, 90, 0.04) 0%, rgba(18, 22, 33, 0.45) 100%);
}

.callout.caution {
    border-left-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(255, 74, 90, 0.04) 0%, rgba(18, 22, 33, 0.45) 100%);
}

/* Screenshot Placeholder (Dashed Glassmorphic border) */
.screenshot-placeholder {
    width: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 14px;
    padding: 36px 20px;
    margin: 28px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.screenshot-icon {
    font-size: 2.2rem;
    margin-bottom: 4px;
    opacity: 0.7;
}

.screenshot-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.screenshot-desc {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    max-width: 480px;
    line-height: 1.4;
}

/* Related Articles panel */
.docs-related {
    margin-top: 50px;
    padding-top: 36px;
    border-top: 1px solid var(--border-glass);
}

.related-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.related-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.related-link-card {
    background: rgba(18, 22, 33, 0.35);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px 20px;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    text-align: left;
}

.related-link-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(20, 241, 149, 0.3);
    transform: translateY(-2px);
}

.related-card-category {
    font-size: 0.68rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.related-card-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.related-card-desc {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.45;
}

/* Previous/Next Navigation */
.docs-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
}

.nav-card {
    flex: 1;
    background: rgba(18, 22, 33, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 18px 24px;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.nav-card:hover {
    border-color: rgba(153, 69, 255, 0.3);
    background: rgba(255, 255, 255, 0.03);
}

.nav-card-label {
    font-size: 0.72rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.nav-card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    transition: var(--transition-smooth);
}

.nav-card:hover .nav-card-title {
    color: var(--accent-cyan);
}

.prev-card {
    text-align: left;
}

.next-card {
    text-align: right;
}

/* Mobile Sidebar trigger buttons */
.mobile-sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1050;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: var(--color-text-primary);
    transition: var(--transition-smooth);
}

.mobile-sidebar-toggle.open .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-sidebar-toggle.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-sidebar-toggle.open .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 450;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* --- Media Queries (Responsiveness) --- */
@media (max-width: 1024px) {
    .docs-main {
        padding: 40px 32px 80px 32px;
    }
}

@media (max-width: 768px) {
    .docs-header {
        padding: 0 20px;
    }
    
    .docs-header-center {
        display: none; /* Hide main search bar on mobile headers, or toggle it */
    }
    
    .mobile-sidebar-toggle {
        display: flex;
    }
    
    .docs-sidebar {
        position: fixed;
        left: -300px;
        top: 80px;
        height: calc(100vh - 80px);
        background: #07080d;
        box-shadow: 16px 0 40px rgba(0, 0, 0, 0.8);
        border-right: 1px solid var(--border-glass);
    }
    
    .docs-sidebar.open {
        left: 0;
    }
    
    .sidebar-backdrop {
        display: block;
    }
    
    .docs-main {
        padding: 32px 20px 60px 20px;
    }
    
    .docs-title {
        font-size: 2.2rem;
    }
    
    .related-links-grid {
        grid-template-columns: 1fr;
    }
    
    .docs-navigation {
        flex-direction: column;
        gap: 16px;
    }
}

/* Custom Image Styling in Article Content */
.docs-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    margin: 24px auto;
    display: block;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

