/* style.css — v8 */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
body {
	font-family: Arial, sans-serif;
	padding: 20px;
	padding-top: 55px; /* plass til fast topplinje */
}
.language-selector {
	position: fixed;
	top: 0;
	inset-inline-start: 0;
	inset-inline-end: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid #ddd;
	padding: 8px 20px;
	text-align: end;
}
.language-selector button {
	margin-inline-start: 10px;
	padding: 5px 15px;
	cursor: pointer;
}
.container {
	display: flex;
	gap: 20px;
}
.left-panel {
	flex: 1;
	border: 1px solid #ccc;
	padding: 15px;
}
.center-panel {
	flex: 2;
	border: 1px solid #ccc;
	padding: 15px;
}
.right-panel {
	flex: 1;
	border: 1px solid #ccc;
	padding: 15px;
}
.source-item {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	padding: 10px;
	border: 1px solid #ddd;
}
.source-item img {
	width: 16px;
	height: 16px;
	margin-inline-end: 10px;
}
/* margin-inline-end handles RTL automatically — no dir override needed */
.source-item span {
	flex: 1;
}
.source-item button {
	margin-inline-start: 5px;
	padding: 5px 10px;
	cursor: pointer;
}
.btn-move-up,
.btn-move-down {
	font-size: 16px;
	font-weight: bold;
	padding: 2px 8px;
}
.paywall-icon {
	cursor: help;
	position: relative;
}
.paywall-icon::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: #fff;
	padding: 5px 10px;
	border-radius: 4px;
	white-space: nowrap;
	font-size: 12px;
	z-index: 1000;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
}
.paywall-icon:hover::after {
	opacity: 1;
}
.add-source {
	margin-top: 15px;
}
.add-source button {
	width: 100%;
	padding: 10px;
	cursor: pointer;
}
.schedule-section {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #ccc;
}
.schedule-section label {
	display: block;
	margin-bottom: 5px;
}
.schedule-section input,
.schedule-section select {
	margin-bottom: 10px;
	padding: 5px;
}
.schedule-section button {
	padding: 5px 15px;
	cursor: pointer;
}
.btn-toggle-language {
	margin-bottom: 20px;
	padding: 8px 15px;
	cursor: pointer;
}
.news-item {
	padding: 15px;
	margin-bottom: 10px;
	border: 1px solid #ddd;
	background: #f9f9f9;
}
.news-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}
.news-item-source {
	display: flex;
	align-items: center;
	font-size: 0.9em;
	color: #666;
}
.news-item-source img {
	width: 16px;
	height: 16px;
	margin-inline-end: 5px;
}
.news-item button {
	padding: 5px 10px;
	cursor: pointer;
}
.editor-toolbar {
	margin-bottom: 10px;
}
.editor-toolbar button {
	margin-inline-end: 5px;
	padding: 5px 15px;
	cursor: pointer;
}
.editor-textarea {
	width: 100%;
	height: 500px;
	padding: 10px;
	font-family: Arial, sans-serif;
}

/* Modal/Dialog styles */
.modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1000;
}
.modal-overlay.active {
	display: flex;
	justify-content: center;
	align-items: center;
}
.modal {
	background: white;
	padding: 30px;
	border-radius: 8px;
	max-width: 500px;
	width: 90%;
}
.modal h3 {
	margin-bottom: 20px;
}
.modal-option {
	margin: 15px 0;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
}
.modal-option:hover {
	background: #f0f0f0;
}
.modal-option input[type="radio"] {
	margin-inline-end: 10px;
}
.modal-buttons {
	margin-top: 20px;
	text-align: right;
}
.modal-buttons button {
	margin-inline-start: 10px;
	padding: 8px 20px;
	cursor: pointer;
}
.modal-form label {
	display: block;
	margin-top: 15px;
	margin-bottom: 5px;
	font-weight: bold;
}
.modal-form input[type="text"],
.modal-form input[type="url"] {
	width: 100%;
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
}
.modal-form input[type="checkbox"] {
	margin-inline-end: 5px;
}
/* Legg til i style.css */

.add-source {
	margin-top: 15px;
}
.add-source button {
	width: 100%;
	padding: 10px;
	cursor: pointer;
	margin-bottom: 10px;
}
.btn-restore-sources {
	background: #f0f0f0;
}
/* Legg til i style.css */

.modal-checkbox-list {
	max-height: 400px;
	overflow-y: auto;
	margin: 20px 0;
}
.modal-checkbox-item {
	padding: 10px;
	border: 1px solid #ddd;
	margin-bottom: 10px;
	border-radius: 4px;
}
.modal-checkbox-item:hover {
	background: #f5f5f5;
}
.modal-checkbox-item input[type="checkbox"] {
	margin-inline-end: 10px;
}
.modal-checkbox-item label {
	cursor: pointer;
	display: inline-block;
	width: calc(100% - 30px);
}
/* Legg til i style.css */

.english-name {
	font-size: 0.9em;
	color: #666;
}
[dir="rtl"] .english-name {
	display: none;
}

/* Nyhetskontroller-rad: språkvalg, visningsvalg, oppdateringslenke */
.news-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 15px;
	flex-wrap: wrap;
}

/* Knappgruppe med aktiv-markering */
.btn-group {
	display: flex;
}
.btn-group .btn-lang,
.btn-group .btn-view {
	padding: 6px 12px;
	cursor: pointer;
	background: #f0f0f0;
	border: 1px solid #ccc;
	font-size: 0.85em;
}
.btn-group .btn-lang:first-child,
.btn-group .btn-view:first-child {
	border-radius: 4px 0 0 4px;
	border-right: none;
}
.btn-group .btn-lang:last-child,
.btn-group .btn-view:last-child {
	border-radius: 0 4px 4px 0;
}
.btn-group .btn-lang.active,
.btn-group .btn-view.active {
	background: #333;
	color: #fff;
	border-color: #333;
}

