/* Additional styles for the documentation layout */

/* Prose styling improvements */
.prose {
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    scroll-margin-top: 80px; /* Account for sticky header */
}

.prose pre {
    position: relative;
    background: #1f2937 !important;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.prose code {
    font-size: 0.875rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    white-space: pre-wrap !important;
    word-wrap: break-word;
}

.prose pre code {
    display: block;
    line-height: 1.5;
    white-space: pre !important;
}

.prose :not(pre) > code {
    background: #f4f4f5;
    color: #e11d48;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap !important;
}

.dark .prose :not(pre) > code {
    background: #27272a;
    color: #f472b6;
}

/* Table styling */
.prose table {
    border-collapse: collapse;
    margin: 1.5rem 0;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.prose th, .prose td {
    border: 1px solid #e4e4e7;
    padding: 0.75rem;
    text-align: left;
}

.dark .prose th, .dark .prose td {
    border-color: #3f3f46;
}

.prose th {
    background: #f4f4f5;
    font-weight: 600;
}

.dark .prose th {
    background: #27272a;
}

/* Alert/callout boxes */
.callout {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.callout-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.dark .callout-info {
    background: #1e3a8a;
    color: #bfdbfe;
}

.callout-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.dark .callout-warning {
    background: #92400e;
    color: #fde68a;
}

.callout-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.dark .callout-error {
    background: #dc2626;
    color: #fecaca;
}

.callout-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #16a34a;
}

.dark .callout-success {
    background: #16a34a;
    color: #bbf7d0;
}

/* Navigation improvements */
.nav-section + .nav-section {
    margin-top: 2rem;
}

/* Search improvements */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    max-height: 20rem;
    overflow-y: auto;
    z-index: 50;
}

.dark .search-results {
    background: #18181b;
    border-color: #3f3f46;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.dark .search-result-item {
    border-color: #27272a;
}

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

