/* User Guide Styles */

/* Page structure */
.guide-page {
    margin: 0;
    padding: 0;
    background-color: #f9fafb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.guide-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.guide-header .header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guide-header .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.guide-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.back-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: #1d4ed8;
}

.legal-ready-logo {
    height: 40px;
}

/* Main container */
.guide-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    padding: 2rem;
    position: relative;
}

/* Sidebar TOC (Desktop) */
.guide-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #2563eb;
}

/* TOC Navigation */
.toc-nav {
    margin: 0;
}

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

.toc-item {
    margin: 0;
}

.toc-level-2 {
    margin-bottom: 0.5rem;
}

.toc-level-3 {
    padding-left: 1rem;
    margin-bottom: 0.25rem;
}

.toc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
    line-height: 1.4;
}

.toc-level-2 .toc-link {
    font-weight: 600;
    color: #374151;
}

.toc-level-3 .toc-link {
    font-weight: 400;
    font-size: 0.85rem;
}

.toc-link:hover {
    background-color: #f3f4f6;
    color: #2563eb;
    padding-left: 1rem;
}

.toc-link.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 600;
    border-left: 3px solid #2563eb;
}

/* Mobile TOC */
.mobile-toc-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2563eb;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    z-index: 90;
    transition: all 0.2s;
}

.mobile-toc-toggle:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.mobile-toc-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 200;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-toc-drawer.open {
    right: 0;
}

.mobile-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.mobile-toc-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.mobile-toc-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.mobile-toc-close:hover {
    color: #1f2937;
}

.mobile-toc-drawer .toc-nav {
    padding: 1rem;
}

.mobile-toc-link {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

/* Main content */
.guide-content {
    flex: 1;
    min-width: 0;
}

.content-wrapper {
    background: white;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.7;
}

/* Typography */
.content-wrapper h1 {
    font-size: 2.5rem;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    line-height: 1.2;
}

.content-wrapper h2 {
    font-size: 1.875rem;
    color: #1f2937;
    margin: 3rem 0 1rem 0;
    font-weight: 700;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

.content-wrapper h2:first-of-type {
    border-top: none;
    margin-top: 2rem;
}

.content-wrapper h3 {
    font-size: 1.5rem;
    color: #374151;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.content-wrapper h4 {
    font-size: 1.25rem;
    color: #4b5563;
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 600;
}

.content-wrapper p {
    margin: 0 0 1rem 0;
    color: #374151;
}

.content-wrapper hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2rem 0;
}

/* Lists */
.content-wrapper ul,
.content-wrapper ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.content-wrapper li {
    margin-bottom: 0.5rem;
    color: #374151;
}

.content-wrapper li p {
    margin: 0.25rem 0;
}

/* Code blocks */
.content-wrapper code {
    background-color: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #dc2626;
}

.content-wrapper pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0 0 1rem 0;
}

.content-wrapper pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Tables */
.content-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.content-wrapper th {
    background-color: #f9fafb;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
}

.content-wrapper td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.content-wrapper tr:last-child td {
    border-bottom: none;
}

/* Blockquotes */
.content-wrapper blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #6b7280;
    font-style: italic;
}

/* Links */
.content-wrapper a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}

.content-wrapper a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Checkmarks and icons in content */
.content-wrapper li::marker {
    color: #2563eb;
}

/* Special formatting for tips/warnings */
.content-wrapper strong {
    color: #1f2937;
    font-weight: 600;
}

.content-wrapper em {
    color: #6b7280;
}

/* Footer */
.guide-footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 3rem;
    border-top: 2px solid #e5e7eb;
    color: #6b7280;
}

.guide-footer p {
    margin: 0.5rem 0;
}

/* Print styles */
@media print {
    .guide-sidebar,
    .mobile-toc-toggle,
    .mobile-toc-drawer,
    .back-link {
        display: none;
    }

    .guide-container {
        display: block;
        padding: 0;
    }

    .content-wrapper {
        box-shadow: none;
        padding: 1rem;
    }

    .guide-header {
        position: static;
    }

    .content-wrapper h2 {
        page-break-before: always;
    }

    .content-wrapper h2:first-of-type {
        page-break-before: avoid;
    }
}

/* Responsive design */
@media (max-width: 1024px) {
    .guide-container {
        padding: 1rem;
    }

    .guide-sidebar {
        display: none;
    }

    .mobile-toc-toggle {
        display: block;
    }

    .mobile-toc-drawer {
        display: block;
    }

    .content-wrapper {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .guide-header {
        padding: 1rem;
    }

    .guide-header h1 {
        font-size: 1.25rem;
    }

    .guide-container {
        padding: 0.5rem;
    }

    .content-wrapper {
        padding: 1.5rem 1rem;
        border-radius: 0;
    }

    .content-wrapper h1 {
        font-size: 2rem;
    }

    .content-wrapper h2 {
        font-size: 1.5rem;
    }

    .content-wrapper h3 {
        font-size: 1.25rem;
    }

    .mobile-toc-toggle {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }

    .mobile-toc-drawer {
        width: 90%;
    }

    .legal-ready-logo {
        height: 30px;
    }
}

@media (max-width: 480px) {
    .guide-header .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .back-link {
        font-size: 0.9rem;
    }
}

/* Smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for sidebar */
.sidebar-sticky::-webkit-scrollbar {
    width: 6px;
}

.sidebar-sticky::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
