/* =============================================================================
   NEWS / FORUM MODULE - CSS (Theme-Compatible Rewrite)
   All colors use CSS variables. No [data-theme="dark"] selectors.
   @version 3.0.0
   ============================================================================= */

/* ---- Page Container ---- */
.news-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

@media (max-width: 480px) {
    .news-page {
        padding: 0;
    }
}

.news-wrapper {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 15px;
    border: 1px solid var(--border-light);
}

@media (max-width: 480px) {
    .news-wrapper {
        padding: 8px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* ---- Header ---- */
.news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--accent);
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px var(--accent-light);
}

@media (max-width: 480px) {
    .news-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .news-header h1 {
        font-size: 16px;
    }
}

.news-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-header h1 i {
    font-size: 22px;
}

.news-count {
    color: var(--accent-text);
    opacity: 0.8;
    font-size: 13px;
    margin-left: 12px;
}

.news-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: color-mix(in srgb, var(--accent-text) 20%, transparent);
    color: var(--accent-text);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s;
    backdrop-filter: blur(4px);
    border: 1px solid color-mix(in srgb, var(--accent-text) 25%, transparent);
}

.news-create-btn:hover {
    background: color-mix(in srgb, var(--accent-text) 35%, transparent);
    transform: translateY(-1px);
}

/* ---- Back Button ---- */
.news-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-readable);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background .2s;
}

.news-back-btn:hover {
    background: var(--accent-light);
}

/* ---- Empty State ---- */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.news-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: var(--text-muted);
    opacity: 0.5;
}

.news-empty p {
    font-size: 15px;
}

/* ---- Post Card (List) ---- */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-body);
    border-radius: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    transition: all .2s;
    position: relative;
}

.news-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-light);
    transform: translateX(3px);
}

.news-card-pinned {
    border-left: 4px solid var(--accent);
    background: var(--accent-light);
}

.news-card-locked {
    opacity: .85;
}

.news-cat-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
    vertical-align: middle;
    margin-bottom: 2px;
}

/* Badges */
.news-card-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.news-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.news-badge-pin {
    background: var(--accent);
    color: #fff;
}

.news-badge-lock {
    background: #64748b;
    color: #fff;
}

/* Card Body — compact row layout */
.news-card-body {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.news-card-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
}

.news-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.news-card-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-card-preview {
    display: none;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.news-card-meta::-webkit-scrollbar {
    display: none;
}

.news-card-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.news-card-stats {
    display: flex;
    gap: 10px;
}

.news-card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.news-card-thumb {
    display: none;
}

.news-card-badges {
    display: none;
}

@media (max-width: 480px) {
    .news-card {
        padding: 4px 8px !important;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-light);
        background: var(--bg-card);
    }

    .news-card:hover {
        transform: none;
        box-shadow: none;
    }

    .news-card-body {
        gap: 8px !important;
    }

    .news-cat-tag {
        font-size: 9px !important;
        padding: 1px 5px !important;
        margin: 0 !important;
    }

    .news-card-title {
        font-size: 13px !important;
    }

    .news-card-meta {
        font-size: 10px !important;
    }

    .news-card-avatar {
        width: 26px !important;
        height: 26px !important;
    }

    .news-list {
        gap: 0 !important;
    }
}

.news-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Pagination ---- */
.news-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.news-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s;
}

.news-page-btn:hover {
    border-color: var(--accent);
    color: var(--accent-readable);
}

.news-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===========================================================================
   ARTICLE (Single Post)
   =========================================================================== */
.news-article {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.news-article-badges {
    margin-bottom: 8px;
    display: flex;
    gap: 6px;
}

.news-article-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 8px 0 0;
    line-height: 1.35;
}

/* Hero Image */
.news-hero-image {
    margin: -20px -20px 0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    cursor: zoom-in;
    max-height: 400px;
}

.news-hero-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-hero-image:hover img {
    transform: scale(1.02);
}

/* Article Header */
.news-article-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.news-article-header .news-article-badges {
    margin-bottom: 10px;
}

/* Author Strip */
.news-author-strip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.news-strip-avt {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}

.news-strip-info-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.news-strip-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.news-strip-name {
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

.news-strip-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--text-secondary);
}

