/* BOARD STYLES */



.board-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.board-header-row h2 {
    margin: 0;
    font-size: 2rem;
    color: var(--title-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.board-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.board-read-summary {
    align-items: center;
    display: inline-flex;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.85rem;
}

.board-read-summary.has-unread {
    border-color: rgba(143, 217, 168, 0.28);
    background: rgba(143, 217, 168, 0.1);
    color: var(--text);
}

.board-read-summary.is-caught-up {
    border-color: rgba(255, 255, 255, 0.08);
}

.board-read-summary.is-guest {
    background: rgba(255, 255, 255, 0.03);
}

.board-unread-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(143, 217, 168, 0.14);
    border: 1px solid rgba(143, 217, 168, 0.2);
    color: var(--primary2);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Category Card */
.board-category-card {
    background: rgba(21, 32, 28, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 25px;
    display: grid;
    grid-template-columns: 60px 1fr 150px 250px;
    gap: 20px;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.board-category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(143, 217, 168, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

.board-category-card.has-unread {
    border-color: rgba(143, 217, 168, 0.22);
    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.35),
        inset 4px 0 0 rgba(143, 217, 168, 0.45);
}

.cat-icon {
    font-size: 2rem;
    color: var(--primary2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.cat-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 700;
}

.cat-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.4;
}

.cat-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--muted);
    opacity: 0.7;
}

.cat-stats i {
    width: 20px;
    text-align: center;
}

.cat-last {
    text-align: right;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

.last-link {
    color: var(--primary2);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: block;
    text-align: right;
}

.last-meta {
    color: var(--text);
    font-size: 0.8rem;
}

.board-last-status {
    color: var(--primary2);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.last-date {
    color: var(--muted);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Online Users Card */
.online-users-card {
    background: rgba(10, 14, 13, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius2);
    padding: 20px;
    margin-top: 40px;
}

.online-header {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.online-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-box .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary2);
}

.stat-box .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 1px;
}

.online-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text);
    border: 1px solid transparent;
}

.user-badge.admin {
    background: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
    border-color: rgba(255, 77, 77, 0.3);
}

.user-badge.mod {
    background: rgba(245, 166, 91, 0.15);
    color: #f5a65b;
    border-color: rgba(245, 166, 91, 0.3);
}

.user-badge.hidden {
    background: rgba(0, 0, 0, 0.3);
    font-style: italic;
    color: var(--muted);
}

.online-legend {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-admin {
    background: #ff4d4d;
    box-shadow: 0 0 5px #ff4d4d;
}

.dot-mod {
    background: #f5a65b;
    box-shadow: 0 0 5px #f5a65b;
}

/* Thread List Items (inside Category) */
.thread-list-header {
    display: grid;
    grid-template-columns: 1fr 120px 250px;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
}

.thread-item {
    display: grid;
    grid-template-columns: 1fr 120px 250px;
    background: rgba(21, 32, 28, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 25px;
    gap: 15px;
    align-items: center;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.thread-item:hover {
    transform: translateY(-3px);
    border-color: rgba(143, 217, 168, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.thread-item.is-unread {
    border-color: rgba(143, 217, 168, 0.24);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        inset 4px 0 0 rgba(143, 217, 168, 0.42);
}

.thread-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.thread-unread-meta {
    color: var(--primary2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.thread-stats {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.4;
}

/* Post View */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.board-thread-progress {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 16px;
    border: 1px solid rgba(143, 217, 168, 0.18);
    background: rgba(143, 217, 168, 0.08);
}

.board-thread-progress__label {
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 700;
}

.post-card {
    background: rgba(21, 32, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius2);
    display: grid;
    grid-template-columns: 200px 1fr;
    overflow: hidden;
}

.post-card.is-unread {
    border-color: rgba(143, 217, 168, 0.24);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.25),
        inset 4px 0 0 rgba(143, 217, 168, 0.42);
}

.post-user-col {
    background: rgba(0, 0, 0, 0.2);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.post-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--muted);
    margin-bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.post-username {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--title-color);
}

.badge-admin {
    background: #ff4d4d;
    color: #000;
}

.badge-mod {
    background: #f5a65b;
    color: #000;
}

.badge-user {
    background: rgba(255, 255, 255, 0.1);
    color: var(--muted);
}

.post-content-col {
    padding: 25px 30px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.post-header-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.post-unread-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(143, 217, 168, 0.14);
    border: 1px solid rgba(143, 217, 168, 0.2);
    color: var(--primary2);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.post-body {
    line-height: 1.6;
    color: var(--text);
    font-size: 1rem;
    min-height: 100px;
}

.post-body p {
    margin: 0 0 12px 0;
}

.board-inline-attachment {
    margin: 14px 0;
}

.board-inline-attachment a {
    display: inline-block;
    max-width: min(100%, 760px);
}

.board-inline-attachment img {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: block;
    max-height: 520px;
    max-width: 100%;
    object-fit: contain;
}

.board-attachments {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 16px;
    padding-top: 14px;
}

.board-attachments-title {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 8px;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.board-attachment-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.board-attachment-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.board-attachment-item:hover {
    border-color: rgba(143, 217, 168, 0.4);
    transform: translateY(-2px);
}

.board-attachment-item img {
    aspect-ratio: 16 / 10;
    display: block;
    object-fit: cover;
    width: 100%;
}

.board-attachment-item .name {
    font-size: 0.82rem;
    font-weight: 600;
    margin: 10px 10px 2px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-attachment-item .size {
    color: var(--muted);
    font-size: 0.75rem;
    margin: 0 10px 10px 10px;
    opacity: 0.9;
}

body.board-image-modal-open {
    overflow: hidden;
}

.board-image-modal {
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.22s ease;
    z-index: 6200;
}

.board-image-modal.is-open,
.board-image-modal.is-closing {
    pointer-events: auto;
}

.board-image-modal.is-open {
    opacity: 1;
}

.board-image-modal-backdrop {
    background: rgba(4, 8, 8, 0.8);
    backdrop-filter: blur(3px);
    inset: 0;
    position: absolute;
}

.board-image-modal-dialog {
    background: rgba(14, 21, 20, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
    left: 50%;
    max-height: calc(100vh - 80px);
    max-width: min(1100px, calc(100vw - 40px));
    overflow: hidden;
    padding: 14px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    transition: transform 0.22s ease;
    width: fit-content;
}

.board-image-modal.is-open .board-image-modal-dialog {
    transform: translate(-50%, -50%) scale(1);
}

.board-image-modal img {
    border-radius: 10px;
    display: block;
    max-height: calc(100vh - 180px);
    max-width: calc(100vw - 90px);
    object-fit: contain;
}

.board-image-modal-caption {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
}

.board-image-modal-close {
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 34px;
}

.board-image-modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
}

.post-actions a {
    color: var(--primary2);
    text-decoration: none;
    margin-left: 10px;
    font-weight: 600;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--muted);
}

.breadcrumb a {
    color: var(--primary2);
    text-decoration: none;
}

.breadcrumb .current {
    color: var(--text);
    font-weight: 600;
}

.separator {
    opacity: 0.5;
}

/* Card Auth / Form Container */
.card-auth {
    background: rgba(21, 32, 28, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 20px;
}

.card-auth.wide {
    max-width: 100%;
}

.card-auth h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--title-color);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .board-read-summary,
    .board-thread-progress {
        width: 100%;
    }

    .board-thread-progress {
        align-items: flex-start;
        flex-direction: column;
    }

    .board-category-card {
        grid-template-columns: 50px 1fr !important;
        gap: 15px;
        position: relative;
    }

    .cat-stats,
    .cat-last {
        display: none;
        /* Hide on mobile or restructure */
    }

    .thread-list-header {
        display: none;
    }

    .thread-item {
        grid-template-columns: 1fr;
    }

    .post-card {
        grid-template-columns: 1fr;
    }

    .post-user-col {
        flex-direction: row;
        padding: 15px;
        text-align: left;
        gap: 15px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .post-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 0;
    }

    .board-attachment-grid,
    .board-existing-attachment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -------------------------------------------------------------------------- */
/* BOARD UTILITIES                                                             */
/* -------------------------------------------------------------------------- */

.board-container {
    width: 100%;
}

.faded {
    color: var(--muted);
    opacity: 0.8;
}

.list-title {
    color: var(--muted);
    display: inline-block;
    margin-bottom: 10px;
}

.action-btn {
    align-items: center;
    background: rgba(79, 138, 107, 0.2);
    border: 1px solid rgba(143, 217, 168, 0.35);
    border-radius: 10px;
    color: var(--primary2);
    display: inline-flex;
    gap: 8px;
    justify-content: center;
    padding: 10px 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(79, 138, 107, 0.3);
    color: #fff;
}

.action-btn.small {
    font-size: 0.85rem;
    padding: 8px 12px;
}

.action-btn.full-width {
    width: 100%;
}

.action-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ff8a8a;
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.secondary-btn {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.secondary-btn:hover {
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
}

.form-input:focus {
    border-color: var(--primary2);
    outline: none;
}

.board-file-upload-group {
    margin-top: 4px;
}

.board-file-input {
    cursor: pointer;
}

.board-upload-help {
    display: inline-block;
    margin-top: 8px;
}

.board-upload-error {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 10px;
    color: #ffb3b3;
    font-size: 0.86rem;
    margin-top: 10px;
    padding: 10px 12px;
}

.board-upload-error[hidden] {
    display: none !important;
}

.board-upload-error.is-info {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.45);
    color: #bfdbfe;
}

.board-existing-attachments {
    margin-top: 8px;
}

.board-existing-attachment-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.board-existing-attachment-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.board-existing-attachment-item a {
    display: block;
}

.board-existing-attachment-item img {
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    display: block;
    object-fit: cover;
    width: 100%;
}

.board-existing-attachment-item .name {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-existing-attachment-item .size {
    color: var(--muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.board-existing-attachment-item .remove-toggle {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 0.8rem;
    gap: 7px;
    margin-top: 8px;
}

.cursor-pointer {
    cursor: pointer;
}

/* -------------------------------------------------------------------------- */
/* INLINE STYLE REPLACEMENTS                                                   */
/* -------------------------------------------------------------------------- */

.board-status-badge {
    margin-top: -10px;
}

.board-empty-online {
    font-size: 0.9rem;
    padding: 10px;
}

.board-back-link {
    color: inherit;
    text-decoration: none;
}

.board-empty-state {
    color: var(--muted);
    padding: 40px;
    text-align: center;
}

.board-empty-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: 15px;
}

.thread-icon-pinned {
    color: var(--accent);
    font-size: 0.9em;
}

.thread-icon-locked {
    color: #ef4444;
    font-size: 0.9em;
}

.board-edit-link {
    color: var(--muted);
}

.board-reply-card {
    margin: 20px 0;
}

.board-login-prompt {
    margin: 20px 0;
    text-align: center;
}

.board-login-prompt-text {
    color: var(--muted);
    margin-bottom: 15px;
}

.board-editor-card {
    margin: 20px 0;
    max-width: 100%;
    text-align: left;
}

.board-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.board-action-btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.board-actions-spacer {
    margin-left: auto;
}

.board-category-select {
    z-index: 50;
}

.board-admin-alert {
    border: 1px solid transparent;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 15px;
}

.board-admin-alert.is-success {
    background: #10b98120;
    border-color: #10b981;
    color: #10b981;
}

.board-admin-alert.is-error {
    background: #ef444420;
    border-color: #ef4444;
    color: #ef4444;
}

.admin-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr 2fr;
}

.admin-panel-form {
    margin: 0;
}

.admin-panel-list {
    margin: 0;
    max-width: 100%;
}

.admin-cancel-link {
    display: block;
    margin-top: 10px;
    text-align: center;
}

.admin-empty-text {
    color: var(--muted);
}

.board-admin-table {
    border-collapse: collapse;
    width: 100%;
}

.board-admin-table thead tr {
    border-bottom: 1px solid #ffffff20;
    text-align: left;
}

.board-admin-table tbody tr {
    border-bottom: 1px solid #ffffff10;
}

.board-admin-table th,
.board-admin-table td {
    padding: 10px;
}

.board-admin-table .cell-order {
    color: var(--muted);
}

.board-admin-table .cell-name strong {
    color: var(--text);
    display: block;
}

.board-admin-table .cell-name small {
    color: var(--muted);
}

.board-admin-table .cell-actions {
    text-align: right;
}

.inline-form {
    display: inline;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 10px;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--accent);
}

.icon-btn.delete:hover {
    color: #ef4444;
}

@media (max-width: 992px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}
