/* ===========================
   VIEW FORUM
=========================== */

.forum-page{
    margin-top:25px;
}

.forum-card{
    background:#fff;
    border-radius:14px;
    box-shadow:0 2px 12px rgba(0,0,0,.08);
    padding:30px;
}

.forum-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:25px;
    flex-wrap:wrap;
}

.forum-title{
    margin:0;
    font-size:34px;
    font-weight:700;
    color:#222;
}

.forum-description{
    margin-top:20px;
    line-height:1.7;
    font-size:17px;
}

.forum-hidden{
    display:inline-block;
    margin-top:15px;
    padding:7px 14px;
    border-radius:8px;
    background:#fff2d8;
    color:#8a5d00;
    font-weight:600;
}

.forum-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.forum-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;

    padding:12px 22px;

    border:none;
    border-radius:10px;

    text-decoration:none;

    font-size:16px;
    font-weight:600;

    cursor:pointer;

    transition:.2s;
}

.forum-btn:hover{
    transform:translateY(-1px);
}

.forum-btn-primary{
    background:#2d89ef;
    color:#fff;
}

.forum-btn-primary:hover{
    background:#2376d4;
}

.forum-btn-secondary{
    background:#777;
    color:#fff;
}

.forum-btn-secondary:hover{
    background:#5e5e5e;
}

.forum-info{
    margin-top:25px;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:15px;
}

.forum-info-item{
    background:#f7f7f7;
    border-radius:10px;
    padding:15px;
}

.forum-info-title{
    display:block;
    margin-bottom:8px;
    font-weight:700;
}

.forum-topics-title{
    margin-top:40px;
    margin-bottom:20px;
    font-size:28px;
    font-weight:700;
}

.forum-empty{
    background:#f8f9fa;
    border:2px dashed #d8d8d8;
    border-radius:12px;
    padding:45px;
    text-align:center;
}

.forum-empty-title{
    font-size:24px;
    font-weight:700;
    margin-bottom:10px;
}

.forum-empty-text{
    color:#666;
    font-size:17px;
}

.forum-topics-table{
    width:100%;
    border-collapse:collapse;
    margin-top:15px;
}

.forum-topics-table th{
    background:#2d89ef;
    color:#fff;
    padding:14px;
    text-align:left;
    font-weight:600;
}

.forum-topics-table td{
    padding:16px 14px;
    border-bottom:1px solid #ececec;
    vertical-align:middle;
}

.forum-topics-table tbody tr:hover{
    background:#fafafa;
}

.forum-topic-link{
    text-decoration:none;
    color:#222;
    font-weight:700;
    font-size:18px;
}

.forum-topic-link:hover{
    color:#2d89ef;
}

.forum-topic-author{
    color:#555;
    font-size:15px;
}

.forum-topic-date{
    color:#777;
    white-space:nowrap;
}

.forum-topic-replies{
    text-align:center;
    font-weight:700;
}

.forum-topic-last{
    font-size:14px;
    color:#666;
}

.forum-back{
    margin-top:35px;
}

/* CKEditor */

.forum-description img{
    max-width:100%;
    height:auto;
}

.forum-description iframe{
    max-width:100%;
}

/* ===========================
   MOBILE
=========================== */

@media(max-width:900px){

    .forum-header{
        flex-direction:column;
    }

    .forum-actions{
        width:100%;
    }

    .forum-btn{
        width:100%;
    }

}

@media(max-width:700px){

    .forum-card{
        padding:20px;
    }

    .forum-title{
        font-size:28px;
    }

    .forum-topics-table{
        display:block;
        overflow-x:auto;
    }

    .forum-empty{
        padding:30px 20px;
    }

}

/* ===========================
   КНОПКИ АДМІНІСТРАТОРА
=========================== */

.forum-admin-buttons{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.forum-admin-buttons a{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:12px 22px;

    border-radius:10px;

    text-decoration:none;

    font-size:16px;
    font-weight:600;

    transition:.2s;
}

.forum-admin-buttons a:hover{
    transform:translateY(-1px);
}

.forum-edit-btn{
    background:#6c757d;
    color:#fff;
}

.forum-edit-btn:hover{
    background:#565e64;
}

.forum-add-topic-btn{
    background:#2d89ef;
    color:#fff;
}

.forum-add-topic-btn:hover{
    background:#2376d4;
}

.topic-pin{
    margin-right:6px;
}

.topic-locked-message{
    margin-top:6px;
    display:inline-block;
    padding:3px 10px;
    border-radius:5px;
    background:#fff3cd;
    border:1px solid #ffe69c;
    color:#856404;
    font-size:16px;
    font-weight:600;
}

.forum-topic-wrapper{
    display:flex;
    flex-direction:column;
    gap:25px;
}

.forum-topic-card,
.forum-posts-card{
    background:#fff;
    border-radius:10px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
    padding:25px;
}

.forum-topic-header{
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:flex-start;
}

.forum-topic-title{
    margin:0;
    font-size:28px;
}

.forum-topic-info{
    margin-top:20px;
    display:flex;
    flex-wrap:wrap;
    gap:25px;
    color:#666;
}

.forum-posts-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:25px;
}

.forum-post-card{
    border:1px solid #e3e3e3;
    border-radius:10px;
    margin-bottom:20px;
    overflow:hidden;
     scroll-margin-top:90px;

    transition:.3s;
}