.news-strip-details i {
    font-size: 10px;
    margin-right: 3px;
    opacity: 0.7;
}

.news-strip-details .fa-star {
    opacity: 1;
}

.news-strip-bio {
    font-style: italic;
    color: var(--text-muted);
    font-size: 11px;
}

.news-strip-clan-role {
    font-weight: 600;
    color: var(--accent-readable);
    font-size: 11px;
}

.news-strip-clan-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    border-radius: 2px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.news-strip-point-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    border-radius: 2px;
    object-fit: contain;
}




.news-author-name {
    font-weight: 700;
    text-decoration: none;
}

/* Content Frame */
.news-content-frame {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px 18px;
}

/* Author info inside content frame */
.news-author-inside {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.news-author-inside .news-strip-avt {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.news-author-inside .news-strip-name {
    font-size: 14px;
}

.news-author-inside .news-forum-rank {
    width: fit-content;
}

/* Divider between author and content */
.news-frame-divider {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 12px 0;
}

/* Content */
.news-article-content {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-primary);
    white-space: pre-line;
    word-break: break-word;
}

/* Post Image inside frame — single image */
.news-content-frame .news-post-image {
    margin-top: 14px;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    text-align: center;
}

.news-content-frame .news-post-image img {
    max-width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* Post Images — adaptive multi-image grid */
.news-post-images {
    margin-top: 14px;
    display: grid;
    gap: 6px;
    border-radius: 10px;
    overflow: hidden;
}

/* 1 image */
.news-post-images[data-count="1"] {
    grid-template-columns: 1fr;
}

/* 2 images — side by side */
.news-post-images[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}

/* 3 images — 1 large left + 2 stacked right */
.news-post-images[data-count="3"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.news-post-images[data-count="3"] .news-grid-img:first-child {
    grid-row: 1 / 3;
}

/* 4 images — 2x2 */
.news-post-images[data-count="4"] {
    grid-template-columns: 1fr 1fr;
}

/* 5+ images — 3 columns auto */
.news-post-images[data-count="5"],
.news-post-images[data-count="6"],
.news-post-images[data-count="7"],
.news-post-images[data-count="8"],
.news-post-images[data-count="9"],
.news-post-images[data-count="10"] {
    grid-template-columns: repeat(3, 1fr);
}

.news-grid-img {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: zoom-in;
    background: var(--bg-hover);
    aspect-ratio: 1;
}

.news-post-images[data-count="1"] .news-grid-img {
    aspect-ratio: auto;
    max-height: 450px;
}

.news-post-images[data-count="2"] .news-grid-img {
    aspect-ratio: 4/3;
}

.news-grid-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-grid-img:hover img {
    transform: scale(1.05);
}

.news-post-images[data-count="1"] .news-grid-img img {
    object-fit: contain;
    max-height: 450px;
}

/* Upload preview grid for news create/edit */
.news-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.news-upload-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: var(--bg-hover);
}

.news-upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-upload-item .news-upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    text-align: center;
    padding: 2px 0;
    font-weight: 600;
}

.news-upload-item .news-upload-progress.done {
    background: #22c55e;
}

.news-upload-item .news-upload-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background 0.2s;
}

.news-upload-item .news-upload-remove:hover {
    background: #ef4444;
}

@media (max-width: 480px) {
    .news-post-images[data-count="3"] {
        grid-template-columns: 1fr 1fr;
    }

    .news-post-images[data-count="5"],
    .news-post-images[data-count="6"],
    .news-post-images[data-count="7"],
    .news-post-images[data-count="8"],
    .news-post-images[data-count="9"],
    .news-post-images[data-count="10"] {
        grid-template-columns: 1fr 1fr;
    }

    .news-upload-item {
        width: 80px;
        height: 80px;
    }
}

/* Meta (time + views) bottom-right */
.news-content-meta {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-light);
    font-size: 11px;
    color: var(--text-muted);
}

.news-content-meta i {
    font-size: 10px;
    margin-right: 2px;
}

