/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #f8f9fa;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
    color: white;
    padding: 3rem 0;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.15);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #e0f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 500;
    color: #e0f2fe;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.1);
    padding: 1.5rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    position: sticky;
    top: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
}

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

.sidebar::-webkit-scrollbar-track {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e40af 0%, #0891b2 100%);
}

/* Firefox scrollbar styling */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 rgba(59, 130, 246, 0.1);
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h3 {
    color: #1e3a8a;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #3b82f6;
}

.nav-section h4 {
    color: #1e40af;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    color: #1e40af;
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.nav-link:active,
.nav-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    transform: translateX(6px);
}

/* Content Area */
.content {
    flex: 1;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.1);
    overflow: hidden;
}

.content-wrapper {
    padding: 2rem;
}

/* Documentation Sections */
.doc-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.doc-section:last-child {
    border-bottom: none;
}

.doc-section h2 {
    color: #1e3a8a;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 4px solid #3b82f6;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.doc-section p {
    color: #475569;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-weight: 400;
}

/* Subsections */
.subsection {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border-left: 5px solid #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
    transition: all 0.3s ease;
}

.subsection:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.12);
}

.subsection h3 {
    color: #1e40af;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.subsection p {
    color: #475569;
    font-size: 1rem;
    margin-bottom: 0;
    font-weight: 500;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.2);
    position: relative;
    overflow: hidden;
}

.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.info-box h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.info-box ol {
    padding-left: 1.5rem;
    position: relative;
    z-index: 1;
}

.info-box li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    box-shadow: 0 -4px 20px rgba(30, 58, 138, 0.1);
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        order: 2;
    }
    
    .content {
        order: 1;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .content-wrapper {
        padding: 1.5rem;
    }
    
    .doc-section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .sidebar {
        padding: 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus States for Accessibility */
.nav-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Mobile Menu Styles */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
    width: 300px;
}

.mobile-sidebar.mobile-open {
    left: 0;
}

/* Mobile overlay */
.mobile-sidebar.mobile-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mobile-menu-toggle {
    display: none;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

/* Search Input Styles */
.search-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 2px solid #e0f2fe;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s ease;
    color: #475569;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: white;
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Enhanced Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        width: 300px;
        max-height: 100vh;
        background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
        border-radius: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .main-content {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .content {
        order: 1;
        width: 100%;
    }
    
    /* Prevent body scroll when mobile menu is open */
    body.mobile-menu-open {
        overflow: hidden;
    }
}


/* Code Block Styling */
.code-block {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.2);
    position: relative;
    overflow: hidden;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="code-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23code-pattern)"/></svg>');
    opacity: 0.3;
}

.code-block h4 {
    color: #e0f2fe;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.code-block pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    z-index: 1;
    margin: 0;
}

.code-block code {
    color: #e0f2fe;
    background: none;
    padding: 0;
    font-size: inherit;
}

/* Inline Code Styling */
code {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid #cbd5e1;
}

/* Enhanced List Styling */
ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

ul ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

ul ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

/* Enhanced Subsection Styling */
.subsection ul li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.subsection ul li strong {
    color: #1e40af;
    font-weight: 700;
}

/* Feature Highlight Boxes */
.feature-highlight {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
}

.feature-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
}

.feature-highlight h4 {
    color: #1e40af;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Enhanced Navigation Styling */
.nav-section h4 {
    color: #1e40af;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    padding-left: 0.5rem;
    border-left: 3px solid #3b82f6;
}

/* Current Section Highlighting */
.current-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-left: 5px solid #3b82f6 !important;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15) !important;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

/* Copy Button Styling */
.copy-button {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.code-block:hover .copy-button {
    opacity: 1;
}

/* Scroll to Top Button */
.scroll-to-top:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4) !important;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Tooltip Styling */
.tooltip {
    position: absolute;
    background: #1e3a8a;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 250px;
    word-wrap: break-word;
    animation: tooltipFadeIn 0.3s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .code-block {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .copy-button {
        opacity: 1;
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .scroll-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
}

/* Print Optimizations */
@media print {
    .scroll-to-top,
    .reading-progress,
    .copy-button {
        display: none !important;
    }
    
    .current-section {
        background: #f8f9fa !important;
        border-left: 3px solid #3b82f6 !important;
        transform: none !important;
    }
}

/* Quick Links Grid */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.quick-link-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.quick-link-card:hover::before {
    opacity: 1;
}

.quick-link-card h3 {
    color: #1e40af;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-link-card p {
    color: #475569;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.card-link:hover {
    color: #1e40af;
    transform: translateX(4px);
}

.card-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.card-link:hover::after {
    transform: translateX(4px);
}

/* Print Styles */
@media print {
    .sidebar {
        display: none;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .content {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .header {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .code-block {
        background: #f8f9fa !important;
        color: #000 !important;
        border: 1px solid #dee2e6;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-link-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}
