/* --- Color Palette --- */
/* Stone/Cobblestone Dark: #2C2C2C */
/* Moss/Emerald Green (Primary): #4CAF50 */
/* Dirt Brown/Background: #F5F5F5 (Light) */
/* Action/Accent Color (Redstone): #FF5722 */

/* Global Reset and Styles */
body {
    background-color: #F5F5F5; /* Light background (like sand or dirt) */
    color: #2C2C2C; /* Dark text */
    font-family: monospace, sans-serif; /* Blocky font */
    margin: 0;
    padding: 0;
}

/* --- Blocky UI Elements with Strong Borders --- */
.wiki-title, .article, .sidebar, header, .action-btn, .modal-content {
    border: 4px solid #000000; /* Strong black border */
    box-shadow: 6px 6px 0px 0px #000000; /* Deep block shadow */
    padding: 12px;
}

/* --- Links and Navigation --- */
a {
    color: #4CAF50; /* Emerald Green links */
    text-decoration: none;
    font-weight: bold;
}
a:hover {
    color: #FF5722; /* Redstone highlight on hover */
}

/* --- Header & Navigation Bar (Cobblestone) --- */
header {
    background-color: #5A5A5A; /* Darker header block */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    margin-bottom: 30px;
    color: #FFFFFF;
}

.wiki-title {
    font-size: 28px;
    color: #FFF;
    background: none;
    box-shadow: none;
    border: none;
}

/* --- Main Layout --- */
.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* --- Sidebar (Emerald/Moss Block) --- */
.sidebar {
    flex: 0 0 280px;
    background-color: #4CAF50; /* Primary Emerald Green block */
    margin-right: 30px;
    height: fit-content;
    color: #FFFFFF;
}

.sidebar h2 {
    color: #000000;
    border-bottom: 3px solid #000000;
    padding-bottom: 8px;
    margin-top: 0;
}

.sidebar ul {
    list-style: square; /* Minecrafty bullet points */
    padding-left: 20px;
}

.sidebar a {
    color: #FFFFFF;
}
.sidebar a:hover {
    color: #FFEB3B; /* Yellow glow on hover */
}

/* --- Main Article Area (Paper/Stone Block) --- */
.article {
    flex-grow: 1;
    background-color: #FFFFFF; /* White paper background */
    position: relative;
    padding-bottom: 50px;
}

.page-title {
    color: #2C2C2C;
    border-bottom: 4px solid #4CAF50; /* Green under-line */
    padding-bottom: 15px;
}

/* Chapter Styling */
.chapter {
    margin-top: 30px;
    padding-top: 10px;
}

.chapter h2 {
    color: #FF5722; /* Redstone color for headings */
}

/* Image/Media Styling */
.image-container {
    float: right;
    margin: 0 0 15px 15px;
    text-align: center;
    background-color: #F0F0F0;
    padding: 8px;
    border: 3px solid #000000;
    box-shadow: 3px 3px 0px 0px #000000;
}

.chapter-image {
    max-width: 250px;
    height: auto;
    display: block;
    border: 1px solid #000000;
}

.caption {
    font-size: 14px;
    color: #5A5A5A;
    margin-top: 5px;
}

/* --- Buttons (Action Block) --- */
.action-btn {
    background-color: #FFEB3B; /* Gold/Yellow button */
    color: #000000;
    cursor: pointer;
    font-weight: bold;
    padding: 8px 15px;
    transition: background-color 0.1s;
    border-radius: 0; /* Blocky look */
}

.action-btn:hover {
    background-color: #FFC107; /* Darker yellow on hover */
}

/* Edit/Save/Cancel Controls */
#controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

.save-btn {
    background-color: #4CAF50; /* Green for Save */
    color: #FFFFFF;
}
.save-btn:hover {
    background-color: #388E3C;
}

.cancel-btn {
    background-color: #FF5722; /* Red for Cancel */
    color: #FFFFFF;
}
.cancel-btn:hover {
    background-color: #E64A19;
}

/* --- Login Modal --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    padding-top: 50px;
}

.modal-content {
    background-color: #FFFFFF;
    margin: 5% auto;
    border: 4px solid #000000;
    box-shadow: 8px 8px 0px 0px #000000;
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 0 10px;
    cursor: pointer;
}

.modal input[type="password"] {
    width: 90%;
    padding: 10px;
    margin: 10px 0 20px 0;
    border: 2px solid #000000;
    box-shadow: inset 2px 2px 0px 0px #AAAAAA;
    font-size: 16px;
    box-sizing: border-box;
    border-radius: 0;
}

.warning-text {
    font-size: 14px;
    color: #FF5722;
}

/* Content Editable Styling */
[contenteditable="true"] {
    border: 2px dashed #FF5722; /* Red dotted border when editing */
    padding: 10px;
    outline: none;
    min-height: 200px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        margin-right: 0;
        margin-bottom: 20px;
        flex: auto;
    }
    .image-container {
        float: none;
        margin: 15px auto;
    }
    #controls {
        position: static;
        margin-top: 20px;
        justify-content: center;
    }
}