html,
body {
    height: 100%
}

body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.avatar {
    border-radius: 100%;
    width: 35px;
    height: 35px;
}

.bigavatar {
    border-radius: 100%;
    width: 100px;
    height: 100px;
}

.navbar-brand img {
    width: 40px;
    margin-right: 10px;
}

.navbar-toggler {
    border: none;
    box-shadow: none !important;
}

main {
    display: flex;
    flex-grow: 1;
    align-items: stretch;
}

sidebar {
    width: 300px;
    padding: 15px;
    background-color: rgba(var(--bs-dark-rgb));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

sidebar div {
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
}

sidebar>div>a {
    text-decoration: none;
    color: var(--bs-body-color);
    opacity: 0.6;
}

sidebar>div>a:hover {
    text-decoration: none;
    opacity: 1;
}

/* Sidebar accordion navigation */
.sidebar-nav-scroll {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bs-body-color);
    opacity: 0.8;
    text-decoration: none;
    transition: opacity 0.2s;
}

.sidebar-nav-link:hover {
    opacity: 1;
    text-decoration: none;
}

.sidebar-nav-link.active {
    opacity: 1;
    color: var(--bs-primary);
}

.sidebar-nav-children {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 12px;
}

.sidebar-nav-child {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: var(--bs-body-color);
    opacity: 0.6;
    text-decoration: none;
    font-size: 0.9em;
    transition: opacity 0.2s;
}

.sidebar-nav-child:hover {
    opacity: 1;
    text-decoration: none;
}

.sidebar-nav-child.active {
    opacity: 1;
    color: var(--bs-primary);
    font-weight: 500;
}

content {
    flex-grow: 1;
    align-items: stretch;
    padding: 15px;
}

@media (max-width: 991px) {
    sidebar {
        width: 70px;
    }

    sidebar i {
        font-size: 200%;
    }

    sidebar span {
        display: none;
    }
}

.select2-container--bootstrap-5 .select2-selection {
    padding: 2px 2px 0px 2px;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    padding: 2px;
}

.select2-container:not(.select2-container--open) .select2-search {
    display: none;
}

.select2-container .select2-search__field {
    width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    margin-bottom: 2px;
    margin-right: 2px;
    padding: 3px;
}

small {
    font-size: 80%;
}

blockquote {
    font-style: italic;
}

hr {
    border: 3px solid var(--bs-yellow);
    margin-top: 35px;
    margin-bottom: 1.5rem;
    opacity: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table-equal {
    table-layout: fixed;
}

.table-equal th,
.table-equal td {
    width: calc(100% / 7);
    text-align: center;
}

table th,
table td {
    border: 1px solid #444;
    padding: 0.5rem;
    text-align: left;
    vertical-align: top;
}

table thead th {
    background-color: var(--bs-light);
    font-weight: bold;
    vertical-align: bottom;
}

h1,
h2,
h3,
h4,
strong,
b {
    color: var(--bs-yellow);
}

/* Page styles */
.monster-content {
    max-width: 1450px;
    margin: 0 auto;
}

.monster-content .card-img-top {
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.page-header {
    background-size: 1450px auto;
    background-position: center;
    background-color: var(--bs-body-bg);
    max-width: 1450px;
    margin: auto;
    min-height: 350px;
    display: flex;
    align-items: flex-end;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

.page-header-content {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem 2rem;
    color: white;
    width: 100%;
}

/* Page children cards */
.page-child-card {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.page-child-card:hover {
    background-color: var(--bs-tertiary-bg);
}

.page-child-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.page-child-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-child-icon {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    background-color: var(--bs-tertiary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    color: var(--bs-primary);
}

.page-child-title {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    font-size: 1.15rem;
    line-height: 1.7;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Page sidebar navigation */
.sidebar-nav .nav-link {
    padding: 0.5rem 1rem;
    color: var(--bs-body-color);
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: var(--bs-gray-100);
    border-left-color: var(--bs-primary);
    color: var(--bs-primary);
}

.sidebar-nav .nav-link .nav-icon {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
}

/* Page tree admin */
.page-tree-item {
    margin-left: 8px;
    padding-left: 0;
}

.page-tree-item:last-child {
    border-left-color: transparent;
}

.page-tree-node {
    border-radius: 4px;
}

.page-tree-node:hover {
    background-color: black;
}

.toggle-btn {
    width: 18px;
    transition: transform 0.2s;
}

.toggle-btn.expanded {
    transform: rotate(90deg);
}

.page-tree-children {
    margin-left: 12px;
}

.drag-handle {
    cursor: move;
}

.drag-handle:hover {
    color: var(--bs-primary) !important;
}

.ui-state-highlight {
    background-color: var(--bs-primary-bg-subtle);
    border: 2px dashed var(--bs-primary);
    border-radius: 4px;
    min-height: 40px;
}

.sortable-drag {
    opacity: 0.8;
    background-color: var(--bs-body-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}