/* VD AI Expert - widget chat frontend */

.ite-launcher {
	position: fixed;
	right: 24px;
	bottom: 24px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: #2271b1;
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.25 );
	z-index: 99998;
}
.ite-launcher.ite-hidden {
	display: none;
}
.ite-launcher-icon {
	line-height: 1;
}

.ite-panel {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 14px;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a1a1a;
}
.ite-panel-float {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 400px;
	max-width: 100vw;
	height: 100vh;
	height: 100dvh;
	border-radius: 0;
	box-shadow: 0 0 40px rgba( 0, 0, 0, 0.22 );
	z-index: 99999;
	display: none;
}
.ite-panel-float.ite-open {
	display: flex;
}
.ite-panel-inline {
	width: 100%;
	max-width: 640px;
	height: 100vh;
	height: calc( 100dvh - 32px );
	margin: 16px 0;
}
/* Se la barra di amministrazione di WordPress è presente, sottrai la sua altezza
   (32px da desktop, 46px sotto i 782px) così il pannello non sfora la pagina. */
body.admin-bar .ite-panel-inline {
	height: calc( 100vh - 32px );
	height: calc( 100dvh - 32px - 32px );
}
@media screen and ( max-width: 782px ) {
	body.admin-bar .ite-panel-inline {
		height: calc( 100vh - 46px );
		height: calc( 100dvh - 32px - 46px );
	}
}

.ite-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: #2271b1;
	color: #fff;
}
.ite-header-title {
	font-weight: 600;
}
.ite-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.ite-userbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 14px;
	background: #eef2f6;
	border-bottom: 1px solid #e1e6eb;
	font-size: 13px;
}
.ite-userbar-name {
	color: #333;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ite-userbar-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}
.ite-admin-tickets,
.ite-logout,
.ite-my-tickets {
	color: #2271b1 !important;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	font-family: inherit;
	line-height: inherit;
	white-space: nowrap;
}
/* "I miei ticket" è un <button>: azzera gli stili nativi del bottone così
   risulta identico ai link "Esci" e "Vedi ticket". */
.ite-my-tickets {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
}
.ite-admin-tickets:hover,
.ite-logout:hover,
.ite-my-tickets:hover {
	text-decoration: underline;
}

/* Pannello "I miei ticket" (overlay) */
.ite-tickets-panel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	top: 48px;
	background: #fff;
	display: flex;
	flex-direction: column;
	z-index: 5;
}
.ite-panel-inline .ite-tickets-panel {
	top: 48px;
}
.ite-tickets-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 14px;
	border-bottom: 1px solid #ececec;
	background: #f6f7f9;
}
.ite-tickets-title {
	font-weight: 600;
	flex: 1 1 auto;
	text-align: center;
}
.ite-tickets-back,
.ite-tickets-close {
	background: none;
	border: none;
	cursor: pointer;
	color: #2271b1;
	font-weight: 600;
	font-size: 14px;
}
.ite-tickets-close {
	font-size: 20px;
	line-height: 1;
	color: #666;
}
.ite-tickets-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 12px;
}
.ite-tickets-loading,
.ite-tickets-empty {
	color: #777;
	text-align: center;
	padding: 20px 8px;
}
.ite-ticket-item {
	display: block;
	width: 100%;
	text-align: left;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 8px;
	cursor: pointer;
}
.ite-ticket-item:hover {
	border-color: #2271b1;
}
.ite-ticket-item-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}
.ite-ticket-subj {
	font-weight: 600;
	color: #1a1a1a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ite-ticket-meta {
	color: #888;
	font-size: 12px;
	margin-top: 4px;
}
.ite-tk-badge {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
}
.ite-tk-open {
	background: #fcf0d1;
	color: #8a6d00;
}
.ite-tk-closed {
	background: #e6f4ea;
	color: #1e7a34;
}
.ite-ticket-detail-subj {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.ite-bubble-who {
	font-size: 11px;
	color: #666;
	margin-bottom: 2px;
	font-weight: 600;
}
.ite-bubble-date {
	font-size: 11px;
	color: #999;
	margin-top: 4px;
}

.ite-log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px;
	background: #f6f7f9;
}

.ite-msg {
	display: flex;
	margin-bottom: 10px;
}
.ite-msg-user {
	justify-content: flex-end;
}
.ite-bubble {
	max-width: 82%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.ite-msg-ai .ite-bubble {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-bottom-left-radius: 4px;
}
.ite-msg-user .ite-bubble {
	background: #2271b1;
	color: #fff;
	border-bottom-right-radius: 4px;
}
.ite-typing .ite-bubble {
	color: #888;
	font-style: italic;
}

.ite-footer {
	border-top: 1px solid #ececec;
	background: #fff;
	padding: 10px;
}
.ite-composer {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}
.ite-input {
	flex: 1 1 auto;
	resize: none;
	border: 1px solid #ccd0d4;
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 14px;
	font-family: inherit;
	max-height: 120px;
}
.ite-send {
	border: none;
	background: #2271b1;
	color: #fff;
	border-radius: 10px;
	padding: 9px 16px;
	cursor: pointer;
	font-weight: 600;
}
.ite-send:disabled {
	opacity: 0.6;
	cursor: default;
}

.ite-login {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.ite-login-btn {
	display: block;
	text-align: center;
	background: #2271b1;
	color: #fff !important;
	text-decoration: none;
	padding: 10px;
	border-radius: 10px;
	font-weight: 600;
	border: none;
	cursor: pointer;
	font-size: 14px;
	font-family: inherit;
}
.ite-login-btn:disabled {
	opacity: 0.6;
	cursor: default;
}
/* Colori brand dei provider. */
.ite-login-microsoft { background: #2f2f2f; }
.ite-login-google    { background: #ea4335; }
.ite-login-facebook  { background: #1877f2; }
.ite-login-github    { background: #24292f; }
.ite-login-linkedin  { background: #0a66c2; }
.ite-login-magic     { background: #2271b1; }

/* Form magic link. */
.ite-magic-form {
	display: flex;
	gap: 8px;
}
.ite-magic-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 1px solid #ccd0d4;
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 14px;
	font-family: inherit;
}
.ite-magic-form .ite-login-btn {
	flex: 0 0 auto;
	white-space: nowrap;
}
.ite-magic-note {
	font-size: 13px;
	margin-top: 6px;
	padding: 6px 10px;
	border-radius: 8px;
}
.ite-magic-ok {
	background: #e6f4ea;
	color: #1e7a34;
}
.ite-magic-err {
	background: #fcebea;
	color: #b32d2e;
}

.ite-actions,
.ite-feedback {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px 4px;
}
.ite-ticket-btn {
	background: #fff;
	border: 1px solid #2271b1;
	color: #2271b1;
	border-radius: 20px;
	padding: 7px 16px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
}
.ite-feedback-label {
	font-size: 13px;
	color: #666;
}
.ite-fb-btn {
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
}
