/* ============================================================
   Feedback / "Rapportera problem" — trigger, modal, fält.
   Förlitar sig på .aka-ui-modal (aka-01-base-and-design-system.css)
   och .aka-toast (samma fil).
   ============================================================ */

/* ---------- Trigger (fixed bottom-left pill) ---------- */

.aka-feedback-trigger {
	position: fixed;
	left: max(14px, env(safe-area-inset-left, 0px));
	bottom: max(20px, env(safe-area-inset-bottom, 0px));
	z-index: 99989;                       /* Under .aka-floating-tools (99990), under modaler */
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px 9px 12px;
	border: 1px solid rgba(15, 23, 42, 0.14);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(8px);
	color: #0f172a;
	font: 600 0.85rem/1 'Open Sans', system-ui, sans-serif;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
	transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.aka-feedback-trigger:hover,
.aka-feedback-trigger:focus-visible {
	background: #0f172a;
	color: #fff;
	border-color: #0f172a;
}

.aka-feedback-trigger:focus-visible {
	outline: 2px solid var(--color-brand, #1abc9c);
	outline-offset: 2px;
}

.aka-feedback-trigger__icon {
	font-size: 1rem;
	line-height: 1;
}

/* Göm i lägen där pillen riskerar krocka med annan UI. */
body.aka-reading-mode .aka-feedback-trigger,
body.aka-ui-modal-open .aka-feedback-trigger,
body.aka-floating-tools-input-focus .aka-feedback-trigger {
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px);
}

/* Login-modal (egen overlay, inte aka-ui-modal). */
body:has(.aka-login-modal.is-open) .aka-feedback-trigger,
body:has(.aka-login-modal[aria-hidden="false"]) .aka-feedback-trigger {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 540px) {
	.aka-feedback-trigger {
		padding: 0;
		width: 44px;
		height: 44px;
		justify-content: center;
	}
	.aka-feedback-trigger__label { display: none; }
}

/* Mobil bottom bar: diskret ikon ovanför railen (höger), inte över Hem/Sök. */
@media (max-width: 1180px) {
	body.aka-context-nav-enabled .aka-feedback-trigger {
		left: auto;
		right: max(12px, env(safe-area-inset-right, 0px));
		bottom: calc(var(--aka-ctx-bar-h, 52px) + 12px + env(safe-area-inset-bottom, 0px));
		width: 34px;
		height: 34px;
		padding: 0;
		justify-content: center;
		gap: 0;
		border-color: rgba(15, 23, 42, 0.1);
		background: rgba(255, 255, 255, 0.82);
		box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
		opacity: 0.78;
		z-index: 999;
	}

	body.aka-context-nav-enabled .aka-feedback-trigger__label {
		display: none;
	}

	body.aka-context-nav-enabled .aka-feedback-trigger__icon {
		font-size: 0.88rem;
	}

	body.aka-context-nav-enabled .aka-feedback-trigger:hover,
	body.aka-context-nav-enabled .aka-feedback-trigger:focus-visible {
		opacity: 1;
		background: rgba(255, 255, 255, 0.96);
		color: #0f172a;
		border-color: rgba(15, 23, 42, 0.16);
		box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
	}
}

/* Desktop context-rail: trigger sitter i rail-footer, inte under railen. */
@media (min-width: 1181px) {
	body.aka-context-nav-enabled .aka-feedback-trigger {
		display: none !important;
	}
}

/* ---------- Modal — desktop placering & bredd ---------- */

/* Över context-header (z-index 10000280); bas .aka-ui-modal är 99998. */
.aka-feedback-modal.aka-ui-modal {
	z-index: 10000300;
}

@media (min-width: 541px) {
	.aka-feedback-modal.aka-ui-modal {
		--aka-feedback-modal-top: max(
			clamp(96px, 10vh, 140px),
			calc(var(--header-height, 72px) + 20px)
		);
		align-items: flex-start;
		justify-content: center;
		padding-top: var(--aka-feedback-modal-top);
		padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
	}

	.aka-feedback-modal .aka-ui-modal__dialog {
		width: min(760px, calc(100vw - 28px));
		max-height: calc(
			100dvh - var(--aka-feedback-modal-top) - max(14px, env(safe-area-inset-bottom, 0px))
		);
	}
}

@media (min-width: 1181px) {
	.aka-feedback-modal .aka-ui-modal__dialog {
		width: min(780px, calc(100vw - 48px));
	}
}

/* ---------- Modal-innehåll ---------- */

.aka-feedback-modal .aka-ui-modal__title {
	margin: 0 2.2rem 0.4rem 0;
	font-size: clamp(1.15rem, 2vw, 1.35rem);
	color: #0f172a;
}

.aka-feedback-modal__lead {
	margin: 0 0 1rem;
	color: #475569;
	font-size: 0.95rem;
	line-height: 1.5;
}

.aka-feedback-form {
	display: grid;
	gap: 0.85rem;
}

.aka-feedback-field {
	display: grid;
	gap: 0.35rem;
}

.aka-feedback-field__label {
	font-size: 0.78rem;
	font-weight: 700;
	color: #475569;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.aka-feedback-field__input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.8rem;
	border: 1px solid rgba(15, 23, 42, 0.18);
	border-radius: 10px;
	background: #fff;
	color: #0f172a;
	font: 400 0.95rem/1.4 'Open Sans', system-ui, sans-serif;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aka-feedback-field__input:focus {
	outline: none;
	border-color: var(--color-brand, #1abc9c);
	box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.18);
}

.aka-feedback-field__textarea {
	resize: vertical;
	min-height: 120px;
	font-family: inherit;
	line-height: 1.5;
}

.aka-feedback-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	font-size: 0.88rem;
	color: #334155;
	cursor: pointer;
	user-select: none;
}

.aka-feedback-checkbox input {
	margin-top: 0.2rem;
	flex-shrink: 0;
}

.aka-feedback-checkbox.is-disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.aka-feedback-selection-preview {
	padding: 0.55rem 0.75rem;
	border: 1px dashed rgba(15, 23, 42, 0.22);
	border-radius: 8px;
	color: #475569;
	background: #f8fafc;
	font-size: 0.86rem;
	font-style: italic;
	max-height: 110px;
	overflow: auto;
	line-height: 1.5;
}

.aka-feedback-selection-preview[hidden] { display: none; }

.aka-feedback-warning {
	margin: 0.1rem 0 0;
	padding: 0.7rem 0.85rem;
	border-radius: 10px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #7c2d12;
	font-size: 0.82rem;
	line-height: 1.5;
}

.aka-feedback-terms-note {
	margin: 0.1rem 0 0;
	padding: 0.55rem 0.8rem;
	border-radius: 10px;
	background: #f1f5f9;
	border: 1px solid rgba(15, 23, 42, 0.12);
	color: #334155;
	font-size: 0.8rem;
	line-height: 1.5;
}

.aka-feedback-checkbox--terms {
	font-weight: 600;
	color: #0f172a;
}

/* Tack-panel */
.aka-feedback-thanks {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	text-align: center;
	padding: 0.5rem 0;
}

.aka-feedback-thanks__icon {
	color: var(--color-brand, #1abc9c);
}

.aka-feedback-thanks__title {
	margin: 0;
	font-size: clamp(1.1rem, 2vw, 1.25rem);
	font-weight: 700;
	color: #0f172a;
	line-height: 1.35;
}

.aka-feedback-thanks__lead {
	margin: 0;
	color: #475569;
	font-size: 0.92rem;
	line-height: 1.55;
	max-width: 38ch;
}

/* Honeypot — visuellt och a11y dolt. */
.aka-feedback-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* ---------- Actions ---------- */

.aka-feedback-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	justify-content: flex-end;
	margin-top: 0.3rem;
}

.aka-feedback-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.55rem 1rem;
	border-radius: 999px;
	border: 1px solid transparent;
	font: 600 0.9rem/1.2 'Open Sans', system-ui, sans-serif;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.aka-feedback-btn:focus-visible {
	outline: 2px solid var(--color-brand, #1abc9c);
	outline-offset: 2px;
}

.aka-feedback-btn--ghost {
	background: transparent;
	color: #475569;
	border-color: rgba(15, 23, 42, 0.16);
}

.aka-feedback-btn--ghost:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.aka-feedback-btn--primary {
	background: var(--color-brand, #1abc9c);
	color: #fff;
	border-color: var(--color-brand, #1abc9c);
}

.aka-feedback-btn--primary:hover {
	background: #0f9989;
	border-color: #0f9989;
}

.aka-feedback-btn[disabled] {
	opacity: 0.55;
	cursor: progress;
}

/* ---------- Mobil ---------- */

@media (max-width: 540px) {
	.aka-feedback-actions {
		justify-content: stretch;
		flex-direction: column-reverse;
	}
	.aka-feedback-btn {
		width: 100%;
	}
}

/* ============================================================
   Mina rapporter — Mitt konto-endpoint + shortcode.
   ============================================================ */

.aka-my-reports {
	font-family: var(--aka-font, 'Open Sans', system-ui, sans-serif);
	color: var(--h-dark, #2c3e50);
}

.aka-my-reports__lead {
	margin: 0 0 1.25rem;
	color: #475569;
	font-size: 0.95rem;
	line-height: 1.55;
}

.aka-my-reports__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1rem;
}

.aka-my-reports__item {
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 12px;
	background: #fff;
	padding: 1rem 1.1rem;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.aka-my-reports__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.55rem;
	margin-bottom: 0.55rem;
}

.aka-my-reports__type {
	font-weight: 700;
	color: #0f172a;
	font-size: 0.95rem;
}

.aka-my-reports__status {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	background: #e2e8f0;
	color: #0f172a;
}

.aka-my-reports__status--ny { background: #fde68a; color: #78350f; }
.aka-my-reports__status--granskas { background: #bfdbfe; color: #1e3a8a; }
.aka-my-reports__status--bekraftat-fel { background: #fecaca; color: #7f1d1d; }
.aka-my-reports__status--atgardat { background: #bbf7d0; color: #14532d; }
.aka-my-reports__status--ej-fel { background: #e5e7eb; color: #374151; }
.aka-my-reports__status--avvisad-missbruk { background: #fbcfe8; color: #831843; }

.aka-my-reports__date {
	margin-left: auto;
	color: #94a3b8;
	font-size: 0.78rem;
}

.aka-my-reports__source {
	margin: 0 0 0.6rem;
	font-size: 0.85rem;
	color: #475569;
	line-height: 1.4;
}

.aka-my-reports__source-label {
	font-weight: 600;
	color: #334155;
}

.aka-my-reports__source a {
	color: #0f766e;
	word-break: break-word;
}

.aka-my-reports__message {
	margin: 0 0 0.4rem;
	color: #1e293b;
	font-size: 0.92rem;
	line-height: 1.55;
}

.aka-my-reports__message p {
	margin: 0 0 0.55rem;
}

.aka-my-reports__message p:last-child {
	margin-bottom: 0;
}

.aka-my-reports__reply {
	margin-top: 0.85rem;
	padding: 0.7rem 0.85rem;
	border-left: 3px solid var(--color-brand, #1abc9c);
	background: rgba(26, 188, 156, 0.06);
	border-radius: 0 8px 8px 0;
}

.aka-my-reports__reply-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.6rem;
	margin-bottom: 0.35rem;
	font-size: 0.82rem;
	color: #0f766e;
}

.aka-my-reports__reply-head time {
	color: #64748b;
	font-size: 0.76rem;
}

.aka-my-reports__reply-body {
	color: #134e4a;
	font-size: 0.92rem;
	line-height: 1.55;
}

.aka-my-reports__reply-body p {
	margin: 0 0 0.5rem;
}

.aka-my-reports__reply-body p:last-child {
	margin-bottom: 0;
}

/* Tomt läge */
.aka-my-reports__empty {
	border: 1px dashed rgba(15, 23, 42, 0.18);
	border-radius: 12px;
	padding: 1.4rem 1.2rem;
	background: #f8fafc;
	text-align: center;
}

.aka-my-reports__empty-title {
	margin: 0 0 0.5rem;
	font-weight: 600;
	color: #1e293b;
}

.aka-my-reports__empty-hint {
	margin: 0;
	color: #64748b;
	font-size: 0.88rem;
	line-height: 1.55;
}

/* Mobil */
@media (max-width: 540px) {
	.aka-my-reports__item {
		padding: 0.85rem 0.9rem;
	}
	.aka-my-reports__head {
		gap: 0.4rem;
	}
	.aka-my-reports__date {
		flex-basis: 100%;
		margin-left: 0;
		order: 3;
	}
}
