/* ============================================================
   WEBBOARD GENERAL & LAYOUT
   ============================================================ */
.wb-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid #eee; }
.badge-sticky { background-color: #f39c12; color: #fff; font-size: 11px; padding: 3px 8px; margin-right: 5px; }

@media (max-width: 991px) {
    #sidebar.sidebar {
        display: block !important;
        position: static !important;
        width: 100% !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding-top: 30px;
    }
    #sidebar aside {
        margin-bottom: 30px;
        clear: both;
    }
}

/* ============================================================
   TOPIC CONTENT & COMMENTS (Single Page)
   ============================================================ */
.topic-content { background: #fff; padding: 25px; border-radius: 8px; border: 1px solid #eee; }
.topic-img { max-width: 100%; border-radius: 8px; margin: 20px 0; }
.comment-item { background: #fdfdfd; padding: 20px; border-radius: 8px; border: 1px solid #eee; margin-top: 15px; }
.user-info { display: flex; align-items: center; margin-bottom: 15px; }
.user-info img { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; border: 2px solid #00b900; }

/* ============================================================
   REPLY BOX & FORM ELEMENTS
   ============================================================ */
.reply-box { 
    margin-top: 40px; 
    padding: 30px; 
    background: #fff; 
    border-radius: 15px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #f1f1f1;
}

.reply-box h5 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.reply-box h5 i {
    margin-right: 10px;
    color: var(--color-primary);
    font-size: 20px;
}

/* ฟอร์มสไตล์ PawThai (ใช้กับหน้าสร้างกระทู้และตอบกระทู้) */
.form-container {
    background: #fff;
    padding: 40px;
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    margin-bottom: 30px;
}

.form-container .form-control, .reply-box .form-control {
    border-radius: 12px !important;
    border: 2px solid #f3f3f3 !important;
    padding: 12px 15px !important;
    height: auto !important;
    background: #fafafa !important;
    transition: all 0.3s ease;
    resize: none;
}

.form-container .form-control:focus, .reply-box .form-control:focus {
    border-color: #ff7b00 !important;
    background: #fff !important;
    box-shadow: 0 5px 15px rgba(255, 123, 0, 0.1) !important;
    outline: none;
}

/* ============================================================
   IMAGE UPLOAD & PREVIEW
   ============================================================ */
.image-preview-box {
    width: 100%;
    height: 250px;
    border: 2px dashed #ddd !important;
    border-radius: 15px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fdfdfd;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.image-preview-box:hover { border-color: #ff7b00 !important; background: #fff5ed; }
#previewImg { display: none; max-width: 100%; max-height: 100%; object-fit: contain; }

/* ซ่อน Placeholder เมื่อมีรูป */
.image-preview-box.has-image .placeholder-content,
.image-preview-box.has-image i,
.image-preview-box.has-image .placeholder-text {
    display: none !important;
}

/* ============================================================
   BUTTONS (PawThai Signature)
   ============================================================ */
.btn-publish, .btn-reply, .btn-create-topic {
    background: linear-gradient(45deg, #ff7b00, #ffaa00) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.btn-publish { padding: 15px 40px !important; border-radius: 50px !important; width: 100%; box-shadow: 0 8px 20px rgba(255, 123, 0, 0.25); }
.btn-reply { padding: 12px 30px; border-radius: 50px; box-shadow: 0 8px 15px rgba(255, 123, 0, 0.25); }
.btn-create-topic { padding: 10px 25px; border-radius: 50px; box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3); font-size: 15px; }

.btn-publish:hover, .btn-reply:hover, .btn-create-topic:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(255, 123, 0, 0.35);
    background: linear-gradient(45deg, #ff8c1a, #ffb81a) !important;
}

/* ============================================================
   ARTICLE LIST & SIDEBAR NAV
   ============================================================ */
.article-list .inner { padding: 8px 0; border-bottom: 1px solid #f1f1f1; display: flex; align-items: center; }
.article-list .details h1 { font-size: 16px !important; margin: 0 0 2px 0 !important; line-height: 1.4; }
.article-list .inner img { width: 30px !important; height: 30px !important; margin-right: 12px !important; }

.nav-stacked li:hover { background-color: #f8fdff; }
.nav-stacked li:hover a { color: #48a1ad !important; padding-left: 10px !important; }
.nav-stacked li a { transition: all 0.2s ease-in-out; }

/* ============================================================
   PAGINATION (Custom Responsive)
   ============================================================ */
.pagination-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 30px 0 20px 0;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

.pagination-wrap .pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; list-style: none; padding: 0; }

.pagination-wrap .pagination > li > a,
.pagination-wrap .pagination > li > span {
    display: inline-flex; align-items: center; justify-content: center;
    height: 38px; min-width: 38px; padding: 0 12px;
    border: 1px solid #e0e0e0; border-radius: 8px !important;
    background-color: #fff; color: #48a1ad; font-size: 14px; font-weight: 500;
    transition: all 0.2s ease; float: none;
}

.pagination-wrap .pagination > li.active > a,
.pagination-wrap .pagination > li.active > span {
    background-color: #48a1ad; border-color: #48a1ad; color: #fff; font-weight: 700;
}

.pagination-wrap .pagination > li:not(.active):not(.disabled) > a:hover {
    background-color: #48a1ad; color: #fff; transform: translateY(-2px);
}

.pagination-wrap .pagination > li:first-child > a,
.pagination-wrap .pagination > li:last-child > a { padding: 0 16px; font-weight: 600; background-color: #f9f9f9; width: auto; }

@media (max-width: 480px) {
    .pagination-wrap .pagination > li > a { height: 34px; min-width: 34px; font-size: 12px; padding: 0 8px; }
}

/* ============================================================
   OTHERS
   ============================================================ */
.required { color: #e74c3c; margin-left: 3px; }
.login-prompt { padding: 30px; border: 2px dashed #ddd; border-radius: 15px; background: #fdfdfd; }