/**
 * Notice Board Pro — frontend styles.
 * Minimal, responsive, RTL- and dark-mode-aware. Loaded only when a
 * plugin shortcode/block is present.
 */

.nbp-board {
	--nbp-primary: #2563eb;
	--nbp-radius: 10px;
	display: grid;
	gap: 20px;
}

.nbp-board--grid,
.nbp-board--card {
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.nbp-board--list,
.nbp-board--timeline {
	grid-template-columns: 1fr;
}

.nbp-item {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--nbp-radius);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.nbp-item:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.nbp-item__thumb img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
}

.nbp-item__body {
	padding: 16px;
}

.nbp-item__priority {
	display: inline-block;
	padding: 2px 10px;
	margin-bottom: 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #fff;
	background: var(--nbp-primary);
}

.nbp-item--priority-urgent .nbp-item__priority { background: #dc2626; }
.nbp-item--priority-high .nbp-item__priority { background: #ea580c; }
.nbp-item--priority-medium .nbp-item__priority { background: #d97706; }
.nbp-item--priority-low .nbp-item__priority { background: #64748b; }

.nbp-item__title {
	margin: 0 0 8px;
	font-size: 18px;
	line-height: 1.3;
}

.nbp-item__title a {
	text-decoration: none;
	color: inherit;
}

.nbp-item__summary {
	margin: 0 0 10px;
	color: #475569;
	font-size: 14px;
}

.nbp-item__date {
	font-size: 12px;
	color: #94a3b8;
}

.nbp-empty {
	padding: 24px;
	text-align: center;
	color: #64748b;
	font-style: italic;
}

/* Dark mode. */
body.nbp-dark .nbp-item,
.nbp-board.nbp-dark .nbp-item {
	background: #1e293b;
	border-color: #334155;
}

body.nbp-dark .nbp-item__summary { color: #cbd5e1; }

/* RTL. */
.rtl .nbp-item__priority { letter-spacing: 0; }

/* ============================================================
   Phase 2 — buttons, attachments, ticker, popup, lists
   ============================================================ */

.nbp-btn {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.4;
	cursor: pointer;
	border: 1px solid transparent;
}

.nbp-btn--primary {
	background: var(--nbp-primary, #2563eb);
	color: #fff;
}

.nbp-btn--primary:hover { filter: brightness(0.95); }

.nbp-btn--ghost {
	background: transparent;
	color: var(--nbp-primary, #2563eb);
	border-color: currentColor;
}

/* Attachments list on single notice */
.nbp-attachments {
	margin-top: 28px;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}

.nbp-attachments__title { margin: 0 0 12px; font-size: 18px; }

.nbp-attachments__list { list-style: none; margin: 0; padding: 0; }

.nbp-attachment-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	margin-bottom: 8px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	flex-wrap: wrap;
}

.nbp-attachment-row__name { flex: 1 1 200px; font-weight: 500; word-break: break-word; }
.nbp-attachment-row__count { font-size: 12px; color: #64748b; }

/* Ticker */
.nbp-ticker {
	display: flex;
	align-items: center;
	gap: 12px;
	overflow: hidden;
	background: #0f172a;
	color: #fff;
	border-radius: 8px;
	padding: 0 0 0 14px;
}

.nbp-ticker__label {
	flex: 0 0 auto;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.04em;
	background: var(--nbp-primary, #2563eb);
	padding: 10px 12px;
	margin-left: -14px;
}

.nbp-ticker__viewport { flex: 1 1 auto; overflow: hidden; }

.nbp-ticker__track {
	display: inline-flex;
	white-space: nowrap;
	will-change: transform;
	animation: nbp-scroll-left linear infinite;
}

.nbp-ticker__item {
	color: #fff;
	text-decoration: none;
	padding: 10px 24px;
	position: relative;
}

.nbp-ticker__item::after {
	content: "•";
	position: absolute;
	right: 0;
	opacity: 0.4;
}

@keyframes nbp-scroll-left {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

.nbp-ticker--vertical { align-items: stretch; }
.nbp-ticker--vertical .nbp-ticker__track {
	flex-direction: column;
	animation-name: nbp-scroll-up;
}

@keyframes nbp-scroll-up {
	from { transform: translateY(0); }
	to { transform: translateY(-50%); }
}

.rtl .nbp-ticker__label { margin-left: 0; margin-right: -14px; }

/* Popup */
.nbp-popup {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.55);
	z-index: 99999;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.nbp-popup.is-visible { opacity: 1; }

.nbp-popup__box {
	position: relative;
	max-width: 460px;
	width: calc(100% - 40px);
	background: #fff;
	border-radius: 12px;
	padding: 28px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	transform: translateY(10px);
	transition: transform 0.25s ease;
}

.nbp-popup.is-visible .nbp-popup__box { transform: translateY(0); }

.nbp-popup__close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #64748b;
}

.nbp-popup__title { margin: 0 0 10px; font-size: 20px; }
.nbp-popup__summary { margin: 0 0 18px; color: #475569; }

/* Latest / featured / search lists */
.nbp-latest { list-style: none; margin: 0; padding: 0; }

.nbp-latest__item {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid #e2e8f0;
}

.nbp-latest__date { color: #94a3b8; font-size: 12px; white-space: nowrap; }

.nbp-featured__item {
	padding: 20px;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	background: #fff;
}

.nbp-featured__thumb img { width: 100%; border-radius: 8px; margin-bottom: 12px; }
.nbp-featured__title { margin: 8px 0; }

.nbp-search {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.nbp-search__input {
	flex: 1 1 220px;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
}

.nbp-search__select {
	padding: 8px 10px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
}

/* Dark mode extensions */
body.nbp-dark .nbp-attachment-row { background: #0f172a; border-color: #334155; }
body.nbp-dark .nbp-popup__box { background: #1e293b; color: #f1f5f9; }
body.nbp-dark .nbp-featured__item { background: #1e293b; border-color: #334155; }

/* ============================================================
   Phase 3 — filter bar, view switcher, views, pagination
   ============================================================ */

.nbp-board-wrap { --nbp-primary: #2563eb; }

.nbp-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 18px;
	padding: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
}

.nbp-filter__search {
	flex: 1 1 200px;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 14px;
}

.nbp-filter select {
	padding: 8px 10px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	font-size: 14px;
}

.nbp-view-switch {
	display: inline-flex;
	margin-left: auto;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	overflow: hidden;
}

.nbp-view-btn {
	background: #fff;
	border: none;
	border-left: 1px solid #e2e8f0;
	padding: 7px 9px;
	cursor: pointer;
	color: #64748b;
	line-height: 1;
}

.nbp-view-btn:first-child { border-left: none; }
.nbp-view-btn.is-active { background: var(--nbp-primary); color: #fff; }
.nbp-view-btn .dashicons { font-size: 18px; width: 18px; height: 18px; }

.rtl .nbp-view-switch { margin-left: 0; margin-right: auto; }

/* Loading state */
.nbp-board-results { position: relative; min-height: 60px; transition: opacity 0.15s ease; }
.nbp-board-results.is-loading { opacity: 0.45; pointer-events: none; }

/* List view */
.nbp-board--list { display: block; }
.nbp-list-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid #e2e8f0;
}
.nbp-list-item__badge {
	flex: 0 0 auto;
	align-self: center;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
}
.nbp-list-item__content { flex: 1; }
.nbp-list-item__title { margin: 0 0 4px; font-size: 17px; }
.nbp-list-item__title a { text-decoration: none; color: inherit; }
.nbp-list-item__summary { margin: 0; color: #475569; font-size: 14px; }
.nbp-list-item__date { color: #94a3b8; font-size: 12px; white-space: nowrap; align-self: center; }

/* Card view */
.nbp-board--card { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.nbp-card-item {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
}
.nbp-card-item__thumb img { width: 100%; height: 180px; object-fit: cover; display: block; }
.nbp-card-item__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.nbp-card-item__meta { display: flex; justify-content: space-between; align-items: center; color: #94a3b8; font-size: 12px; }
.nbp-card-item__title { margin: 0; font-size: 19px; }
.nbp-card-item__title a { text-decoration: none; color: inherit; }
.nbp-card-item__summary { margin: 0; color: #475569; font-size: 14px; flex: 1; }
.nbp-card-item .nbp-btn { align-self: flex-start; }

/* Table view */
.nbp-board--table { display: block; overflow-x: auto; }
.nbp-table { width: 100%; border-collapse: collapse; }
.nbp-table th, .nbp-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.nbp-table th { background: #f8fafc; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; color: #475569; }
.nbp-table td a { text-decoration: none; color: var(--nbp-primary); font-weight: 600; }
.rtl .nbp-table th, .rtl .nbp-table td { text-align: right; }

@media (max-width: 640px) {
	.nbp-table thead { display: none; }
	.nbp-table tr { display: block; margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 8px; }
	.nbp-table td { display: flex; justify-content: space-between; border-bottom: 1px solid #f1f5f9; }
	.nbp-table td::before { content: attr(data-label); font-weight: 600; color: #64748b; }
}

/* Timeline view */
.nbp-board--timeline { display: block; }
.nbp-timeline { list-style: none; margin: 0; padding: 0 0 0 8px; position: relative; }
.nbp-timeline::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: #e2e8f0; }
.nbp-timeline__item { position: relative; padding: 0 0 26px 30px; }
.nbp-timeline__marker { position: absolute; left: 1px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--nbp-primary); border: 3px solid #fff; box-shadow: 0 0 0 1px #e2e8f0; }
.nbp-item--priority-urgent .nbp-timeline__marker { background: #dc2626; }
.nbp-item--priority-high .nbp-timeline__marker { background: #ea580c; }
.nbp-timeline__date { display: block; color: #94a3b8; font-size: 12px; margin-bottom: 2px; }
.nbp-timeline__title { margin: 4px 0; font-size: 17px; }
.nbp-timeline__title a { text-decoration: none; color: inherit; }
.nbp-timeline__summary { margin: 0; color: #475569; font-size: 14px; }
.rtl .nbp-timeline { padding: 0 8px 0 0; }
.rtl .nbp-timeline::before { left: auto; right: 8px; }
.rtl .nbp-timeline__item { padding: 0 30px 26px 0; }
.rtl .nbp-timeline__marker { left: auto; right: 1px; }

/* Accordion view */
.nbp-board--accordion { display: block; }
.nbp-accordion { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; overflow: hidden; background: #fff; }
.nbp-accordion__summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.nbp-accordion__summary::-webkit-details-marker { display: none; }
.nbp-accordion__summary::after { content: "+"; margin-left: auto; font-size: 20px; color: #94a3b8; }
.nbp-accordion[open] .nbp-accordion__summary::after { content: "\2212"; }
.nbp-accordion__title { flex: 1; }
.nbp-accordion__body { padding: 0 16px 16px; }
.nbp-accordion__date { display: block; color: #94a3b8; font-size: 12px; margin-bottom: 8px; }
.rtl .nbp-accordion__summary::after { margin-left: 0; margin-right: auto; }

/* Pagination */
.nbp-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 24px; }
.nbp-page {
	min-width: 38px;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	color: #334155;
}
.nbp-page.is-current { background: var(--nbp-primary); border-color: var(--nbp-primary); color: #fff; }
.nbp-page:hover:not(.is-current) { background: #f1f5f9; }

/* Dark mode extensions */
body.nbp-dark .nbp-filter { background: #0f172a; border-color: #334155; }
body.nbp-dark .nbp-filter select,
body.nbp-dark .nbp-filter__search { background: #1e293b; color: #f1f5f9; border-color: #334155; }
body.nbp-dark .nbp-card-item,
body.nbp-dark .nbp-accordion { background: #1e293b; border-color: #334155; }
body.nbp-dark .nbp-table th { background: #0f172a; color: #cbd5e1; }

/* ============================================================
   Phase 4 — widget lists
   ============================================================ */
.nbp-popular, .nbp-cat-list { list-style: none; margin: 0; padding: 0; }
.nbp-popular__item {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 0;
	border-bottom: 1px solid #e2e8f0;
}
.nbp-popular__item a { text-decoration: none; }
.nbp-popular__views { color: #94a3b8; font-size: 12px; white-space: nowrap; }
.nbp-cat-list li { padding: 5px 0; border-bottom: 1px solid #f1f5f9; }
.nbp-cat-list a { text-decoration: none; }

/* ============================================================
   Phase 5 — browser notify opt-in button
   ============================================================ */
.nbp-notify-btn {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99998;
	padding: 10px 16px;
	background: var(--nbp-primary, #2563eb);
	color: #fff;
	border: none;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.nbp-notify-btn:hover { filter: brightness(0.95); }
.rtl .nbp-notify-btn { right: auto; left: 20px; }

/* ============================================================
   Phase 7 — category chips
   ============================================================ */
.nbp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.nbp-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	color: #fff;
	background: var(--nbp-primary, #2563eb);
}
.nbp-chip .dashicons { font-size: 14px; width: 14px; height: 14px; }
.nbp-chip__emoji { font-size: 13px; }