/* Scrollbar nyhetsliste */
.news-list-scroll {
	max-height: calc(100vh - 320px);
	overflow-y: auto;
	padding-right: 14px; /* margin mellom innslag og scrollbar */
}

/* Debug-id per innslag */
.news-debug-id {
	font-size: 0.72em;
	color: #bbb;
	margin-inline-start: auto;
}

/* "Også:"-rad med andre kilder i merged-visning */
.cluster-also-in {
	margin-top: 8px;
	padding-top: 7px;
	border-top: 1px solid #e0e0e0;
	font-size: 0.82em;
	color: #666;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.cluster-also-in .source-line {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.cluster-also-in .source-line img {
	width: 14px;
	height: 14px;
}
.cluster-also-in a {
	color: #2980b9;
	text-decoration: none;
}
.cluster-also-in a:hover {
	text-decoration: underline;
}

/* Kildelinje øverst i merged-item */
.merged-primary-source {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.9em;
	color: #666;
	margin-bottom: 8px;
}
.merged-primary-source img {
	width: 16px;
	height: 16px;
}
.merged-primary-source a {
	color: #333;
	text-decoration: none;
	font-weight: 500;
}
.merged-primary-source a:hover {
	text-decoration: underline;
}

/* Oppdater-lenke */
.btn-process-link {
	display: inline-block;
	padding: 6px 12px;
	background: #f0f0f0;
	border: 1px solid #ccc;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
	font-size: 0.85em;
	cursor: pointer;
}
.btn-process-link:hover {
	background: #e0e0e0;
}

/* Tittel — fet på egen linje */
.news-title {
	font-size: 1em;
	font-weight: bold;
	line-height: 1.4;
	margin-top: 6px;
	margin-bottom: 5px;
	display: block;
}

/* Undertittel/brødtekst */
.news-subtitle {
	font-size: 0.88em;
	color: #444;
	line-height: 1.4;
	margin-bottom: 6px;
}

/* "Les mer"-lenke */
.news-link {
	font-size: 0.82em;
	color: #2980b9;
	text-decoration: none;
}
.news-link:hover {
	text-decoration: underline;
}

/* Melding når ingen headlines er lastet */
.no-headlines {
	color: #888;
	font-size: 0.9em;
	padding: 20px 0;
}
.no-headlines a {
	color: #2980b9;
}

/* Dato-rad: input + knapp/dropdown på samme linje */
.date-row {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
}
.date-row input[type="datetime-local"] {
	padding: 4px 6px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9em;
}
#date-preset {
	padding: 4px 6px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.85em;
	cursor: pointer;
}
.btn-now {
	padding: 4px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #f0f0f0;
	font-size: 0.85em;
	cursor: pointer;
}
.btn-now:hover {
	background: #e0e0e0;
}

/* Debug-id ved siden av kilde i Også-rad */
.source-debug-id {
	font-size: 0.72em;
	color: #bbb;
}

/* Interface-språkknapper øverst til høyre — aktiv markering */
.language-selector button {
	padding: 5px 12px;
	border: 1px solid #ccc;
	background: #f0f0f0;
	cursor: pointer;
	font-size: 0.85em;
	border-radius: 4px;
	margin-inline-start: 4px;
}
.language-selector button.active {
	background: #2980b9;
	color: #fff;
	border-color: #2980b9;
}
.language-selector button:hover:not(.active) {
	background: #e0e0e0;
}

/* Cluster-innslag: stablet korteffekt med CSS box-shadow */
.news-item.news-merged {
	position: relative;
	box-shadow:
		4px 4px 0 -1px #fff,
		4px 4px 0 1px #7aaacc,
		8px 8px 0 -1px #fff,
		8px 8px 0 1px #5588aa;
	margin-bottom: 22px;
	margin-inline-end: 8px; /* plass til skygger */
}

/* Kilde-statuslys via ::before — alltid før innhold uansett LTR/RTL */
.source-status-light {
	display: none; /* span ikke brukt */
}
.source-item::before {
	content: "";
	display: block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
	margin-inline-end: 8px;
	background: #bbb; /* default: inaktiv */
}
.source-item.status-active::before  { background: #2980b9; box-shadow: 0 0 5px #2980b9; }
.source-item.status-error::before   { background: #e74c3c; box-shadow: 0 0 5px #e74c3c; }
.source-item.status-inactive::before { background: #bbb; }

/* Admin-knapper i language-selector */
.btn-admin-login,
.btn-admin-logout {
	padding: 5px 12px;
	border: 1px solid #ccc;
	background: #f0f0f0;
	cursor: pointer;
	font-size: 0.85em;
	border-radius: 4px;
	margin-inline-start: 4px;
}
.btn-admin-logout {
	background: #eaf4fb;
	border-color: #2980b9;
	color: #2980b9;
}
.btn-admin-login:hover  { background: #e0e0e0; }
.btn-admin-logout:hover { background: #d0eaf7; }

/* Kilde-checkboks ved siden av trafikklyset */
.source-checkbox {
	margin-inline-end: 6px;
	cursor: pointer;
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}
.source-checkbox:disabled {
	cursor: not-allowed;
	opacity: 0.4;
}

/* style.css */
