/* ===================== wiki.css ===================== */

/* Base */
body {
	margin: 0 0 70px;
    font-family: Arial, sans-serif;
    background: radial-gradient(circle at top, #140a24, #0b0614 60%);
    color: #f5ecff;
}

/* Header */
header {
    text-align: center;
    margin: 60px auto 30px;
	position: relative;
    max-width: 1200px;
}

.back-button {
	position: absolute;
	left: 8px;
	top: 8px;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    color: #f0dbff;
    text-shadow: 0 0 12px rgba(180, 120, 255, 0.3);
}

/* Main container */
.wiki-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(160deg, #1a0f2b, #120a1f);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(180, 120, 255, 0.15);
    box-shadow: 0 10px 30px rgba(120, 0, 255, 0.2);
    flex-shrink: 0;
}

/* Tree styling */
.tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tree ul {
    padding-left: 20px;
    display: none;
}

.tree ul.open {
    display: block;
}

.tree li {
    margin-bottom: 8px;
    cursor: pointer;
    color: #d8c8ff;
    transition: all 0.2s ease;
}

.tree li:hover {
    color: #f0dbff;
    text-shadow: 0 0 6px rgba(180, 120, 255, 0.4);
}

.folder {
    font-weight: bold;
    display: inline-block;
    position: relative;
}

/* Folder arrow */
.folder::after {
    content: "◂";
    position: absolute;
    right: 0;
    transition: transform 0.3s ease;
    color: #c4a7ff;
}

.folder + ul.open {
    display: block;
}

.folder + ul.open::before {
    content: '';
}

.folder.open::after {
    transform: rotate(90deg);
}

/* Content area */
.content {
    flex: 1;
    background: linear-gradient(160deg, #1a0f2b, #120a1f);
    border-radius: 14px;
    padding: 30px;
    border: 1px solid rgba(180, 120, 255, 0.15);
    box-shadow: 0 10px 30px rgba(120, 0, 255, 0.2);
    min-height: 400px;
    transition: all 0.25s ease;
}

/* Text in content */
.content h2 {
    color: #f0dbff;
    margin-top: 0;
}

.content p, 
.content li {
    line-height: 1.7;
    color: #e9d5ff;
    margin-bottom: 15px;
}

/* Links */
.content a {
    color: #c4a7ff;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.content a:hover {
    color: #f0dbff;
    text-shadow: 0 0 6px rgba(180, 120, 255, 0.4);
}



/* ===================== Wiki Tree Fix ===================== */

/* Remove default bullets and padding */
.sidebar ul,
.sidebar li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Folder spacing */
.tree > li {
    margin-bottom: 16px; /* space between top-level folders */
}

/* Nested folders spacing */
.tree li ul {
    padding-left: 20px;
    margin-top: 8px; /* space above sublist */
}

/* Folder label */
.folder {
    font-weight: bold;
    display: block; /* makes the whole line clickable */
    padding: 4px 0;
    position: relative;
    cursor: pointer;
    color: #d8c8ff;
    transition: all 0.2s ease;
}

/* Folder hover */
.folder:hover {
    color: #f0dbff;
    text-shadow: 0 0 6px rgba(180, 120, 255, 0.4);
}

/* Folder arrow */
.folder::before {
    content: "▸";
    display: inline-block;
    margin-right: 6px;
    color: #c4a7ff;
    transition: transform 0.3s ease;
}

/* Open folder arrow rotation */
.folder.open::before {
    transform: rotate(90deg);
}

/* Items (leaves) */
.tree li[data-page] {
    padding: 4px 0 4px 18px; /* indent for hierarchy */
    color: #c4a7ff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

/* Hover effect for items */
.tree li[data-page]:hover {
    color: #f0dbff;
    text-shadow: 0 0 6px rgba(180, 120, 255, 0.4);
}

/* Optional dot marker for items */
.tree li[data-page]::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #a78bfa;
}

/* Responsive */
@media (max-width: 900px) {
    .wiki-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}