@media (max-width: 480px) {
    .news-article-title {
        font-size: 18px;
    }

    .news-hero-image {
        margin: -16px -16px 0;
        max-height: 220px;
    }

    .news-hero-image img {
        max-height: 220px;
    }

    .news-strip-avt {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .news-strip-name {
        font-size: 13px;
    }

    .news-strip-meta {
        font-size: 10px;
    }

    .news-article-content {
        font-size: 14px;
        line-height: 1.7;
    }
}

/* Comment author details */
.news-comment-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.news-comment-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 5px 8px;
    background: var(--bg-body);
    border-radius: 6px;
    border-left: 2px solid var(--accent-light);
}

/* Author details on post (larger variant) */
.news-author-details {
    font-size: 12px;
    padding: 8px 12px;
    gap: 4px;
    flex: 1;
    margin-top: 0;
}

.news-author-details .news-strip-avt {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.news-author-details .news-strip-name {
    font-size: 14px;
}

.news-author-details .news-forum-rank {
    width: fit-content;
}

.news-comment-details .news-strip-clan-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.news-comment-details .news-strip-point-icon {
    width: 14px;
    height: 14px;
}

.news-comment-details .news-strip-bio {
    font-style: italic;
    color: var(--text-muted);
    font-size: 11px;
}

.news-comment-details .news-strip-clan-role {
    font-weight: 600;
    color: var(--accent-readable);
    font-size: 10px;
}

.news-comment-details .news-forum-rank {
    font-size: 10px;
    padding: 1px 6px;
    width: fit-content;
}

/* Admin bar (above content) */
.news-admin-bar {
    display: inline-flex !important;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
}

.news-admin-btn {
    width: 26px !important;
    height: 26px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all .2s;
    padding: 0;
}

.news-admin-btn:hover {
    border-color: var(--accent);
    color: var(--accent-readable);
    background: var(--accent-light);
}

.news-admin-btn-edit {
    color: #3b82f6;
}

.news-admin-btn-edit:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.news-admin-btn-danger {
    color: #ef4444;
}

.news-admin-btn-danger:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* Post Actions — like / dislike / share */
.news-article-actions {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    flex-wrap: nowrap;
}

.news-react-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 4px 10px !important;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
    width: auto !important;
}

.news-react-btn:hover {
    border-color: var(--accent);
    color: var(--accent-readable);
}

.news-react-btn.like-active {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #93c5fd;
}

.news-react-btn.dislike-active {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fca5a5;
}

.news-react-btn i {
    font-size: 11px;
}

.news-share-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 4px 10px !important;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    margin-left: auto;
    transition: all .2s;
    width: auto !important;
}

.news-share-btn:hover {
    border-color: var(--accent);
    color: var(--accent-readable);
}

.news-share-btn i {
    font-size: 11px;
}

/* ===========================================================================
   COMMENTS — Redesigned for clarity
   =========================================================================== */
.news-comments {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.news-comments-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

/* Locked / Login notice */
.news-locked-notice,
.news-login-notice {
    text-align: center;
    padding: 14px;
    background: var(--bg-hover);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.news-locked-notice i {
    margin-right: 6px;
}

.news-login-notice a {
    color: var(--accent-readable);
    font-weight: 600;
    text-decoration: none;
}

/* Comment Form */
.news-comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.news-comment-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--accent);
}

.news-comment-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-comment-input-wrap textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    transition: border .2s;
    box-sizing: border-box;
    background: var(--bg-input);
    color: var(--text-primary);
}

.news-comment-input-wrap textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.news-comment-input-wrap button {
    align-self: flex-end;
    padding: 8px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all .2s;
}

.news-comment-input-wrap button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-light);
}

/* Comment List */
.news-comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Each Comment Card */
.news-comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    transition: all .2s;
}

.news-comment-item:hover {
    border-color: var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.news-comment-item.target-highlight {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.news-comment-body {
    flex: 1;
    min-width: 0;
}

/* Comment Header — contains name row + details */
.news-comment-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-light);
}

/* Name + Role + Time row */
.news-comment-name {
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
}

.news-comment-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-left: auto;
}

/* Comment Content */
.news-comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    word-break: break-word;
}

/* Nested Replies */
.news-comment-replies {
    margin-left: 20px;
    border-left: 2px solid var(--accent-light);
    padding-left: 15px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===========================================================================
   CREATE POST FORM
   =========================================================================== */
.news-create-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.news-create-card h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-create-author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-hover);
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.news-form-group {
    margin-bottom: 16px;
}

