/**
 * Styles du plugin ARSSAT Feedback.
 *
 * Toutes les classes sont préfixées « arssat-fb- ».
 * La racine du widget applique un reset local (all: initial) puis tout est
 * re-stylé explicitement, afin de ne pas hériter des styles du thème et de ne
 * pas polluer le reste du site.
 */

/* === Reset local de la racine ============================================ */

.arssat-fb-root {
	all: initial;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #212121;
}

.arssat-fb-root,
.arssat-fb-root * {
	box-sizing: border-box;
}

/* === Bouton flottant ===================================================== */

.arssat-fb-root .arssat-fb-button {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 56px;
	height: 56px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: #1976D2;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
	z-index: 2147483001;
	transition: all 200ms ease;
}

.arssat-fb-root .arssat-fb-button:hover {
	background: #1565C0;
}

.arssat-fb-root .arssat-fb-button--active {
	background: #0D47A1;
}

.arssat-fb-root .arssat-fb-button:focus-visible {
	outline: 3px solid #90CAF9;
	outline-offset: 2px;
}

.arssat-fb-root .arssat-fb-button__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

/* Badge de non-lus (admin). */
.arssat-fb-root .arssat-fb-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	background: #E53935;
	color: #fff;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

/* === Épingles ============================================================ */

.arssat-fb-root .arssat-fb-pin {
	position: fixed;
	width: 28px;
	height: 28px;
	padding: 0;
	margin: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	cursor: grab;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
	z-index: 2147483002;
	transition: transform 200ms ease, background 200ms ease, opacity 200ms ease;
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

.arssat-fb-root .arssat-fb-pin--open {
	background: #FF9800;
}

.arssat-fb-root .arssat-fb-pin--resolved {
	background: #9E9E9E;
}

.arssat-fb-root .arssat-fb-pin:hover {
	transform: translate(-50%, -50%) scale(1.12);
}

.arssat-fb-root .arssat-fb-pin:focus-visible {
	outline: 3px solid #90CAF9;
	outline-offset: 2px;
}

.arssat-fb-root .arssat-fb-pin__num {
	pointer-events: none;
}

/* Épingle en cours de glisser-déposer. */
.arssat-fb-root .arssat-fb-pin--dragging {
	cursor: grabbing !important;
	opacity: 0.85;
	transition: none;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
}

/* Pendant un drag : curseur grabbing partout, sélection désactivée. */
html.arssat-fb-dragging,
html.arssat-fb-dragging * {
	cursor: grabbing !important;
	-webkit-user-select: none !important;
	user-select: none !important;
}

/* Épingle « brouillon » affichée pendant la rédaction d'un nouveau
   commentaire (avant publication). Aspirée par la couleur du bouton flottant,
   bordure pointillée + animation pulse pour signaler que c'est en cours. */
.arssat-fb-root .arssat-fb-pin--ghost {
	background: #1976D2;
	border: 2px dashed #fff;
	box-shadow: 0 0 0 2px rgba(25, 118, 210, .35), 0 2px 6px rgba(0, 0, 0, .25);
	pointer-events: none;
	cursor: default;
	animation: arssat-fb-pulse 1.4s ease-in-out infinite;
}

@keyframes arssat-fb-pulse {
	0%, 100% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 0.95;
	}
	50% {
		transform: translate(-50%, -50%) scale(1.18);
		opacity: 1;
	}
}

.arssat-fb-root .arssat-fb-pin__new {
	position: absolute;
	top: -3px;
	right: -3px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #E53935;
	border: 2px solid #fff;
}

/* === Popovers ============================================================ */

.arssat-fb-root .arssat-fb-popover {
	position: fixed;
	z-index: 2147483004;
	width: 340px;
	max-width: calc(100vw - 24px);
	/* Hauteur max : garantit que la popover ne dépasse jamais l'écran.
	   Le corps devient scrollable, le footer (boutons Annuler/Publier)
	   reste toujours visible. */
	max-height: calc(100vh - 24px);
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #212121;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
	padding: 16px;
	transition: left 200ms ease, top 200ms ease;
}

.arssat-fb-root .arssat-fb-popover__close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	background: transparent;
	color: #757575;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px;
}

.arssat-fb-root .arssat-fb-popover__close:hover {
	background: #f0f0f0;
	color: #212121;
}

.arssat-fb-root .arssat-fb-popover__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	margin: 4px 0 12px;
}

