
/**
 * CSS de l'application Saitoo
 * @see admin/includes/functions/Saitoo.php
 */


:root {
	--primary-color: #1e293b; /* Slate 800 pour le texte/header */
	--spartoo-red: #C30040;   /* Rouge Spartoo pour le bouton et bulles user */
	--bg-color: #f1f5f9;      /* Slate 100 pour le fond */
	--border-color: #e2e8f0;   /* Slate 200 */
	--text-main: #334155;     /* Slate 700 */
	--white: #ffffff;
}

/* --- LE BOUTON FLOTTANT --- */
#saitoo-trigger {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 60px;
	height: 60px;
	background-color: var(--spartoo-red);
	border-radius: 50%;
	box-shadow: 0 4px 15px rgba(195, 0, 64, 0.4);
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	color: var(--white);
	font-size: 30px;
	font-weight: bold;
	border: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	z-index: 1000; /* Toujours au dessus */
}

#saitoo-trigger:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 20px rgba(195, 0, 64, 0.6);
}

#saitoo-trigger.active {
	background-color: var(--primary-color);
}

/* --- LA FENÊTRE DE CHAT --- */
#saitoo-app-container {
	position: fixed;
	bottom: 90px; /* Juste au dessus du bouton */
	right: 20px;
	width: 380px; /* Largeur type widget */
	height: calc(80vh); /* Prends 80% de la hauteur */
	max-height: 600px;
	background: var(--white);
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 30px rgba(0,0,0,0.15);
	border-radius: 12px;
	border: 1px solid var(--border-color);
	z-index: 999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	/* Logique d'apparition/disparition */
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

#saitoo-app-container.open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

#saitoo-header {
	background: var(--primary-color);
	color: var(--white);
	padding: 1rem;
	border-radius: 12px 12px 0 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#saitoo-header strong { font-size: 1.1rem; }

#saitoo-chat-box {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	background-color: var(--bg-color);
}

.saitoo-message {
	max-width: 85%;
	padding: 0.7rem 1rem;
	border-radius: 10px;
	line-height: 1.4;
	font-size: 0.9rem;
	word-wrap: break-word;
}

.saitoo-message {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Style pour le rendu "Markdown" simulé */
.saitoo-message strong { font-weight: bold; color: var(--spartoo-red); }
.saitoo-message h1, .saitoo-message h2, .saitoo-message h3 {
    margin: 10px 0 5px 0;
    display: block;
    border-bottom: 1px solid var(--border-color);
}
.saitoo-message ul { margin-left: 20px; margin-bottom: 10px; }
.saitoo-message li { list-style-type: disc; margin-bottom: 4px; }
.saitoo-message code {
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.saitoo-message.user {
	align-self: flex-end;
	background-color: var(--spartoo-red);
	color: var(--white);
	border-bottom-right-radius: 2px;
}

.saitoo-message.ai {
	align-self: flex-start;
	background-color: var(--white);
	color: var(--text-main);
	border-bottom-left-radius: 2px;
	border: 1px solid var(--border-color);
}

#saitoo-footer {
	padding: 1rem;
	border-top: 1px solid var(--border-color);
	background: var(--white);
	border-radius: 0 0 12px 12px;
}

#saitoo-chat-form {
	display: flex;
	gap: 0.5rem;
}

#saitoo-chat-form input[type="text"] {
	flex: 1;
	padding: 0.7rem;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	outline: none;
	font-size: 0.9rem;
}

#saitoo-chat-form input[type="text"]:focus {
	border-color: var(--spartoo-red);
}

#saitoo-chat-form button[type="submit"] {
	background-color: var(--spartoo-red);
	color: var(--white);
	border: none;
	padding: 0 1rem;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	height: auto;
}

.typing::after { content: '...'; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }


.saitoo-expand-btn {
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	background: rgba(255,255,255,0.1);
	font-size: 1.2rem;
	transition: background 0.2s;
	user-select: none;
}
.saitoo-expand-btn:hover { background: rgba(255,255,255,0.2); }

#saitoo-app-container.large {
	width: 1000px;
	max-width: 90vw;
	height: 85vh;
	max-height: 900px;
}

#saitoo-app-container.large #saitoo-chat-box {
	padding: 2rem;
}