.news-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.news-form-group label i {
    margin-right: 4px;
    color: var(--accent-readable);
}

.news-form-group input[type="text"],
.news-form-group textarea,
.news-form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border .2s;
    box-sizing: border-box;
    background-color: var(--bg-input);
    color: var(--text-primary);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.news-form-group input[type="text"]:focus,
.news-form-group textarea:focus,
.news-form-select:focus {
    outline: none;
    border-color: var(--accent);
}

.news-form-group textarea {
    resize: vertical;
    min-height: 200px;
}

/* Image upload */
.news-img-upload {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.news-img-upload-btn {
    padding: 10px 18px;
    border: 2px dashed var(--border-color);
    background: transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all .2s;
}

.news-img-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent-readable);
}

.news-img-preview {
    position: relative;
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.news-img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-img-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-img-progress {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* Submit */
.news-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all .2s;
    margin-top: 8px;
}

.news-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-light);
}

.news-submit-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* ===========================================================================
   SUGGESTED POSTS
   =========================================================================== */
.news-suggested {
    margin-top: 28px;
}

.news-suggested-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.news-suggested-title i {
    color: var(--accent-readable);
    font-size: 1.1em;
}

.news-suggested-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.news-suggested-grid .news-card {
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-suggested-grid .news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .news-suggested-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .news-suggested {
        margin-top: 16px;
    }

    .news-suggested-title {
        font-size: 15px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
}




/* ===========================================================================
   RESPONSIVE
   =========================================================================== */
@media (max-width: 640px) {
    .news-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .news-header-left {
        width: 100%;
    }

    .news-create-btn {
        width: 100%;
        justify-content: center;
    }

    .news-card-body {
        flex-direction: column;
    }

    .news-card-thumb {
        width: 100%;
        height: 150px;
    }

    .news-article {
        padding: 16px;
    }

    .news-article-title {
        font-size: 18px;
    }
}

/* ===========================================================================
   COMPACT MODIFIER (Dùng cho Trang chủ)
   =========================================================================== */
.news-card-compact {
    padding: 12px 15px !important;
    gap: 12px !important;
    min-height: unset !important;
}

.news-card-compact .news-card-body {
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    align-items: center !important;
}

.news-card-compact .news-card-avatar {
    width: 45px !important;
    height: 45px !important;
    flex-shrink: 0 !important;
}

.news-card-compact .news-card-title {
    font-size: 1rem !important;
    margin-bottom: 4px !important;
}

.news-card-compact .news-cat-tag {
    padding: 1px 6px !important;
    font-size: 0.7rem !important;
}

/* ===========================================================================
   PINNED NEWS SECTION (Home Page)
   =========================================================================== */
.pinned-news-section {
    margin-top: 20px;
    margin-bottom: 25px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 20px;
}

@media (max-width: 480px) {
    .pinned-news-section {
        padding: 15px 0 !important;
        margin-top: 10px;
        margin-bottom: 15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .pinned-news-section h2 {
        margin-bottom: 15px;
        font-size: 1.2rem;
        color: #ef4444;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .news-card-compact {
        padding: 6px 10px !important;
    }

    .news-card-compact .news-card-avatar {
        width: 34px !important;
        height: 34px !important;
    }

    .news-card-compact .news-card-title {
        font-size: 14px !important;
    }
}

/* ===========================================================================
   RADICAL MOBILE FIXES
   =========================================================================== */
@media (max-width: 480px) {
    .news-article {
        padding: 15px 10px;
        border-radius: 0;
        margin-bottom: 12px;
        border-left: none;
        border-right: none;
    }

    .news-article-title {
        font-size: 18px;
        margin-bottom: 10px;
        line-height: 1.25;
    }

    .news-article-content {
        font-size: 14px;
        line-height: 1.6;
    }

    .news-author-avatar {
        width: 32px;
        height: 32px;
    }

    .news-comments {
        padding: 12px 10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .news-comment-item {
        padding: 10px 8px;
    }

    .news-comment-text {
        font-size: 13px;
    }

    .news-create-card {
        padding: 15px 10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .news-create-author {
        padding: 8px 10px;
        margin-bottom: 15px;
    }

    .news-form-group {
        margin-bottom: 12px;
    }

    .news-form-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .news-form-group input[type="text"],
    .news-form-group textarea,
    .news-form-select {
        padding: 10px 12px;
        font-size: 13px;
    }

    .news-img-upload {
        flex-direction: column;
        align-items: stretch;
    }

    .news-img-upload-btn {
        width: 100%;
        justify-content: center;
    }

    .news-img-preview {
        width: 100%;
        height: auto;
        max-height: 200px;
        margin-top: 10px;
    }

    .news-submit-btn {
        padding: 12px;
        font-size: 15px;
    }

    .news-create-page .news-back-btn {
        margin: 10px;
        display: inline-block;
    }
}

/* ===========================================================================
   POST META BAR
   =========================================================================== */
.news-post-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.news-post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.news-post-meta i {
    font-size: 12px;
}

/* ===========================================================================
   FORUM RANK BADGE
   =========================================================================== */
.news-forum-rank {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid;
    white-space: nowrap;
}

.news-forum-rank i {
    font-size: 10px;
}

/* ===========================================================================
   CSS TOAST SYSTEM
   =========================================================================== */
#toastContainer {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.css-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 350px;
}

.css-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.css-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.css-toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.css-toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.css-toast-icon {
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
}

/* ===========================================================================
   CSS CONFIRM DIALOG
   =========================================================================== */
.css-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.css-confirm-overlay.show {
    opacity: 1;
}

.css-confirm-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.css-confirm-overlay.show .css-confirm-box {
    transform: scale(1);
}

.css-confirm-icon {
    font-size: 40px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.css-confirm-box h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: var(--text-primary);
}

.css-confirm-box p {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.css-confirm-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.css-confirm-cancel,
.css-confirm-ok {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.css-confirm-cancel {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.css-confirm-cancel:hover {
    background: var(--border-light);
}

.css-confirm-ok {
    background: #ef4444;
    color: #fff;
}

.css-confirm-ok:hover {
    background: #dc2626;
}

/* ===========================================================================
   CSS IMAGE LIGHTBOX
   =========================================================================== */
.css-img-overlay {
    position: fixed;
    inset: 0;
    z-index: 99997;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: zoom-out;
}

.css-img-overlay.show {
    opacity: 1;
}

.css-img-full {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.css-img-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.css-img-close:hover {
    color: #ef4444;
}

/* ===========================================================================
   FORUM — Category Grid & Breadcrumbs
   =========================================================================== */
.forum-subtitle {
    color: var(--text-muted);
    margin: 0 0 20px;
    font-size: 14px;
    padding: 0 4px;
}

/* Breadcrumbs */
.forum-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.forum-breadcrumbs a {
    color: var(--accent-readable);
    text-decoration: none;
    font-weight: 500;
    transition: opacity .2s;
}

.forum-breadcrumbs a:hover {
    opacity: .8;
}

.forum-breadcrumb-sep {
    color: var(--text-muted);
}

.forum-breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Category Grid */
.forum-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

@media (max-width: 480px) {
    .forum-category-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Category Card */
.forum-cat-card {
    display: block;
    text-decoration: none;
    background: var(--bg-body);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 18px 20px;
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

.forum-cat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity .25s;
}

.forum-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--accent);
}

.forum-cat-card:hover::before {
    opacity: 1;
}

.forum-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.forum-cat-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.forum-cat-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 50%;
    border: 2px solid;
}

.forum-cat-count {
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.forum-cat-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.forum-cat-lock {
    margin-top: 12px;
    font-size: 12px;
    color: #ef4444;
    background: #fef2f2;
    padding: 5px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* News Section Titles (for index.php) */
.news-section {
    margin-bottom: 20px;
}

.news-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: #0ea5e9;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 6px 14px;
    border-radius: 8px;
}

.news-section-title i {
    color: #fff;
}

.news-section-title.news-section-pinned {
    background: #ef4444;
    color: #fff;
}

.news-section-title.news-section-pinned i {
    color: #fff;
}

/* Suggested Posts */
.news-suggested {
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}