/* Общие стили для форума */
div.forum-info-box {
    padding: 0.5em 1.117em;
    border: none;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.5em;
    margin-bottom: 1em;
    font-family: 'Montserrat', sans-serif;
    animation: fadeIn 0.5s ease-in;
}

div.forum-info-box-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Стили для меню */
div.forum-info-box.modern-forum-menu div.forum-info-box-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
}

/* Стили для страницы правил */
div.forum-info-box:not(.modern-forum-menu) div.forum-info-box-inner {
    flex-direction: column; /* Вертикальное расположение только для правил */
}

/* Бургер-иконка */
div.burger-icon {
    display: none; /* Скрыта на десктопах */
    font-size: 24px;
    cursor: pointer;
    margin-right: 1em;
    color: #333333;
}

/* Пункты меню */
span.forum-menu-item {
    margin-right: 1.5em;
    padding-right: 0.25em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}

span.forum-menu-item a {
    color: #333333;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    padding: 0.2em 0.5em;
    transition: color 0.3s ease;
}

span.forum-menu-item a:hover {
    color: #005B5C;
}

span.forum-menu-item a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #005B5C;
    transition: width 0.3s ease;
}

span.forum-menu-item a:hover::after {
    width: 100%;
}

/* Активный пункт меню */
span.forum-menu-item.active {
    background: #E6F3F3;
    border-radius: 4px;
}

span.forum-menu-item.active a {
    color: #005B5C;
    font-weight: 600;
}

span.forum-menu-item.active a::after {
    content: none; /* Отключить подчеркивание для активного пункта */
}

/* Если активный пункт использует другой класс (например, forum-menu-rules), замените .active на нужный */
span.forum-menu-item.forum-menu-rules { /* Пример для страницы правил */
    /* background: #E6F3F3;
    border-radius: 4px; */
}

span.forum-menu-item.forum-menu-rules a {
    /* color: #005B5C;
    font-weight: 600; */
}

/* Стили для заголовков разделов на странице правил */
div.forum-bold {
    font-weight: 600;
    font-size: 16px;
    color: #333333;
    margin: 1em 0 0.5em;
    text-align: left;
    line-height: 1.5em;
    padding: 0.5em 0;
}

/* Стили для списков на странице правил */
div.forum-info-box:not(.modern-forum-menu) div.forum-info-box-inner ul,
div.forum-info-box:not(.modern-forum-menu) div.forum-info-box-inner ol {
    padding: 0.5em 0 0.5em 2em;
    margin: 0.5em 0;
    list-style-position: outside;
    line-height: 1.6em;
    color: #333333;
}

div.forum-info-box:not(.modern-forum-menu) div.forum-info-box-inner ul li,
div.forum-info-box:not(.modern-forum-menu) div.forum-info-box-inner ol li {
    margin-bottom: 0.5em;
    word-wrap: break-word;
}

/* Menu Items */
span.forum-menu-item-first,
span.forum-menu-item-last {
    border-right: none;
}

/* Breadcrumb */
div.forum-breadcrumb-top,
div.forum-breadcrumb-bottom {
    padding: 0 1.117em 1em;
}

div.forum-breadcrumb {
    line-height: 1.5em;
    font-size: 14px;
    color: #666666;
}

div.forum-breadcrumb span {
    white-space: nowrap;
}

div.forum-breadcrumb a {
    text-decoration: none;
    color: #005B5C;
    transition: color 0.3s ease;
}

div.forum-breadcrumb a:hover {
    color: #003F40;
}

span.forum-crumb-last {
    font-weight: 500;
    color: #333333;
}

/* Header Box */
div.forum-header-box {
    padding: 0 1.117em;
    border: none;
    background: #00a1f1 !important;
    border-radius: 8px;
    margin-bottom: 1em;
}

div.forum-header-title a {
    text-decoration: none;
    color: #005B5C;
    transition: color 0.3s ease;
}

div.forum-header-title a:hover {
    color: #003F40;
}

/* Header Box Right Links */
div.forum-header-options {
    float: right;
    padding: 0.5em 0;
}

div.forum-header-options a {
    color: #005B5C;
    text-decoration: none;
    transition: color 0.3s ease;
}

div.forum-header-options a:hover {
    color: #003F40;
}

