/* Chatbot Descoperă Stăuceni — stiluri proprii, fără dependențe.
   Toate clasele sunt prefixate cu .stcb ca să nu se lovească de tema Bootscore. */

.stcb {
	--stcb-navy: #042C63;
	--stcb-navy-inchis: #021127;
	--stcb-nisip: #B5A886;
	--stcb-cald: #FEE1C7;
	--stcb-albastru-deschis: #D8E7FD;
	--stcb-alb: #ffffff;
	--stcb-text: #1c2330;
	--stcb-gri: #5b6472;
	--stcb-linie: #dfe6f2;
	--stcb-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
		"Noto Sans", "Liberation Sans", Arial, sans-serif;

	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	font-family: var(--stcb-font);
	font-size: 15px;
	line-height: 1.55;
	color: var(--stcb-text);
}

.stcb *,
.stcb *::before,
.stcb *::after {
	box-sizing: border-box;
}

/* Atributul „hidden” trebuie să bată regulile de display de mai jos,
   altfel fereastra ascunsă continuă să prindă clicurile paginii. */
.stcb[hidden],
.stcb [hidden] {
	display: none !important;
}

/* ---------- Iconița ---------- */

.stcb-iconita {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px 18px 12px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--stcb-navy);
	color: var(--stcb-alb);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(4, 44, 99, .28);
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.stcb-iconita:hover {
	background: var(--stcb-navy-inchis);
	transform: translateY(-1px);
	box-shadow: 0 10px 28px rgba(4, 44, 99, .34);
}

.stcb-iconita:focus-visible {
	outline: 3px solid var(--stcb-nisip);
	outline-offset: 3px;
}

.stcb-iconita-semn {
	display: inline-flex;
}

.stcb-iconita--deschis {
	display: none;
}

/* ---------- Fereastra ---------- */

.stcb-fereastra {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: min(620px, calc(100vh - 40px));
	border: 1px solid var(--stcb-linie);
	border-radius: 18px;
	background: var(--stcb-alb);
	box-shadow: 0 18px 60px rgba(2, 17, 39, .26);
	overflow: hidden;
	animation: stcb-apare .22s ease;
}

.stcb-inchide:before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    opacity: 0; /* Pornim de la complet transparent */
    z-index: -1;
    pointer-events: none;
	cursor: default;
}

.stcb--deschis .stcb-inchide:before {
    pointer-events: auto;
    
    /* Lansăm animația custom de fade-in */
    animation: stcbBackdropFadeIn 1.4s ease forwards;
}

/* Definirea animației independente pentru overlay */
@keyframes stcbBackdropFadeIn {
    from { opacity: 0; }
    to   { opacity: 0.33; }
}


@keyframes stcb-apare {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.stcb-fereastra { animation: none; }
	.stcb-iconita { transition: none; }
	.stcb-bloc { animation: none !important; }
}

/* ---------- Antet ---------- */

.stcb-antet {
	position: relative;
	flex: 0 0 auto;
	padding: 16px 52px 14px 20px;
	background: var(--stcb-navy);
	color: var(--stcb-alb);
}

.stcb-titlu {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .01em;
	color: var(--stcb-alb);
}

.stcb-subtitlu {
	margin: 2px 0 0;
	font-size: 12.5px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--stcb-albastru-deschis);
}

.stcb-inchide {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: var(--stcb-alb);
	cursor: pointer;
}

.stcb-inchide:hover {
	background: rgba(255, 255, 255, .22);
}

.stcb-inchide:focus-visible {
	outline: 2px solid var(--stcb-cald);
	outline-offset: 2px;
}

/* ---------- Conversația ---------- */