.dark .search-result-item:hover {
    background: #27272a;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Code copy button improvements */
.copy-button {
    opacity: 0;
    transition: opacity 0.2s;
}

.group:hover .copy-button {
    opacity: 1;
}

/* Environment variable code blocks */
code.block {
    white-space: pre-line !important;
    display: block;
    padding: 0.75rem;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
}

.dark code.block {
    background: #27272a;
}

/* Sidebar positioning fixes for desktop */
@media (min-width: 1024px) {
    /* Ensure sidebar is properly positioned and doesn't get cut off */
    aside {
        position: fixed !important;
        top: 4rem !important; /* Account for header height */
        left: 0 !important;
        height: calc(100vh - 4rem) !important;
        width: 16rem !important; /* 64 * 0.25rem = 16rem (w-64) */
        z-index: 30 !important;
        transform: none !important;
        transition: none !important;
    }
    
    /* Adjust main content to account for fixed sidebar */
    main {
        margin-left: 16rem !important; /* Same as sidebar width */
        min-height: calc(100vh - 4rem) !important;
    }
    
    /* Constrain main content width to prevent overflow */
    main > div {
        max-width: calc(100vw - 16rem) !important; /* Full width minus sidebar */
        overflow-x: hidden !important;
    }
    
    /* Ensure sidebar content is scrollable */
    aside .flex.flex-col.h-full {
        height: 100% !important;
        overflow-y: auto !important;
    }
    
    /* Remove any background blur or opacity for better visibility */
    aside .flex.flex-col.h-full {
        background: white !important;
        backdrop-filter: none !important;
    }
    
    .dark aside .flex.flex-col.h-full {
        background: #18181b !important; /* zinc-900 */
    }
}

/* Additional content width constraints for XL screens with TOC */
@media (min-width: 1280px) {
    /* When TOC is visible, further constrain content width */
    main > div {
        max-width: calc(100vw - 16rem - 16rem - 4rem) !important; /* Full width minus sidebar, TOC, and padding */
    }
}

/* Ensure dynamic content area respects boundaries */
#dynamic-content {
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure all content elements respect container boundaries */
#dynamic-content * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Special handling for wide elements like tables and code blocks */
#dynamic-content table,
#dynamic-content pre,
#dynamic-content .code-block-container {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* Footer positioning fix */
footer {
    clear: both;
    position: relative;
    z-index: 10;
    margin-left: 0 !important;
    width: 100% !important;
}

/* Ensure footer spans full width on desktop */
@media (min-width: 1024px) {
    footer {
        margin-left: -16rem !important; /* Negative margin to offset sidebar width */
        padding-left: 16rem !important; /* Add padding to account for sidebar */
        width: calc(100% + 16rem) !important; /* Extend width to cover sidebar offset */
    }
}

/* Ensure main content container spans full width properly */
.flex.min-h-screen {
    min-height: 100vh;
}

/* Table of Contents positioning improvements */
@media (min-width: 1280px) {
    /* XL screens and up */
    .fixed.top-20.right-8 {
        position: fixed !important;
        top: 5rem !important;
        right: 2rem !important;
        z-index: 20 !important;
        max-height: calc(100vh - 8rem) !important;
    }
}

/* Smooth transitions */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Focus styles */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.dark *:focus {
    outline-color: #60a5fa;
}

/* Loading animation */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mobile improvements */
@media (max-width: 768px) {
    .prose {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    .prose h1 {
        font-size: 1.875rem;
    }
    
    .prose h2 {
        font-size: 1.5rem;
    }
    
    .prose h3 {
        font-size: 1.25rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
    
    .prose {
        max-width: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .prose code {
        background: black;
        color: white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Blockchain Integration Themes */
.blockchain-header {
    display: flex;
    align-items: center;
    padding: 2rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    border: 1px solid;
}

.blockchain-header .blockchain-icon {
    font-size: 3rem;
    margin-right: 1.5rem;
}

.blockchain-header .blockchain-info h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.blockchain-header .blockchain-subtitle {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.blockchain-header .blockchain-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blockchain-header .blockchain-badges .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Celo Theme */
.celo-theme {
    background: linear-gradient(135deg, #35d07f 0%, #fcff52 100%);
    border-color: #35d07f;
    color: #064e3b;
}

.dark .celo-theme {
    background: linear-gradient(135deg, #065f46 0%, #166534 100%);
    border-color: #059669;
    color: #6ee7b7;
}

/* UTXO Theme */
.utxo-theme {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border-color: #f59e0b;
    color: #92400e;
}

.dark .utxo-theme {
    background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
    border-color: #f59e0b;
    color: #fbbf24;
}

/* Solana Theme */
.solana-theme {
    background: linear-gradient(135deg, #9945ff 0%, #14f195 100%);
    border-color: #9945ff;
    color: #581c87;
}

.dark .solana-theme {
    background: linear-gradient(135deg, #581c87 0%, #7c3aed 100%);
    border-color: #9945ff;
    color: #c4b5fd;
}

/* Blockchain Content Components */
.guide-intro {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.dark .guide-intro {
    background: #18181b;
    border-color: #3f3f46;
    color: #d4d4d8;
}

.step-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.dark .step-card {
    background: #18181b;
    border-color: #3f3f46;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.step-number {
    background: #3b82f6;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
}

.code-block-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.dark .code-block-container {
    background: #1e293b;
    border-color: #475569;
}

.code-block-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.dark .code-block-header {
    border-color: #475569;
    background: #334155;
}

.code-block {
    margin: 0;
    padding: 1rem;
    background: transparent;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
}

.copy-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.copy-btn:hover {
    background: #2563eb;
}

.info-card, .tip-card, .feature-card, .token-type-card, .network-card, .difference-card, .token-info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.dark .info-card, .dark .tip-card, .dark .feature-card, .dark .token-type-card, .dark .network-card, .dark .difference-card, .dark .token-info-card {
    background: #1e293b;
    border-color: #475569;
}

.process-steps, .verification-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.process-step, .verification-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.process-number, .verification-number {
    background: #3b82f6;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.warning-box {
    background: #fef3cd;
    border: 1px solid #fbbf24;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    color: #92400e;
}

.dark .warning-box {
    background: #451a03;
    border-color: #d97706;
    color: #fbbf24;
}

.info-box {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    color: #1e40af;
}

.dark .info-box {
    background: #1e3a8a;
    border-color: #3b82f6;
    color: #bfdbfe;
}

.success-message {
    background: #d1fae5;
    border: 1px solid #10b981;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    color: #065f46;
}

.dark .success-message {
    background: #064e3b;
    border-color: #10b981;
    color: #6ee7b7;
}

.image-container {
    margin: 1rem 0;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.dark .image-container img {
    border-color: #3f3f46;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blockchain-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .blockchain-header .blockchain-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .blockchain-header .blockchain-info h1 {
        font-size: 2rem;
    }
    
    .blockchain-badges {
        justify-content: center;
    }
    
    .process-steps, .verification-steps {
        gap: 1rem;
    }
} 