/* Header Title */
div.forum-header-title {
    font-size: 18px;
    font-weight: 600;
    padding: 0.462em 5em 0.426em 0;
    color: #333333;
}

/* Main Forum/Topic List Table */
table.forum-table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table.forum-forum-list,
table.forum-topic-list {
    margin-bottom: 1em;
}

/* Table Header */
table.forum-table th {
    font-size: 16px;
    padding: 1em;
    font-weight: 500;
    vertical-align: middle;
    text-align: left;
    background: #F8F9FA;
    color: #333333;
    border-bottom: 1px solid #E9ECEF;
}

/* Table Cell */
table.forum-table td {
    border-bottom: 1px solid #E9ECEF;
    border-right: none;
    vertical-align: top;
    padding: 0.8em 1em;
    color: #333333;
    transition: background 0.3s ease;
}

table.forum-table tr:hover td {
    background: #F1F3F5;
}

/* First Row Cell */
table.forum-table tr.forum-row-first td {
    border-top: none;
}

/* Last Row Cell */
table.forum-table tr.forum-row-last td {
    border-bottom: none;
}

/* Odd Row Cell */
table.forum-table tr.forum-row-odd td {
    background: #FFFFFF;
}

/* Even Row Cell */
table.forum-table tr.forum-row-even td {
    background: #F8F9FA;
}

/* Selected Table Cell and Row */
table.forum-table tr.forum-row-selected td,
table.forum-table td.forum-cell-selected,
table.forum-post-selected td.forum-cell-post,
table.forum-post-selected td.forum-cell-actions {
    background: #E6F3F3;
}

/* Hidden Table Cell and Row */
table.forum-table tr.forum-row-hidden td,
table.forum-table td.forum-cell-hidden,
table.forum-post-hidden td.forum-cell-post,
table.forum-post-hidden td.forum-cell-actions {
    opacity: 0.5;
}

/* Sticky Table Cell and Row */
table.forum-table tr.forum-row-sticky td,
table.forum-table td.forum-cell-sticky {
    background: #FFF3E6;
    font-weight: 500;
}

/* Forum Icon Column */
table.forum-table td.forum-column-icon,
table.forum-table td.forum-column-alone {
    padding: 0;
    border-left: none;
}

div.forum-icon-container {
    width: 3.3em;
    text-align: center;
}

/* Forum Topic Icons */
div.forum-icon {
    height: 20px;
    width: 20px;
    margin: 0.667em auto;
    background-size: cover;
    transition: transform 0.3s ease;
}

div.forum-icon:hover {
    transform: scale(1.2);
}

/* Forum/Topic Title Column */
table.forum-table th.forum-column-title,
table.forum-table td.forum-column-title {
    width: 66%;
    text-align: left;
    padding-left: 1.117em;
}

table.forum-table td.forum-column-title {
    line-height: 1.4em;
    padding: 0;
}

div.forum-item-info {
    padding: 10px 14px;
}

div.forum-item-subforums {
    line-height: 1.4em;
    margin-top: 0.9em;
    color: #666666;
}

span.forum-status-sticky,
span.forum-status-closed {
    font-weight: 600;
    color: #005B5C;
}

span.forum-item-desc-sep {
    vertical-align: middle;
    font-size: 14px;
    color: #666666;
}

div.forum-moderator-stat {
    margin-top: 0.9em;
    color: #666666;
}

div.forum-moderator-stat span {
    font-weight: 600;
    color: #333333;
}

table.forum-table td.forum-column-topics,
table.forum-table td.forum-column-replies,
table.forum-table td.forum-column-views {
    text-align: center;
    padding: 1em 0.5em;
    font-size: 14px;
}