.stcb-conversatie {
	flex: 1 1 auto;
	padding: 18px 18px 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: linear-gradient(180deg, #f7faff 0%, #ffffff 120px);
}

.stcb-conversatie:focus {
	outline: none;
}

.stcb-bloc {
	margin-bottom: 16px;
	animation: stcb-intra .2s ease;
}

@keyframes stcb-intra {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.stcb-mesaj {
	margin: 0 0 12px;
	padding: 12px 14px;
	border-radius: 4px 14px 14px 14px;
	background: var(--stcb-albastru-deschis);
	color: var(--stcb-text);
}

.stcb-mesaj p {
	margin: 0;
}

.stcb-mesaj + .stcb-mesaj {
	border-radius: 14px;
}

.stcb-alegere {
	display: block;
	margin: 0 0 12px auto;
	padding: 9px 14px;
	max-width: 85%;
	border-radius: 14px 4px 14px 14px;
	background: var(--stcb-navy);
	color: var(--stcb-alb);
	font-weight: 600;
	text-align: right;
}

.stcb-avertisment {
	margin: -4px 0 12px;
	padding: 10px 12px;
	border-left: 3px solid var(--stcb-nisip);
	border-radius: 0 8px 8px 0;
	background: var(--stcb-cald);
	color: #4a3a22;
	font-size: 13.5px;
}

.stcb-noapte {
	margin: -4px 0 12px;
	font-size: 13px;
	color: var(--stcb-gri);
}

/* ---------- Butoanele ---------- */

.stcb-optiuni {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stcb-buton {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 14px;
	border: 1.5px solid var(--stcb-navy);
	border-radius: 10px;
	background: var(--stcb-alb);
	color: var(--stcb-navy);
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.stcb-buton:hover {
	background: var(--stcb-navy);
	color: var(--stcb-alb);
}

.stcb-buton:focus-visible {
	outline: 3px solid var(--stcb-nisip);
	outline-offset: 2px;
}

.stcb-buton[disabled] {
	border-color: var(--stcb-linie);
	background: #f4f6fa;
	color: #9aa3b1;
	cursor: default;
}

.stcb-buton--tel {
	border-color: var(--stcb-navy);
	background: var(--stcb-navy);
	color: var(--stcb-alb);
}

.stcb-buton--tel:hover {
	background: var(--stcb-navy-inchis);
	border-color: var(--stcb-navy-inchis);
	color: var(--stcb-alb);
}

.stcb-buton--secundar {
	border-color: var(--stcb-linie);
	color: var(--stcb-gri);
	font-weight: 500;
}

.stcb-buton--secundar:hover {
	border-color: var(--stcb-navy);
	background: var(--stcb-alb);
	color: var(--stcb-navy);
}

.stcb-navigare {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.stcb-navigare .stcb-buton {
	width: auto;
	flex: 1 1 auto;
	padding: 8px 12px;
	font-size: 13.5px;
	text-align: center;
}

.stcb-feedback {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px dashed var(--stcb-linie);
}

.stcb-feedback-intrebare {
	margin: 0 0 8px;
	font-size: 13.5px;
	color: var(--stcb-gri);
}

.stcb-feedback-butoane {
	display: flex;
	gap: 8px;
}

.stcb-feedback-butoane .stcb-buton {
	width: auto;
	min-width: 74px;
	padding: 7px 14px;
	font-size: 13.5px;
	text-align: center;
}

/* ---------- Subsolul ---------- */

.stcb-subsol {
	flex: 0 0 auto;
	padding: 12px 18px;
	border-top: 1px solid var(--stcb-linie);
	background: var(--stcb-alb);
	text-align: center;
}

.stcb-subsol-link {
	display: inline-block;
	color: var(--stcb-navy);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.stcb-subsol-link:hover {
	text-decoration: underline;
}

.stcb-subsol-link:focus-visible {
	outline: 3px solid var(--stcb-nisip);
	outline-offset: 3px;
}

div#mobile-chat-hint {
	--mch-color: var(--bs-warning);
	--mch-textcolor: #fff;
	position: fixed;
	bottom: 62px;
    right: 21px;
    background-color: var(--mch-color);
	color: var(--mch-textcolor);
	padding: 3px 11px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: bold;
	box-shadow: 0 4px 10px rgba(0,0,0,0.15);
	transition: opacity 0.5s ease;
	pointer-events: none;
	opacity: 0;
	display: none;
}

div#mobile-chat-hint:after {
	content: '';
	position: absolute;
	bottom: -5px;
	right: 15px;
	border-width: 5px 5px 0;
	border-style: solid;
	border-color: var(--mch-color) transparent; /* Potrivește culoarea cu fundalul balonașului */
}

/* ---------- Mobil ---------- */

@media (max-width: 575.98px) { /* xs only */
	.stcb {
		right: 14px;
		bottom: 14px;
	}

	.stcb-iconita {
		padding: 14px;
	}

	.stcb-iconita-text {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
		border: 0;
	}

	.stcb-fereastra {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-width: 100%;
		max-height: 88vh;
		max-height: 88dvh;
		border-radius: 18px 18px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
	}

	.stcb--deschis .stcb-iconita {
		display: none;
	}
	
	div#mobile-chat-hint {
		display: block;
	}
}

/* Pe ecrane tactile, „hover” rămâne lipit după atingere. Îl anulăm. */
@media (hover: none) {
	.stcb-buton:hover {
		background: var(--stcb-alb);
		color: var(--stcb-navy);
	}

	.stcb-buton--tel:hover {
		background: var(--stcb-navy);
		color: var(--stcb-alb);
	}

	.stcb-buton--secundar:hover {
		border-color: var(--stcb-linie);
		color: var(--stcb-gri);
	}

	.stcb-iconita:hover {
		background: var(--stcb-navy);
		transform: none;
	}
}

@media (prefers-contrast: more) {
	.stcb-mesaj { background: #cfe0fb; }
	.stcb-buton { border-width: 2px; }
}
