/* ==========================================================================
   GLOBAL DESIGN VARIABLES (Modify these to customize colors and themes)
   ========================================================================== */
:root {
    --bg-color: #f6f6f6;
    --content-bg: #ffffff;
    --text-color: #202122;
    --border-color: #a2a9b1;
    --accent-color: #3366cc;
    --accent-hover: #2a52be;
    --sidebar-text: #54595d;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ==========================================================================
   Header Setup
   ========================================================================== */
.wiki-header {
    background-color: var(--content-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.wiki-header .logo {
    font-size: 1.3rem;
    color: var(--text-color);
}
.wiki-header .logo i {
    color: var(--accent-color);
    margin-right: 5px;
}

.search-bar {
    display: flex;
    flex-grow: 0.4;
}

.search-bar input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 2px 0 0 2px;
    outline: none;
}

.search-bar button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: #f8f9fa;
    cursor: pointer;
    border-radius: 0 2px 2px 0;
}

.search-bar button:hover {
    background-color: #edf2f7;
}

.user-actions .btn-secondary, .user-actions .btn-primary {
    text-decoration: none;
    padding: 8px 14px;
    font-size: 0.9rem;
    border-radius: 2px;
    margin-left: 8px;
}

.user-actions .btn-secondary {
    color: var(--accent-color);
}

.user-actions .btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.user-actions .btn-primary:hover {
    background-color: var(--accent-hover);
}

/* ==========================================================================
   Main App Layout
   ========================================================================== */
.wiki-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 120px);
}

/* Sidebar Styling */
.wiki-sidebar {
    width: 240px;
    padding: 24px;
    background-color: var(--bg-color);
    flex-shrink: 0;
}

.sidebar-nav h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--sidebar-text);
    margin-bottom: 8px;
    margin-top: 20px;
    letter-spacing: 0.5px;
}

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

.sidebar-nav ul li a {
    text-decoration: none;
    color: var(--accent-color);
    font-size: 0.9rem;
    display: block;
    padding: 4px 0;
}

.sidebar-nav ul li a:hover {
    text-decoration: underline;
}

.sidebar-nav ul li a i {
    width: 18px;
    margin-right: 6px;
    color: #72777d;
}

.sidebar-nav ul li a.active {
    color: var(--text-color);
    font-weight: bold;
}

/* Content Window Styling */
.wiki-content {
    flex-grow: 1;
    background-color: var(--content-bg);
    border-left: 1px solid var(--border-color);
    padding: 24px;
}

/* Top Tabs Layout */
.article-tabs {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.article-tabs .tab {
    text-decoration: none;
    color: var(--accent-color);
    padding: 8px 12px;
    display: inline-block;
    border-bottom: 3px solid transparent;
}

.article-tabs .tab.active {
    color: var(--text-color);
    border-bottom-color: var(--accent-color);
    font-weight: bold;
}

/* ==========================================================================
   Wiki Typography & Components
   ========================================================================== */
.wiki-article h1 {
    font-family: Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
}

.wiki-article .subtitle {
    font-size: 0.85rem;
    color: #54595d;
    margin-top: 4px;
}

.heading-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 16px 0 20px 0;
}

.wiki-article h2 {
    font-family: Georgia, serif;
    font-size: 1.5rem;
    font-weight: 400;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
    margin-top: 28px;
    margin-bottom: 12px;
}

.wiki-article p {
    margin-bottom: 16px;
    font-size: 1rem;
}

.wiki-article ul {
    margin-left: 24px;
    margin-bottom: 16px;
}

/* Wikipedia Style Infobox */
.wiki-infobox {
    float: right;
    width: 280px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    margin-left: 20px;
    margin-bottom: 20px;
    padding: 8px;
    font-size: 0.85rem;
}

.infobox-title {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    background-color: #eaecf0;
    padding: 6px;
    border-radius: 2px;
}

.infobox-image {
    text-align: center;
    background: #fff;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
}

.infobox-table {
    width: 100%;
    border-collapse: collapse;
}

.infobox-table th, .infobox-table td {
    padding: 6px 4px;
    vertical-align: top;
    text-align: left;
}

.infobox-table th {
    width: 40%;
    font-weight: bold;
}

/* ==========================================================================
   Footer Setup
   ========================================================================== */
.wiki-footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 24px;
    font-size: 0.75rem;
    color: #54595d;
    text-align: center;
}

.wiki-footer p {
    margin-bottom: 6px;
}

.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 12px;
}

.footer-links a {
    color: var(--accent-color);
    text-decoration: none;
}

/* Responsive optimization for mobile views */
@media (max-width: 768px) {
    .wiki-container {
        flex-direction: column;
    }
    .wiki-sidebar {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    .wiki-infobox {
        float: none;
        width: 100%;
        margin-left: 0;
    }
    .search-bar {
        display: none; /* Hides search bar on tiny layouts for spacing */
    }
}
