body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #1c1e21;
    display: flex;
    height: 100vh;
}

#container {
    display: flex;
    width: 100%;
    height: 100%;
}

#sidebar {
    width: 250px;
    background-color: #ffffff;
    border-right: 1px solid #dddfe2;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#sidebar header {
    border-bottom: 1px solid #dddfe2;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

#sidebar h2 {
    font-family: 'Roboto Slab', serif;
    color: #1c1e21;
    margin: 0;
}

#sidebar nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#sidebar nav li {
    margin-bottom: 5px;
}

#sidebar nav a {
    text-decoration: none;
    color: #007bff;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#sidebar nav a:hover {
    background-color: #e9ecef;
}

#sidebar nav a.active {
    background-color: #007bff;
    color: #ffffff;
    font-weight: bold;
}

#main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: #ffffff;
}

#page-title {
    font-family: 'Roboto Slab', serif;
    color: #1c1e21;
    border-bottom: 1px solid #dddfe2;
    padding-bottom: 15px;
    margin-top: 0;
}

#page-content {
    line-height: 1.6;
}

#page-content h2, #page-content h3 {
    font-family: 'Roboto Slab', serif;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 25px;
}

#page-content p {
    margin-bottom: 15px;
}

#page-content code {
    background-color: #e9ecef;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

#page-content pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

#page-content .infobox {
    float: right;
    width: 280px;
    border: 1px solid #a2a9b1;
    background-color: #f9f9f9;
    margin: 0 0 15px 15px;
    font-size: 0.9em;
    line-height: 1.4;
    border-spacing: 0;
}

#page-content .infobox th,
#page-content .infobox td {
    border-top: 1px solid #eaecf0;
    padding: 0.4em 0.6em;
    vertical-align: top;
}

#page-content .infobox tr:first-child th,
#page-content .infobox tr:first-child td {
    border-top: none;
}

#page-content .infobox .infobox-above {
    font-size: 1.25em;
    text-align: center;
    padding: 0.5em;
    font-family: 'Roboto Slab', serif;
}

#page-content .infobox.vevent .infobox-above {
    background-color: #e0e0e0;
}

#page-content .infobox .infobox-image {
    text-align: center;
    padding: 10px;
}

#page-content .infobox .infobox-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
}

#page-content .infobox .infobox-caption {
    text-align: center;
    font-size: 0.9em;
    padding: 5px;
    line-height: 1.2;
    font-style: italic;
}

#page-content .infobox .infobox-label {
    font-weight: bold;
    text-align: left;
    width: 35%;
}

#page-content .infobox .infobox-data {
    text-align: left;
}

#page-content .infobox .infobox-data ul {
    margin: 0;
    padding-left: 1.2em;
}

#page-content .infobox-list-item {
    margin-bottom: 0.5em;
}

.bogosort-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.bogosort-code {
    flex: 1;
    min-width: 300px;
}

.bogosort-visualizer {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.bogosort-visualizer h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

#vis-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

#vis-controls label {
    font-weight: bold;
}

#vis-controls button {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

#vis-controls button:hover {
    background-color: #0056b3;
}

#vis-controls button:disabled {
    background-color: #a0cfff;
    border-color: #a0cfff;
    cursor: not-allowed;
}

#vis-area {
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2px;
    border: 1px solid #ccc;
    background-color: white;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    flex-grow: 1;
    background-color: #6c757d;
    color: white;
    text-align: center;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
    transition: background-color 0.3s, height 0.3s;
    display: flex;
    justify-content: center;
    padding-top: 5px;
    box-sizing: border-box;
}

.bar.locked {
    background-color: #28a745; /* Green */
}

.bar.sorted {
    background-color: #007bff; /* Blue */
}

#sort-stats {
    margin-top: 15px;
    font-size: 0.9em;
}

#sort-stats p {
    margin: 5px 0;
}

/* Wikitable Styles */
.wikitable {
    background-color: #f9f9f9;
    color: #222;
    margin: 1em 0;
    border: 1px solid #a2a9b1;
    border-collapse: collapse;
    width: 100%;
}

.wikitable th, .wikitable td {
    border: 1px solid #a2a9b1;
    padding: 0.35em 0.6em;
}

.wikitable th {
    background-color: #eaecf0;
    text-align: center;
    font-weight: bold;
}

.wikitable caption {
    font-weight: bold;
    font-size: 1.1em;
    padding: 0.5em;
    text-align: left;
}

/* Fandom Table Styles */
.fandom-table {
    background-color: #f9f9f9;
    color: #222;
    margin: 1em 0;
    border: 1px solid #a2a9b1;
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9em;
}

.fandom-table th, .fandom-table td {
    border: 1px solid #a2a9b1;
    padding: 0.35em 0.6em;
    text-align: left;
}

.fandom-table th {
    background-color: #eaecf0;
    text-align: center;
    font-weight: bold;
}

.table-wide-inner {
    overflow-x: auto;
}

.mw-collapsible-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    color: #007bff;
    padding: 0 5px;
}
.mw-collapsible-toggle:hover {
    text-decoration: underline;
}

.mw-collapsible-content {
    /* JS will toggle display */
}

/* Clearfix for floated elements */
#page-content::after {
    content: "";
    display: table;
    clear: both;
}