.forum-post-card:target{

    border:2px solid #0d6efd;

    background:#eef6ff;

}
.forum-post-card-header{
    background:#f8f8f8;
    padding:15px 20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.forum-post-root-wrapper .forum-post-card-header{

    background:#dceeff;

}

.forum-post-reply-wrapper .forum-post-card-header{

    background:#f2f2f2;

}
@keyframes flashPost{

    0%{

        background:#fff8b5;

    }

    100%{

        background:#fff;

    }

}
.forum-post-author{
    display:flex;
    align-items:center;
    gap:15px;
}

.forum-post-avatar{
    width:48px;
    height:48px;
    border-radius:50%;
    background:#0077cc;
    color:#fff;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:20px;
    font-weight:bold;
}

.forum-post-author-name{
    font-weight:600;
}

.forum-post-date{
    color:#777;
    font-size:14px;
}

.forum-post-content{
    padding:20px;
}


.forum-post-reply-label{
    color:#0077cc;
    font-size:14px;
}

.forum-post-edited{
    color:#999;
    margin-left:8px;
}

.forum-posts-empty{
    text-align:center;
    padding:50px;
}

.forum-posts-empty-icon{
    font-size:46px;
}

.forum-posts-empty-title{
    font-size:22px;
    margin-top:15px;
    font-weight:bold;
}

.forum-posts-empty-text{
    color:#777;
    margin-top:10px;
}

.forum-topic-bottom-actions{
    margin-top:25px;
}


.forum-topic-add-post-btn{
    padding:12px 22px;
    border:none;
    border-radius:8px;
    background:#0077cc;
    color:#fff;
    cursor:pointer;
    font-size:18px;
}

.forum-topic-add-post-btn:hover{
    background:#0061a8;
}

.forum-reply-modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.forum-reply-modal-box{
    background:#fff;
    width:900px;
    max-width:95%;
    border-radius:10px;
    padding:25px;
    max-height:90vh;
overflow-y:auto;
}

.forum-reply-modal-box h3{
    margin-top:0;
}

.forum-reply-to{
    background:#eef6ff;
    border-left:4px solid #2b7cff;
    padding:12px;
    margin:15px 0;
}

.forum-reply-buttons{
    margin-top:20px;
    display:flex;
    justify-content:flex-end;
    gap:10px;
}

.forum-reply-buttons button{
    padding:10px 18px;
    border:none;
    border-radius:6px;
    cursor:pointer;
}

#forumReplyCancel{

    background:#dcdcdc;

    color:#333;

}

#forumReplyCancel:hover{

    background:#c7c7c7;

}

#forumReplySave{

    background:#198754;

    color:white;

}

#forumReplySave:hover{

    background:#157347;

}

.forum-post-footer{

    display:flex;

    gap:10px;

    flex-wrap:wrap;

    margin-top:18px;

}

.forum-post-footer a,
.forum-post-footer button{

    display:inline-flex;

    align-items:center;

    justify-content:center;

    gap:6px;

    border:none;

    border-radius:8px;

    padding:9px 18px;

    font-size:15px;

    font-weight:600;

    cursor:pointer;

    text-decoration:none;

    transition:.2s;

}

/* ---------------- Відповісти ---------------- */

.forum-post-reply-btn{

    background:#0d6efd;

    color:#fff;

}

.forum-post-reply-btn:hover{

    background:#0b5ed7;

}

/* ---------------- Редагувати ---------------- */

.forum-post-edit-btn{

    background:#ffc107;

    color:#212529;

}

.forum-post-edit-btn:hover{

    background:#e0a800;

}

/* ---------------- Видалити ---------------- */

.forum-post-delete-btn{

    background:#dc3545;

    color:#fff;

}

.forum-post-delete-btn:hover{

    background:#bb2d3b;

}

.forum-post-wrapper{

    background:#f3f4f6;

    border:1px solid #d8dde4;

    border-radius:14px;

    padding:18px;

    margin-bottom:22px;

}

.forum-post-root-wrapper{

    background:#eef6ff;

    border:2px solid #b7d7ff;

    border-radius:14px;

    padding:18px;

    margin-bottom:30px;

}

.forum-post-reply-wrapper{

    background:#f7f7f7;

    border-left:5px solid #d4d4d4;

    border-radius:12px;

    padding:16px;

    margin:18px 0 18px 50px;

}


.forum-post-reply-link{

    color:#0d6efd;

    text-decoration:none;

    font-weight:600;

}

.forum-post-reply-link:hover{

    text-decoration:underline;

}

.forum-post-root-wrapper>.forum-post-card{

    background:#ffffff;

    border-left:5px solid #1976d2;

    box-shadow:0 3px 10px rgba(0,0,0,.08);

    margin-bottom:18px;

}

.forum-post-reply-wrapper>.forum-post-card{

    background:#f7f9fc;

    border-left:4px solid #c8d5e8;

}

.forum-post-file-item{
    margin-top:6px;
}

.forum-post-file-item:first-child{
    margin-top:8px;
}

.forum-post-file-link{
    display:inline-block;
}

.forum-unread-dot{
    margin-right:6px;
}

.forum-post-new{
    display:inline-block;
    margin-left:8px;
    padding:2px 8px;
    border-radius:12px;
    background:#e8f8ec;
    color:#188038;
    font-size:12px;
    font-weight:600;
}