.arssat-fb-root .arssat-fb-popover__footer {
	flex: 0 0 auto;
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

/* === Champs de formulaire ================================================ */

.arssat-fb-root .arssat-fb-field {
	margin-bottom: 10px;
}

.arssat-fb-root .arssat-fb-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #555;
	margin-bottom: 4px;
}

.arssat-fb-root .arssat-fb-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #cfcfcf;
	border-radius: 6px;
	font-size: 14px;
	color: #212121;
	background: #fff;
	font-family: inherit;
}

.arssat-fb-root .arssat-fb-input:focus {
	outline: none;
	border-color: #1976D2;
	box-shadow: 0 0 0 2px rgba(25, 118, 210, .2);
}

.arssat-fb-root .arssat-fb-byline {
	font-size: 13px;
	color: #555;
	margin-bottom: 6px;
}

.arssat-fb-root .arssat-fb-notme {
	color: #1976D2;
	text-decoration: underline;
	cursor: pointer;
}

/* Honeypot anti-spam : invisible et hors flux. */
.arssat-fb-root .arssat-fb-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* === Éditeur Quill ======================================================= */

.arssat-fb-root .arssat-fb-editor {
	background: #fff;
}

.arssat-fb-root .ql-toolbar.ql-snow {
	border-top-left-radius: 6px;
	border-top-right-radius: 6px;
	border-color: #cfcfcf;
}

.arssat-fb-root .ql-container.ql-snow {
	border-bottom-left-radius: 6px;
	border-bottom-right-radius: 6px;
	border-color: #cfcfcf;
	font-family: inherit;
}

.arssat-fb-root .ql-editor {
	min-height: 90px;
	max-height: 200px;
	overflow-y: auto;
	font-size: 14px;
	color: #212121;
}

/* === Boutons ============================================================= */

.arssat-fb-root .arssat-fb-btn {
	padding: 8px 14px;
	border-radius: 6px;
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: all 200ms ease;
}

.arssat-fb-root .arssat-fb-btn--primary {
	background: #1976D2;
	color: #fff;
}

.arssat-fb-root .arssat-fb-btn--primary:hover {
	background: #1565C0;
}

.arssat-fb-root .arssat-fb-btn--primary:disabled {
	background: #90CAF9;
	cursor: default;
}

.arssat-fb-root .arssat-fb-btn--ghost {
	background: #fff;
	color: #555;
	border-color: #cfcfcf;
}

.arssat-fb-root .arssat-fb-btn--ghost:hover {
	background: #f5f5f5;
}

.arssat-fb-root .arssat-fb-btn--danger {
	background: #fff;
	color: #d32f2f;
	border-color: #ef9a9a;
}

.arssat-fb-root .arssat-fb-btn--danger:hover {
	background: #ffebee;
}

/* === Zone image (création) =============================================== */

.arssat-fb-root .arssat-fb-image-row {
	margin-top: 6px;
}

.arssat-fb-root .arssat-fb-preview {
	margin-top: 10px;
}

.arssat-fb-root .arssat-fb-preview__img {
	display: block;
	max-width: 100%;
	max-height: 160px;
	border-radius: 6px;
	margin-bottom: 8px;
}

.arssat-fb-root .arssat-fb-preview__remove {
	font-size: 13px;
	padding: 4px 10px;
}

/* === Message d'erreur ==================================================== */

.arssat-fb-root .arssat-fb-error {
	margin-top: 10px;
	padding: 8px 10px;
	background: #ffebee;
	color: #c62828;
	border-radius: 6px;
	font-size: 13px;
}

/* === Popover de lecture ================================================== */

.arssat-fb-root .arssat-fb-meta {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 8px;
}

.arssat-fb-root .arssat-fb-meta__author {
	font-weight: 700;
	color: #212121;
}

.arssat-fb-root .arssat-fb-meta__date {
	font-size: 12px;
	color: #888;
}

