.section {
    background: var(--bs-body-bg);
    padding: 15px;
    overflow: hidden;
    --bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

.section-body {
    padding: 0.25rem 0;
    margin: 0.25rem 0;
    overflow: hidden;
}

.section-header {
    padding-bottom: 0.5rem;
}

.section-footer {
    padding: 0.25rem 0;
    margin: 0.25rem 0;
}

.section-content {

}

.section-message {
    overflow-wrap: break-word;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 2;
}

.section-form {
    background: var(--base-bg);
    padding: 15px;
    --bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

.section-media {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.avatar-default {
    height: 64px;
    width: 64px;
    text-align: center;
    font-size: 42px;
    display: inline-block;
    font-weight: bold;
    text-decoration: none;
    color: #fff;
}

.avatar-mini > .avatar-default {
    height: 32px;
    width: 32px;
    font-size: 21px;
}

.avatar-micro > .avatar-default {
    height: 20px;
    width: 20px;
    font-size: 14px;
}

.user-avatar {
    width: 64px;
    height: 64px;
    float: left;
    margin-right: 14px;
}

.user-status {
    width: 18px;
    height: 18px;
    position: relative;
    border-radius: 50%;
    z-index: 1;
    border: 2px solid #fff;
    left: 44px;
    bottom: 18px;
}

@media (max-width: 768px) {
    .section, .section-form {
        margin: 0 -15px;
    }

    .user-avatar {
        width: 48px;
        height: 48px;
        margin-right: 10px;
    }

    .user-status {
        width: 14px;
        height: 14px;
        left: 32px;
        bottom: 14px;
    }

    .avatar-default {
        height: 48px;
        width: 48px;
        font-size: 32px;
    }

    .section-user {
        min-height: 48px;
    }
}

.cursor-pointer {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
}

.media-file {
    max-width: 600px;
    margin-bottom: 1rem;
}

.media-file img,
.media-file video {
    max-height: 450px;
}

.carousel {
    position: relative;
    display: inline-block;
}

.carousel-control-prev,
.carousel-control-next {
    width: 35px;
    height: 35px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    margin: 10px;
}

.blockquote:before {
    content: "\f10e";
    font: var(--fa-font-solid);
    font-size: 1.4em;
    float: left;
    margin-right: 10px;
    color: #c73401;
}

.blockquote {
    padding: 8px 15px;
    font-size: 90%;
    background: var(--base-bg);
    border-left: 5px solid;
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    font-style: italic;
    margin: 0.5rem 0;
}

.blockquote-footer {
    margin: 0;
}

.is-invalid .form-control,
.is-invalid .form-select,
.is-invalid .input-group-text {
    border-color: var(--bs-form-invalid-border-color);
}

.is-invalid .form-control:focus,
.is-invalid .form-select:focus {
    border-color: var(--bs-form-invalid-border-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.is-invalid .invalid-feedback {
    display: block;
}

.is-valid .form-control,
.is-valid .form-select,
.is-valid .input-group-text {
    border-color: var(--bs-form-valid-border-color);
}

.is-valid .form-control:focus,
.is-valid .form-select:focus {
    border-color: var(--bs-form-valid-border-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.spoiler {
    margin-bottom: 5px;
}

.spoiler:before {
    content: "\f0da";
    font: var(--fa-font-solid);
    font-size: 13px;
    color: #bbb;
    margin: 0 5px 0 2px;
}

.spoiler.spoiler-open:before {
    content: "\f0d7";
    font: var(--fa-font-solid);
    font-size: 13px;
    color: #bbb;
    margin: 0 5px 0 2px;
}

.spoiler-title {
    border-bottom: 1px dashed;
    color: #6da3bd;
    cursor: pointer;
    font-weight: normal;
}

.spoiler-text {
    padding: 10px 15px;
    margin: 0.5rem 0;
    background-color: var(--base-bg);
}

.hidden-text {
    padding: 10px;
    margin: 0.5rem 0;
    background-color: var(--base-bg);
    font-size: 90%;
}
.section-action {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 3px;
}

.post-rating-up.active {
    color: #fff;
    background-color: #78c062;
    padding: 0 1px;
    display: inline-block;
    border-radius: 3px;
}

.post-rating-down.active {
    color: #fff;
    background-color: #f75c48;
    padding: 0 1px;
    display: inline-block;
    border-radius: 3px;
}

.scrollup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    cursor: pointer;
    opacity: .2;
}

.scrollup:before {
    content: "\f139";
    font: var(--fa-font-solid);
    font-size: 30px;
}

.scrollup:hover {
    opacity: .5;
}

.message-block {
    overflow: hidden;
    cursor: pointer;
}

.message-block:hover,
.message-block:focus {
    background-color: var(--base-bg);
}

.pagination {
    overflow-y: hidden;
}

@media (max-width: 768px) {
    .pagination .page-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.7875rem;
        line-height: 1.5;
    }
}

.performance {
    background-color: var(--base-bg);
    border: 1px solid var(--bs-border-color);
    margin: 10px 0;
    padding: 10px;
}

.performance .list-inline {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .performance {
        font-size: 0.75rem;
    }
}

.stretched-link[aria-expanded=true] .treeview-indicator {
    transform: rotate(180deg);
}

.progress {
    position: relative;
    max-width: 500px;
    height: 15px;
    margin-bottom: 10px;
}

.pre-scrollable {
    max-height: 340px;
}

.form-required .form-label:after {
    content: "*";
    color: red;
}

/* Surprise */
.surprise-container {
    width: 50px;
    height: 50px;
    position: relative;
    cursor: pointer;
    -webkit-flex: none;
    flex: none;
    margin-right: 5px;
}

.surprise-ded {
    position: absolute;
    top: -3px;
    left: 0;
    z-index: 2;
}

.surprise-glasses {
    position: absolute;
    top: 24px;
    left: 9px;
    z-index: 3;
    -webkit-transform: translate(0, 0) rotate(
        5deg);
    transform: translate(0, 0) rotate(
        5deg);
    transition: 0.3s transform ease-out, 0.3s -webkit-transform ease-out;
}

.surprise-background {
    position: absolute;
    top: -15px;
    left: -15px;
    opacity: 0;
    transition: 0.3s opacity ease-out;
}

.surprise-container:hover .surprise-background {
    opacity: 1;
}

.surprise-container:hover .surprise-glasses {
    -webkit-transform: translate(-2px, -5px) rotate(
        -10deg);
    transform: translate(-2px, -5px) rotate(
        -10deg);
}

/* Fix input width in form-group */
.form-control-color {
    max-width: 3rem;
}

.thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin: 3px 0;
}

.slide-main img {
    width: auto;
    margin: 0 auto 5px;
}

.slide-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.slide-thumbnails img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.slide-thumbnails img:hover {
    transform: scale(1.1);
}

.slide-thumb-image.active {
    border: 2px solid #0d6efd !important;
    border-radius: 3px;
    box-shadow: 0 0 5px rgba(13, 110, 253, 0.5);
}

:target {
    animation: highlight-fade 2s ease-out;
}

@keyframes highlight-fade {
    0% {
        background-color: rgba(150, 200, 255, 0.6);
    }
    100% {
        background-color: transparent;
    }
}

.section-content.short-view {
    overflow: hidden;
    position: relative;
    max-height: 500px;
}

.section-content.short-view.clamped::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(
        to top,
        var(--bs-body-bg) 15%,
        transparent 100%
    );
    pointer-events: none;
}

.section-content.short-view:not(.clamped)::after,
.section-content.short-view.expanded::after {
    display: none;
}

.section-content.short-view.expanded {
    max-height: none;
}
