* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 20px auto 0;
    background: white;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 80vh;
}

.full-width-header {
    background: linear-gradient(90deg, #212529, #343a40);
    color: white;
    width: 100%;
    padding: 15px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.header-right {
    display: flex;
    align-items: center;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.language-selector i {
    font-size: 1.1rem;
    color: #fff;
}

.language-selector select {
    background: transparent;
    color: white;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

.language-selector select option {
    color: #212529;
}

.search-section {
    padding: 0 0 20px;
    display: flex;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 2rem;
    font-weight: 700;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4, #FFD166);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.search-bar {
    display: flex;
    width: 100%;
    max-width: 700px;
    background: white;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.search-bar i {
    color: #6b7280;
    margin-left: 20px;
    align-self: center;
    font-size: 1.1rem;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 18px 20px;
    font-size: 1rem;
    outline: none;
    border-radius: 50px;
}

.search-bar button {
    background: linear-gradient(90deg, #495057, #6c757d);
    color: white;
    border: none;
    padding: 18px 35px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-bar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 117, 125, 0.4);
}

main {
    padding: 40px 30px;
}

.categories h1 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 40px;
    text-align: center;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.category-card {
    background: white;
    border-radius: 16px;
    padding: 30px 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #adb5bd;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.category-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
}

.doc-count {
    background: linear-gradient(90deg, #6c757d, #495057);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
}

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

.doc-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
}

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

.doc-list i {
    margin-right: 12px;
    font-size: 0.9rem;
}

.doc-list a {
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.doc-list a:hover {
    color: #212529;
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 40px 25px 25px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border-radius: 50%;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icons a:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #495057, #343a40);
}

/* Category card specific styles */
.category-card i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #FF6B6B, #4ECDC4, #FFD166);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.category-card .category-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
    text-align: center;
}

.category-card .doc-count {
    background: linear-gradient(90deg, #6c757d, #495057);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 10px;
}

footer p {
    font-size: 0.95rem;
    margin-top: 10px;
}

/* Breadcrumb styles */
.breadcrumb {
    padding: 15px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    font-size: 1rem;
}

.breadcrumb a {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #212529;
    text-decoration: underline;
}

.breadcrumb span {
    color: #495057;
}

/* Document list styles */
.category-documents h1 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 30px;
    text-align: left;
}

.document-list {
    list-style: none;
    padding: 0;
}

.document-list li {
    padding: 15px 18px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.document-list li:hover {
    background-color: #f8f9fa;
}

.document-list li i {
    color: #6c757d;
    margin-right: 12px;
    font-size: 1rem;
}

.document-list li a {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    flex: 1;
}

.document-list li a:hover {
    color: #212529;
    text-decoration: underline;
}

/* Document view styles */
.document-view {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.document-content {
    flex: 1;
    min-width: 0; /* Prevent overflow */
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    line-height: 1.6;
}

.document-content h1 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.document-content h2 {
    font-size: 1.6rem;
    color: #374151;
    margin: 25px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.document-content h3 {
    font-size: 1.3rem;
    color: #4b5563;
    margin: 20px 0 10px;
}

.document-content p {
    margin: 15px 0;
    color: #4b5563;
}

.document-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.document-content pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.document-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.document-content ul,
.document-content ol {
    margin: 15px 0;
    padding-left: 30px;
    color: #4b5563;
}

.document-content li {
    margin: 8px 0;
    line-height: 1.5;
}

.document-content strong {
    font-weight: 600;
    color: #374151;
}

.document-content em {
    font-style: italic;
}

.document-content a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

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

.document-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 20px;
    margin: 20px 0;
    color: #6b7280;
    font-style: italic;
}

.document-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.document-content th,
.document-content td {
    padding: 12px 15px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.document-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.document-content tr:nth-child(even) {
    background: #f9fafb;
}

.document-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

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

/* Enhance code highlighting */
.document-content pre {
    position: relative;
}

.document-content pre::before {
    content: 'Code';
    position: absolute;
    top: 10px;
    right: 15px;
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Improve ToC scrolling */
.toc {
    max-height: 70vh;
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.toc a {
    scroll-margin-top: 20px;
}

/* Document header styles */
.document-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.document-header h1 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 15px;
    font-weight: 700;
}

.document-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    color: #6b7280;
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item i {
    color: #9ca3af;
    font-size: 0.9rem;
}

.document-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.action-btn:hover {
    background: #e5e7eb;
    color: #4b5563;
}

.action-btn i {
    font-size: 1rem;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    display: none;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #6b7280;
    font-size: 1.2rem;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #9ca3af;
}

.loading p {
    margin-top: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Font size classes */
.document-content.font-normal {
    font-size: 1rem;
}

.document-content.font-large {
    font-size: 1.2rem;
}

.document-content.font-x-large {
    font-size: 1.4rem;
}

/* Notification animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile ToC toggle */
.toc-collapsed {
    display: none;
}

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: block;
    }
    
    .toc {
        position: static;
        max-height: none;
    }
}

/* Print styles */
@media print {
    .full-width-header,
    .search-section,
    .document-sidebar,
    .document-actions,
    .breadcrumb a,
    footer {
        display: none !important;
    }
    
    .container {
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
    
    .document-content {
        padding: 0;
        box-shadow: none;
    }
    
    .breadcrumb span {
        color: #000;
        font-size: 12pt;
    }
    
    .document-header h1 {
        font-size: 24pt;
        color: #000;
    }
    
    .document-content h1 {
        font-size: 20pt;
        color: #000;
    }
    
    .document-content h2 {
        font-size: 16pt;
        color: #000;
    }
    
    .document-content h3 {
        font-size: 14pt;
        color: #000;
    }
    
    .document-content p,
    .document-content li {
        font-size: 12pt;
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    pre {
        page-break-inside: avoid;
    }
}

.document-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 15px;
}

.sidebar-header h3 {
    font-size: 1.3rem;
    color: #1f2937;
    margin: 0;
}

.toc {
    padding: 15px;
}

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

.toc li {
    margin-bottom: 10px;
}

.toc a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.toc a:hover {
    color: #212529;
    background: #f8f9fa;
    text-decoration: none;
}

.toc-h1 {
    font-weight: 600;
    margin-left: 0;
}

.toc-h2 {
    font-weight: 500;
    margin-left: 15px;
}

.toc-h3 {
    font-weight: 400;
    margin-left: 30px;
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #6c757d;
    font-size: 1.2rem;
}

.error {
    color: #dc3545;
    padding: 20px;
    background: #f8d7da;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

@media (max-width: 1024px) {
    .document-view {
        flex-direction: column;
    }
    
    .document-sidebar {
        width: 100%;
        order: -1;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .full-width-header {
        padding: 15px 0;
    }
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }
    .logo {
        font-size: 2rem;
    }
    .language-selector {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    .search-section {
        padding: 30px 15px 15px;
    }
    .search-bar {
        flex-direction: column;
        background: transparent;
        box-shadow: none;
        gap: 15px;
        max-width: 100%;
    }
    .search-bar input, .search-bar button {
        border-radius: 12px;
        width: 100%;
    }
    .search-bar i {
        display: none;
    }
    main {
        padding: 30px 20px;
    }
    .categories h1 {
        font-size: 2rem;
    }
    .category-list {
        grid-template-columns: 1fr;
    }
    .social-icons {
        gap: 15px;
    }
    .social-icons a {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}