/* widgets/newsfeed/newsfeed.css */
.newsfeed-card {
    grid-column: 1 / -1;
    grid-row: span 2;
    margin-top: 10px;
}

:root {
    --nf-bg: var(--bg);
    --nf-surface: var(--card-bg);
    --nf-text-main: var(--text-main);
    --nf-text-muted: var(--text-muted);
    --nf-primary: var(--accent);
    --nf-primary-hover: #2563eb;
    --nf-border: var(--card-border);
    --nf-danger: var(--danger);
    --nf-warning: #f59e0b;
    --nf-success: #10b981;
}

.nf-input {
    width: 100%;
    padding: 8px 12px;
    background: #fff;
    color: var(--nf-text-main);
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}
.nf-input:focus {
    border-color: var(--nf-primary);
}

.newsfeed-widget {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--nf-text-main);
    overflow: hidden;
    position: relative;
}

/* Header */
.nf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid var(--nf-border);
    background: rgba(15, 23, 42, 0.5);
}

.nf-board-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nf-board-select select {
    background: #1e293b;
    color: var(--nf-text-main);
    border: 1px solid var(--nf-border);
    border-radius: 8px;
    padding: 4px 8px;
    outline: none;
    font-weight: 500;
}

.nf-board-select select:focus {
    border-color: var(--nf-primary);
}

.nf-badge {
    background: rgba(239, 68, 68, 0.2);
    color: var(--nf-danger);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Filters */
.nf-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.nf-filters::-webkit-scrollbar { display: none; }

.nf-filter-pill {
    background: transparent;
    color: var(--nf-text-muted);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nf-filter-pill:hover {
    color: var(--nf-text-main);
    border-color: var(--nf-text-muted);
}

.nf-filter-pill.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--nf-primary);
    border-color: var(--nf-primary);
    font-weight: 600;
}

/* Controls */
.nf-controls {
    display: flex;
    gap: 4px;
}

.nf-btn-icon {
    background: transparent;
    border: none;
    color: var(--nf-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.nf-btn-icon:hover {
    color: var(--nf-text-main);
}

/* Body */
.nf-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
}

/* Scrollbar styling */
.nf-body::-webkit-scrollbar { width: 6px; }
.nf-body::-webkit-scrollbar-track { background: transparent; }
.nf-body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }

/* Cards */
.nf-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 4px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background 0.2s;
    position: relative;
}

.nf-card:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

/* Severities */
.nf-card.severity-info { border-left-color: var(--nf-primary); background: rgba(59, 130, 246, 0.02); }
.nf-card.severity-warning { border-left-color: var(--nf-warning); background: rgba(245, 158, 11, 0.04); }
.nf-card.severity-critical { border-left-color: var(--nf-danger); background: rgba(239, 68, 68, 0.04); }
.nf-card.severity-success { border-left-color: var(--nf-success); background: rgba(16, 185, 129, 0.02); }
.nf-card.is-read { opacity: 0.55; }

.nf-card-content {
    flex: 1;
    min-width: 0;
}

.nf-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nf-card-summary {
    font-size: 0.8rem;
    color: var(--nf-text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Expandable logs and formatted details */
.nf-card.is-expandable {
    cursor: pointer;
}

.nf-expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    margin-right: 4px;
    color: var(--nf-text-muted);
    flex-shrink: 0;
}

.nf-card.is-expanded .nf-expand-icon {
    transform: rotate(90deg);
}

.nf-card-details {
    display: none;
    margin-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 8px;
}

.nf-card.is-expanded .nf-card-details {
    display: block;
}

.nf-card.is-expanded .nf-card-summary {
    display: none; /* Hide short summary when expanded to reduce noise */
}

/* Log Formatting Elements */
.nf-log-container {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 10px;
    border-radius: 6px;
    line-height: 1.45;
    color: #334155;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.nf-log-line {
    word-break: break-all;
    margin-bottom: 2px;
}

.nf-log-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-right: 6px;
    text-transform: uppercase;
}

.nf-badge-info {
    background-color: rgba(56, 189, 248, 0.15);
    color: #0369a1;
}

.nf-badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.nf-badge-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.nf-badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.nf-log-key {
    color: #0284c7;
    font-weight: 600;
}

.nf-log-section-header {
    font-weight: 700;
    color: #475569;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    margin: 8px 0 6px 0;
    padding-bottom: 2px;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.nf-log-list-item {
    margin-left: 12px;
    list-style-type: square;
    margin-bottom: 2px;
}


.nf-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    margin-left: 10px;
    min-width: 50px;
}

.nf-time {
    font-size: 0.75rem;
    color: var(--nf-text-muted);
}

.nf-mark-btn {
    background: transparent;
    border: none;
    color: var(--nf-text-muted);
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.nf-mark-btn:hover {
    opacity: 1;
    color: var(--nf-success);
}
.nf-card.is-read .nf-mark-btn {
    color: var(--nf-success);
    opacity: 1;
}

/* Footer */
.nf-footer {
    padding: 10px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--nf-text-muted);
    background: #f8f9fa;
}

.nf-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nf-text-muted);
    margin-right: 4px;
}
.nf-indicator.active { background: var(--nf-success); }

#nf-mark-all-read {
    color: var(--nf-primary);
    text-decoration: none;
    transition: color 0.2s;
}
#nf-mark-all-read:hover {
    color: var(--nf-primary-hover);
    text-decoration: underline;
}

/* Modal */
.nf-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(44, 62, 80, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.nf-modal-content {
    background: var(--nf-surface);
    border: 1px solid var(--nf-border);
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.nf-modal-content h4 {
    margin: 0 0 15px 0;
    color: var(--nf-text-main);
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
}
.nf-sub-list {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 15px;
}
.nf-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--nf-text-main);
}
.nf-btn-primary {
    background: var(--nf-primary);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.nf-btn-primary:hover {
    background: var(--nf-primary-hover);
    transform: translateY(-1px);
}

.nf-input-readonly {
    background: #f1f5f9;
    color: var(--nf-text-muted);
    font-family: monospace;
    font-size: 0.8rem;
    cursor: default;
}

.nf-textarea {
    font-family: monospace;
    font-size: 0.8rem;
}

.nf-btn-secondary {
    background: #fff;
    color: var(--nf-text-muted);
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.nf-btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* File list modal and table styling */
.nf-file-list-modal {
    transition: opacity 0.2s ease;
    opacity: 1;
}

.nf-file-list-modal.nf-modal-closing {
    opacity: 0 !important;
}

.nf-modal-close-btn {
    transition: color 0.2s;
}

.nf-modal-close-btn:hover {
    color: var(--nf-danger) !important;
}

.nf-file-list-container table tbody tr {
    transition: background 0.15s;
}

.nf-file-list-container table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.nf-file-list-container::-webkit-scrollbar {
    width: 6px;
}

.nf-file-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.nf-file-list-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