.arssat-fb-root .arssat-fb-content {
	color: #212121;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* On restaure les listes que le reset local a neutralisées. */
.arssat-fb-root .arssat-fb-content p {
	margin: 0 0 8px;
}

.arssat-fb-root .arssat-fb-content ul {
	list-style: disc;
	padding-left: 20px;
	margin: 8px 0;
}

.arssat-fb-root .arssat-fb-content ol {
	list-style: decimal;
	padding-left: 20px;
	margin: 8px 0;
}

.arssat-fb-root .arssat-fb-content li {
	margin: 2px 0;
}

.arssat-fb-root .arssat-fb-content strong,
.arssat-fb-root .arssat-fb-content b {
	font-weight: 700;
}

.arssat-fb-root .arssat-fb-content em,
.arssat-fb-root .arssat-fb-content i {
	font-style: italic;
}

.arssat-fb-root .arssat-fb-thumb {
	display: block;
	max-width: 100%;
	max-height: 180px;
	border-radius: 6px;
	margin-top: 10px;
	cursor: zoom-in;
}

.arssat-fb-root .arssat-fb-download {
	display: inline-block;
	margin-top: 8px;
	color: #1976D2;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

/* === Lightbox ============================================================ */

.arssat-fb-root .arssat-fb-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, .85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2147483010;
	cursor: zoom-out;
}

.arssat-fb-root .arssat-fb-lightbox__img {
	max-width: 92vw;
	max-height: 92vh;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
}

/* === Tiroir des orphelins =============================================== */

.arssat-fb-root .arssat-fb-orphans-toggle {
	position: fixed;
	bottom: 88px;
	right: 24px;
	min-width: 44px;
	height: 32px;
	padding: 0 10px;
	border: none;
	border-radius: 16px;
	background: #FB8C00;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	z-index: 2147483003;
}

.arssat-fb-root .arssat-fb-orphans-panel {
	position: fixed;
	bottom: 128px;
	right: 24px;
	width: 300px;
	max-width: calc(100vw - 24px);
	max-height: 50vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
	padding: 12px;
	z-index: 2147483004;
}

.arssat-fb-root .arssat-fb-orphans-panel__title {
	font-weight: 700;
	margin-bottom: 4px;
}

.arssat-fb-root .arssat-fb-orphans-panel__hint {
	font-size: 12px;
	color: #888;
	margin-bottom: 10px;
}

.arssat-fb-root .arssat-fb-orphans__list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.arssat-fb-root .arssat-fb-orphans__item {
	display: flex;
	align-items: baseline;
	gap: 6px;
	width: 100%;
	text-align: left;
	padding: 8px;
	border: 1px solid #eee;
	border-radius: 6px;
	background: #fafafa;
	cursor: pointer;
	font-size: 13px;
}

.arssat-fb-root .arssat-fb-orphans__item:hover {
	background: #f0f0f0;
}

.arssat-fb-root .arssat-fb-orphans__num {
	font-weight: 700;
	color: #FB8C00;
}

.arssat-fb-root .arssat-fb-orphans__author {
	font-weight: 600;
}

.arssat-fb-root .arssat-fb-orphans__excerpt {
	color: #777;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* === Toast =============================================================== */

.arssat-fb-root .arssat-fb-toast {
	position: fixed;
	bottom: 92px;
	right: 92px;
	max-width: 320px;
	background: #212121;
	color: #fff;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
	z-index: 2147483005;
	opacity: 1;
	transition: opacity 200ms ease;
}

.arssat-fb-root .arssat-fb-toast--out {
	opacity: 0;
}

/* === Curseur custom en mode ajout ======================================== */

/*
 * Curseur SVG inline : pastille bleue 32×32 avec un « + » blanc et une
 * bordure blanche pour rester lisible sur tout fond (image, texte clair,
 * texte foncé). Hotspot au centre (16,16) pour que le clic tombe sur le « + ».
 * Repli sur « crosshair » si le navigateur n'accepte pas le data: URI.
 */
html.arssat-fb-adding * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="13" fill="%231976D2" stroke="%23ffffff" stroke-width="3"/><path d="M16 10v12 M10 16h12" stroke="%23ffffff" stroke-width="3" stroke-linecap="round" fill="none"/></svg>') 16 16, crosshair !important;
}

/* Notre interface garde des curseurs cohérents (id => forte spécificité). */
html.arssat-fb-adding #arssat-fb-root,
html.arssat-fb-adding #arssat-fb-root * {
	cursor: default !important;
}

html.arssat-fb-adding #arssat-fb-root button,
html.arssat-fb-adding #arssat-fb-root a {
	cursor: pointer !important;
}

/* Les pins gardent leur curseur grab même en mode ajout (sont déplaçables). */
html.arssat-fb-adding #arssat-fb-root .arssat-fb-pin {
	cursor: grab !important;
}

html.arssat-fb-adding #arssat-fb-root .arssat-fb-pin--ghost {
	cursor: default !important;
}

html.arssat-fb-adding #arssat-fb-root input,
html.arssat-fb-adding #arssat-fb-root .ql-editor {
	cursor: text !important;
}

html.arssat-fb-adding #arssat-fb-root .arssat-fb-thumb {
	cursor: zoom-in !important;
}