table.forum-table th.forum-column-topics,
table.forum-table th.forum-column-replies,
table.forum-table th.forum-column-views {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

/* Last Post Cells */
table.forum-table th.forum-column-lastpost,
table.forum-table td.forum-column-lastpost {
    padding: 0;
    width: 30%;
    text-align: left;
}

table.forum-table td.forum-column-lastpost {
    line-height: 1.4em;
}

div.forum-lastpost-box {
    padding: 10px 14px;
}

span.forum-lastpost-date,
span.forum-lastpost-title {
    display: block;
    color: #666666;
}

span.forum-lastpost-title a {
    color: #005B5C;
    text-decoration: none;
    transition: color 0.3s ease;
}

span.forum-lastpost-title a:hover {
    color: #003F40;
}

/* Forum and Topic Checkbox */
div.forum-select-box {
    float: right;
    padding: 0.1em;
    text-align: center;
}

/* Table Footer and Alone Footer Box */
table.forum-table td.forum-column-footer,
table.forum-post-table td.forum-column-footer,
div.forum-footer-box {
    padding: 0.5em 1em;
    border: none;
    background: #F8F9FA;
    line-height: 1.5em;
    border-radius: 0 0 8px 8px;
}

div.forum-footer-box {
    margin-bottom: 1em;
}

table.forum-table td.forum-column-footer {
    border-top: none;
}

div.forum-footer-inner {
    text-align: center;
}

span.forum-footer-option {
    margin-left: 0.5em;
    padding-left: 0.5em;
    border-left: 1px solid #E9ECEF;
}

span.forum-footer-option-first {
    border-left: none;
}

span.forum-footer-rss {
    background: transparent url(images/feed-icon.png) no-repeat scroll left center;
    padding-left: 20px;
    padding-top: 2px;
}

/* Birthdays and Users Online */
div.forum-users-online,
div.forum-users-birthday {
    padding: 0.5em 1em;
    background: #FFFFFF;
    border-radius: 8px;
    margin-bottom: 1em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

div.forum-users-online span,
div.forum-users-birthday span {
    font-weight: 600;
    color: #333333;
}

/* Statistics Box */
div.forum-statistics {
    padding: 0.5em 1em;
    background: #FFFFFF;
    border-radius: 8px;
    margin-bottom: 1em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

div.forum-statistics-allusers,
div.forum-statistics-users,
div.forum-statistics-topics,
div.forum-statistics-replies {
    color: #666666;
}

div.forum-statistics span {
    font-weight: 600;
    color: #333333;
}

/* Page Navigation */
div.forum-navigation-box {
    padding: 0 1.117em;
    border: none;
    background: #FFFFFF;
    border-radius: 8px;
    line-height: 1.5em;
    margin-bottom: 1em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

div.forum-page-navigation {
    float: left;
    padding: 0.5em 0;
}

div.forum-navigation-top {
    border-bottom: none;
}

div.forum-navigation-bottom {
    border-top: none;
    margin-bottom: 1em;
}

div.forum-page-navigation a,
span.forum-page-current,
span.forum-page-dots {
    border-left: 1px solid #E9ECEF;
    padding-left: 0.75em;
    padding-right: 0.5em;
    text-decoration: none;
    color: #005B5C;
    transition: color 0.3s ease;
}

div.forum-page-navigation a:hover {
    color: #003F40;
}

div.forum-page-navigation a.forum-page-previous {
    border-right: 1px solid #E9ECEF;
    border-left: none;
}

div.forum-page-navigation a.forum-page-first,
div.forum-page-navigation span.forum-page-first {
    border-left: none;
    padding-left: 0.5em;
}

span.forum-page-current {
    font-weight: 600;
    color: #333333;
}

div.forum-new-post {
    float: right;
    padding: 0.5em 0;
    font-weight: 600;
    color: #005B5C;
}

/* Topic Posts Table */
table.forum-post-table {
    width: 100%;
    line-height: 1.5em;
    border-collapse: collapse;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

table.forum-post-table td {
    padding: 0;
    vertical-align: top;
    border-bottom: 1px solid #E9ECEF;
}

/* Post Table: User Info and User Contacts Cells */
table.forum-post-table td.forum-cell-user,
table.forum-post-table td.forum-cell-contact {
    width: 200px;
    border-right: 1px solid #E9ECEF;
    border-left: none;
    background: #F8F9FA;
}

/* Post Table: Post and Actions Cell */
table.forum-post-table td.forum-cell-post,
table.forum-post-table td.forum-cell-actions {
    border-right: none;
}

table.forum-post-table td.forum-cell-contact,
table.forum-post-table td.forum-cell-actions {
    border-top: 1px dashed #E9ECEF;
    height: 2.5em;
}

div.forum-post-date,
div.forum-post-entry {
    padding: 0.8em 1em;
    font-size: 16px;
    color: #333333;
}

div.forum-post-date {
    border-bottom: 1px dashed #E9ECEF;
    color: #666666;
}

div.forum-post-number {
    float: right;
}

div.forum-post-number a {
    color: #005B5C;
    transition: color 0.3s ease;
}

div.forum-post-number a:hover {
    color: #003F40;
}

div.forum-post-number span {
    font-weight: 600;
}

div.forum-post-text {
    padding: 0.8em 0;
}

/* Post Attachments */
div.forum-post-attachments {
    margin: 1.5em 0;
    padding: 0.8em 1em;
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    background: #F8F9FA;
}

div.forum-post-attachments fieldset .forum-attach {
    margin: 1.2em 1.2em 0 0;
}

div.forum-post-lastedit {
    padding: 0.5em 0;
    font-style: italic;
    color: #666666;
}

span.forum-post-lastedit-user {
    font-weight: 600;
    color: #333333;
}

/* User Signature */
div.forum-user-signature {
    margin-top: 1em;
    color: #666666;
}

div.forum-signature-line {
    border-top: 1px solid #E9ECEF;
    width: 200px;
    height: 1px;
}

div.forum-user-signature span {
    line-height: 0.95em;
    padding-top: 0.5em;
    display: block;
    font-size: 14px;
}

div.forum-user-info {
    padding: 0.8em 1em 1.5em;
}

div.forum-user-avatar {
    margin: 0.5em 0;
}

div.forum-user-status {
    margin-bottom: 6px;
    color: #666666;
}

div.forum-user-additional {
    font-size: 14px;
    color: #666666;
}

div.forum-user-name span {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
}

span.forum-vote-user a,
div.forum-user-name a {
    text-decoration: none;
    color: #005B5C;
    transition: color 0.3s ease;
}

span.forum-vote-user a:hover,
div.forum-user-name a:hover {
    color: #003F40;
}

div.forum-contact-links,
div.forum-action-links {
    padding: 0.5em 1em;
}

div.forum-action-links span a {
    color: #005B5C;
    text-decoration: none;
    transition: color 0.3s ease;
}

div.forum-action-links span a:hover {
    color: #003F40;
}

/* BBCode: List */
div.forum-post-text ul,
div.forum-post-text ol {
    padding: 0.5em 0 0.5em 2em;
    margin: 0.5em 0;
    list-style-position: outside;
    line-height: 1.6em;
}

div.forum-post-text ul li,
div.forum-post-text ol li {
    margin-bottom: 0.5em;
}

/* BBCode: Quote and Code */
table.forum-quote,
table.forum-spoiler,
table.forum-code {
    font-size: 16px;
    width: 100%;
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    background: #F8F9FA;
}

table.forum-code pre {
    margin: 0;
    padding: 0.5em;
    overflow: auto;
}

table.forum-quote th,
table.forum-spoiler th,
table.forum-code th {
    font-weight: 600;
    padding: 0.5em 1em;
    text-align: left;
    background: #E9ECEF;
}

table.forum-quote td,
table.forum-spoiler td,
table.forum-code td {
    padding: 0.9em 1em;
}

div.forum-code-box {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    margin: 0.5em 0;
    background: #F8F9FA;
}

div.forum-code-box ol {
    margin-left: 3em;
    padding: 0.5em 0;
}

div.forum-code-box ol li {
    list-style: decimal-leading-zero;
    padding: 0 0.5em 0 1.5em;
    line-height: 1.5em;
}

/* Reply Form */
div.forum-reply-form {
    border: none;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1em;
}

div.forum-reply-header {
    font-size: 18px;
    padding: 0.8em 1.117em;
    background: #F8F9FA;
    border-radius: 8px 8px 0 0;
    color: #333333;
}

div.forum-note-box {
    border: 1px solid #E9ECEF;
    margin: 1.117em;
    padding: 0.8em 1.117em;
    border-radius: 8px;
    background: #F8F9FA;
}

div.forum-reply-fields {
    padding: 0 1em 0.8em;
}

div.forum-reply-field input,
div.forum-reply-field textarea {
    border: 1px solid #E9ECEF;
    border-radius: 5px;
    padding: 0.5em;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

div.forum-reply-field input:focus,
div.forum-reply-field textarea:focus {
    border-color: #005B5C;
    outline: none;
}

div.forum-reply-buttons input {
    background: #005B5C;
    color: #FFFFFF;
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    font-size: 16px;
    transition: background 0.3s ease;
}

div.forum-reply-buttons input:hover {
    background: #003F40;
}

/* Скрытие кнопки "Просмотр" */
div.forum-reply-form input[name="view_button"] {
    display: none !important;
}

/* Autosave */
a.postFormAutosave {
    float: right;
    width: 18px;
    height: 18px;
    margin: 0 -4px 0 0;
}

a.postFormAutosave.bx-core-autosave {
    background-position: 0 0;
}

a.postFormAutosave.bx-core-autosave-ready {
    background: transparent url("images/autosave/autosave-green.gif") no-repeat 0 0;
}

a.postFormAutosave.bx-core-autosave-edited {
    background: transparent url("images/autosave/autosave-red.gif") no-repeat 0 0;
}

a.postFormAutosave.bx-core-autosave-saving {
    background: transparent url("images/autosave/autosave-write.gif") no-repeat 0 0;
}

/* Notify Bar */
.forum-notify-bar {
    background: #FFF3E6;
    border-radius: 8px;
    height: 2em;
    position: relative;
}

.forum-notify-close {
    display: block;
    height: 12px;
    margin: 3px 6px 0 0;
    position: absolute;
    right: 5px;
    top: 5px;
    width: 12px;
}

.forum-notify-close a {
    background: url("/bitrix/js/main/core/images/panel/sprite04.png") no-repeat scroll -268px -243px transparent;
    display: block;
    height: 12px;
    width: 12px;
    cursor: pointer;
}

.forum-notify-text {
    color: #333333;
    padding: 3px 20px 5px;
    text-align: center;
}

.forum-notify-text a.postFormAutorestore {
    color: #005B5C;
    text-decoration: none;
    margin-right: 9px;
    margin-top: 5px;
    position: relative;
    z-index: 2;
}

.forum-notify-text a.postFormAutorestore:hover {
    color: #003F40;
}

/* Icons */
table.forum-icons td {
    white-space: nowrap;
    padding: 0.4em;
}

table.forum-icons .forum-icon-empty {
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    width: 16px;
    height: 16px;
}

/* Moved Topic List */
div.forum-topic-move {
    clear: both;
    margin: 0.5em 0;
    width: 100%;
}

div.forum-topic-move input {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1em;
    height: 1.55em;
    margin: 0 0 0 -0.25em;
    width: 1.55em;
}

div.forum-topic-move label,
div.forum-topic-move a {
    display: block;
    margin-left: 1.8em;
}

div.forum-topic-move-buttons {
    margin-top: 1em;
}

div.forum-topic-move-buttons select {
    width: 200px;
    font-size: 1.184em;
}

div.forum-topic-move-buttons input {
    font-size: 1.184em;
    padding: 0 1em;
}

/* Forum Action Note */
.forum-action-note {
    float: right;
    font-style: italic;
    padding: 0.5em 1.5em 0.5em 1em;
}

/* Popup Image */
div.forum-popup-image div.empty {
    background-image: url("images/close.gif");
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: 0;
}


/*Скрываем статистику */

div.forum-statistics {
    display: none;
}

.forum-user-online {
    display: none !important;
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Adaptive Styles */
@media (max-width: 767px) {
    div.forum-info-box {
        padding: 0.5em;
    }

    div.forum-info-box.modern-forum-menu div.forum-info-box-inner {
        flex-wrap: wrap !important;
    }

    div.burger-icon {
        display: inline-block;
    }

    span.forum-menu-item {
        margin-right: 0.5em;
        margin-bottom: 0.5em;
    }

    /* Для бургер-меню на мобильных */
    div.forum-info-box.modern-forum-menu.active div.forum-info-box-inner {
        flex-direction: column !important;
        display: none;
    }

    div.forum-info-box.modern-forum-menu.active div.forum-info-box-inner.active {
        display: flex;
    }

    table.forum-table {
        display: block;
        overflow-x: auto;
    }

    table.forum-table th,
    table.forum-table td {
        font-size: 14px;
        padding: 0.5em;
    }

    div.forum-reply-field-author,
    div.forum-reply-field-email {
        width: 100%;
        margin-bottom: 0.5em;
    }

    div.forum-info-box:not(.modern-forum-menu) .forum-info-box-inner ul,
    div.forum-info-box:not(.modern-forum-menu) .forum-info-box-inner ol {
        padding-left: 1.5em;
    }
}