/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 2001;
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Navbar Scrolled State */
/* Navbar scrolled state comes from style.css */

/* Background visibility and layering */
.ethereal-bg { z-index: -2 !important; }
#plexus-canvas { z-index: -1 !important; }
.parallax-layer { z-index: -1 !important; }

body.docs-active {
    background-color: transparent !important; /* Allow fixed backgrounds to show through */
}

/* Documentation Specific Styles */
html {
    overflow-x: visible;
}

body.docs-active {
    overflow-x: visible;
    overflow-y: visible;
    height: auto;
    min-height: 100%;
}

.docs-container {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 120px 0 100px; /* Removed side padding to align with navbar edges */
    position: relative;
    z-index: 5;
    overflow: visible;
}

/* Sidebar Styling */
.docs-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 120px; /* Matches padding-top of container */
    z-index: 100;
    height: fit-content;
    max-height: calc(100vh - 160px);
    background: var(--bg-panel-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-inner);
    background: rgba(255,255,255,0.02);
}

.sidebar-header h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

/* Nav Groups */
.nav-group {
    margin-bottom: 0.5rem;
}

.group-header {
    padding: 12px 1.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    user-select: none;
}

.group-header:hover {
    color: var(--text-high);
    background: rgba(255,255,255,0.02);
}

.group-header.active {
    color: var(--accent);
}

.group-header .chevron {
    font-size: 0.8rem;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.5;
    display: inline-block;
}

.group-header.open .chevron {
    transform: rotate(-180deg);
    opacity: 1;
    color: var(--accent);
}

.group-content {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(0,0,0,0.05);
}

.group-content.open {
    grid-template-rows: 1fr;
}

.group-inner {
    min-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 1.5rem 10px 2.5rem; /* Indented */
    background: none;
    border: none;
    color: var(--text-med);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    gap: 10px;
}

.nav-item:hover {
    background: var(--accent-soft);
    color: var(--text-high);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.nav-item.no-indent {
    padding-left: 1.5rem;
}

/* Main Content Styling */
.docs-content {
    flex: 1;
    display: block !important;
    padding: 0 0 150px 20px; /* Reduced right padding to maximize width */
    position: relative;
    z-index: 10;
}

.doc-section {
    display: none;
    opacity: 1; /* Ensure visible */
    width: 100%;
    margin: 0 auto;
}

.doc-section.active {
    display: block !important;
}

/* Modular Design Panels */
.doc-header-block {
    margin-bottom: 3.5rem;
    padding-top: 0; /* Ensure no internal top spacing */
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-accent-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--accent-soft);
    border: 1px solid rgba(134, 74, 249, 0.2);
    border-radius: 100px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
}

.doc-header-block h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin: 0;
    letter-spacing: -2px;
    background: linear-gradient(to bottom right, var(--text-high) 30%, var(--text-med));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.doc-header-block p {
    font-size: 1.15rem;
    color: var(--text-med);
    opacity: 0.7;
    max-width: 600px;
    margin: 0;
}

.content-panel {
    background: var(--bg-panel-solid);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 3rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .content-panel {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 15px 35px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Media Panel Styling */
.media-panel {
    background: #08080c;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

[data-theme="light"] .media-panel {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, rgba(124, 77, 255, 0.05) 0%, transparent 70%);
}

.video-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

.play-hint {
    position: absolute;
    width: 90px;
    height: 90px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
    box-shadow: 0 0 40px var(--accent-soft);
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
    border: 1px solid rgba(255,255,255,0.2);
}

.play-hint::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    opacity: 0.3;
    transition: var(--transition);
}

.play-hint:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px var(--accent);
}

.play-hint:hover::before {
    inset: -12px;
    opacity: 0.6;
}

/* Step Card Styling */
.steps-grid {
    display: grid;
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.step-card {
    background: #12121a;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 1.5rem;
    transition: var(--transition);
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .step-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.step-card:hover {
    background: rgba(25, 25, 30, 0.6);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.step-badge {
    width: 50px;
    height: 50px;
    background: rgba(134, 74, 249, 0.1);
    border: 1px solid rgba(134, 74, 249, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
    font-size: 1.1rem;
    box-shadow: inset 0 0 15px rgba(134, 74, 249, 0.1);
    transition: var(--transition);
}

.step-card:hover .step-badge {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-soft);
}

.step-text h4 {
    font-size: 1.2rem;
    margin-bottom: 4px;
    color: var(--text-high);
    letter-spacing: -0.5px;
}

.step-text p {
    font-size: 0.95rem;
    color: var(--text-med);
    line-height: 1.5;
    opacity: 0.8;
}

/* Tip Box */
.tip-box {
    background: rgba(134, 74, 249, 0.08);
    backdrop-filter: blur(5px);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(134, 74, 249, 0.2);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.tip-icon {
    font-size: 1.5rem;
}

.tip-content > strong {
    display: block;
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .docs-container {
        flex-direction: column;
        padding-top: 100px;
    }
    .docs-sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    .doc-card {
        padding: 2rem;
    }
}

.version-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 10px;
    color: var(--text-dim);
    opacity: 0.5;
    z-index: 100;
    background: var(--bg-panel-solid);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* Tutorial Layout Refinements - Matched to index.html */
.tutorial-step-card {
    background: #12121a; /* Opaque background like index.html */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: 3rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center horizontally */
    text-align: center; /* Center text */
    gap: 1.5rem;
    transition: var(--transition);
}

.tutorial-step-card:hover {
    border-color: rgba(134, 74, 249, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(134, 74, 249, 0.15);
}

.tutorial-step-card h3 {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center; /* Center flex items */
    gap: 12px;
    color: var(--text-high);
    font-size: 1.75rem;
    font-weight: 800;
}

.tutorial-step-card h3 span {
    background: var(--accent-soft);
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
}

.tutorial-step-text {
    color: var(--text-med);
    font-size: 1.1rem;
    line-height: 1.7;
    opacity: 0.9;
    margin: 0;
    max-width: 800px; /* Better readability when centered */
}

.sub-step-group {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center sub-steps */
    gap: 2.5rem;
    margin-top: 1rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-inner);
    width: 100%;
}

.sub-step {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center image and heading */
    gap: 1rem;
    width: 100%;
}

.sub-step h4 {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Tutorial Image Styling */
.tutorial-image-container {
    margin: 0.5rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.3);
    width: fit-content;
    max-width: 100%;
    align-self: center; /* Center container */
}

.tutorial-image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Tip Box Matched to index.html */
.tip-box {
    background: rgba(134, 74, 249, 0.05);
    backdrop-filter: blur(10px);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(134, 74, 249, 0.2);
    display: flex;
    flex-direction: column; /* Stack vertically for centering */
    gap: 1rem;
    align-items: center;
    text-align: center;
    width: 100%;
}

.tip-icon {
    font-size: 1.75rem;
}

.tip-content > strong {
    display: block;
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}
