* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    background: #1a1a1a;
    color: #e0e0e0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: #242424;
    border-right: 1px solid #404040;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header h1 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #ffffff;
    font-weight: 600;
}

.language-selector {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #404040;
}

.lang-btn {
    padding: 5px 12px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 2px;
    text-decoration: none;
    color: #e0e0e0;
    font-size: 13px;
    transition: background 0.2s;
}

.lang-btn:hover {
    background: #333333;
}

.lang-btn.active {
    background: #1e4d7b;
    border-color: #2a5f8f;
    font-weight: 600;
    color: #ffffff;
}

.page-list h2 {
    font-size: 14px;
    font-weight: 600;
    color: #a0a0a0;
    margin-top: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.page-list ul {
    list-style: none;
    margin-bottom: 20px;
}

.page-list li {
    margin-bottom: 2px;
}

.page-list a {
    display: block;
    padding: 6px 10px;
    color: #6bb3ff;
    text-decoration: none;
    border-radius: 2px;
    font-size: 14px;
    transition: background 0.2s;
}

.page-list a:hover {
    background: #2a3a4a;
    text-decoration: underline;
}

.page-list a.active {
    background: #2a3a4a;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 20px 40px;
}

.article {
    background: #242424;
    padding: 25px 30px;
    border: 1px solid #404040;
    max-width: 1000px;
}

.article-header {
    border-bottom: 1px solid #404040;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.article-title {
    font-size: 32px;
    font-weight: 400;
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    margin-bottom: 5px;
    line-height: 1.3;
    color: #ffffff;
}

.article-description {
    color: #a0a0a0;
    font-size: 14px;
    font-style: italic;
}

.article-body {
    font-size: 14px;
}

.article-body h2 {
    font-size: 21px;
    font-weight: 400;
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    border-bottom: 1px solid #404040;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 3px;
    color: #ffffff;
}

.article-body h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.article-body p {
    margin-bottom: 12px;
    text-align: justify;
}

.article-body ul,
.article-body ol {
    margin-left: 30px;
    margin-bottom: 12px;
}

.article-body li {
    margin-bottom: 6px;
}

.article-body a {
    color: #6bb3ff;
    text-decoration: none;
}

.article-body a:hover {
    text-decoration: underline;
}

.article-body code {
    background: #1a1a1a;
    padding: 2px 6px;
    border: 1px solid #404040;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #ff6b6b;
}

/* Infobox */
.infobox {
    float: right;
    width: 280px;
    border: 1px solid #404040;
    background: #2a2a2a;
    margin: 0 0 15px 15px;
    padding: 0;
    font-size: 13px;
    clear: right;
}

.infobox-title {
    background: #1e4d7b;
    padding: 8px 10px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
}

.infobox-image {
    width: 100%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 12px;
    overflow: hidden;
}

.infobox-image img {
    width: 100%;
    height: auto;
    display: block;
}

.infobox-caption {
    padding: 5px 10px;
    font-size: 12px;
    color: #a0a0a0;
    text-align: center;
    background: #242424;
}

.infobox-section {
    background: #1e4d7b;
    padding: 5px 10px;
    font-weight: 600;
    margin-top: 5px;
    color: #ffffff;
}

.infobox-row {
    display: flex;
    border-top: 1px solid #404040;
    padding: 5px 10px;
    background: #242424;
}

.infobox-row:first-of-type {
    border-top: none;
}

.infobox-label {
    font-weight: 600;
    width: 40%;
    padding-right: 10px;
    color: #c0c0c0;
}

.infobox-value {
    width: 60%;
}

/* Table of Contents */
.toc {
    border: 1px solid #404040;
    background: #2a2a2a;
    padding: 10px 15px;
    margin: 20px 0;
    display: inline-block;
    min-width: 300px;
}

.toc-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    color: #ffffff;
}

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

.toc-list li {
    margin: 4px 0;
    padding-left: 20px;
    text-indent: -20px;
}

.toc-list a {
    color: #6bb3ff;
    text-decoration: none;
}

.toc-list a:hover {
    text-decoration: underline;
}

/* Article Grid (for main page) */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.article-card {
    border: 1px solid #404040;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 3px;
}

.article-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    margin-top: 0;
}

.article-card h3 a {
    color: #6bb3ff;
    text-decoration: none;
}

.article-card h3 a:hover {
    text-decoration: underline;
}

.article-card p {
    font-size: 13px;
    color: #a0a0a0;
    margin-bottom: 0;
}

/* Sections */
section {
    margin-bottom: 30px;
}

.intro-section {
    margin-top: 0;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    font-size: 13px;
}

table th {
    background: #2a2a2a;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #404040;
    color: #ffffff;
}

table td {
    padding: 8px 10px;
    border: 1px solid #404040;
}

table tr:nth-child(even) {
    background: #2a2a2a;
}

table tr:nth-child(odd) {
    background: #242424;
}

/* Images */
.article-body img {
    max-width: 100%;
    height: auto;
}

.image-frame {
    border: 1px solid #404040;
    padding: 5px;
    background: #2a2a2a;
    display: inline-block;
    margin: 10px 0;
}

.image-caption {
    font-size: 12px;
    color: #a0a0a0;
    margin-top: 5px;
    text-align: center;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 20px;
    padding: 0 10px;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #6bb3ff;
}

.search-input::placeholder {
    color: #888;
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 10px;
    right: 10px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.search-result-item {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #404040;
    text-decoration: none;
    color: #e0e0e0;
    transition: background 0.2s;
}

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

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

.search-result-title {
    font-weight: 600;
    color: #6bb3ff;
    margin-bottom: 4px;
    font-size: 14px;
}

.search-result-description {
    font-size: 12px;
    color: #a0a0a0;
    line-height: 1.4;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.search-result-title mark,
.search-result-description mark {
    background: #1e4d7b;
    color: #ffffff;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Discord Widget */
.discord-widget {
    float: right;
    width: 300px;
    margin: 0 0 20px 20px;
    border: 1px solid #404040;
    border-radius: 5px;
    overflow: hidden;
    background: #2a2a2a;
}

.discord-widget iframe {
    width: 100%;
    height: 500px;
    border: none;
}

/* Footer */
.footer {
    background: #242424;
    border-top: 1px solid #404040;
    padding: 20px 30px;
    margin-top: 40px;
    text-align: center;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: #6bb3ff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #8fc5ff;
    text-decoration: underline;
}

.footer-disclaimer {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #404040;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 15px 0;
    }
    
    .toc {
        width: 100%;
    }
    
    .discord-widget {
        float: none;
        width: 100%;
        margin: 0 0 20px 0;
    }
    
    .footer-links a {
        display: block;
        margin: 10px 0;
    }
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}