/************************************************
 *
 * PI PIVOD – styles du plugin (indépendants du thème)
 * À placer dans /assets/css/style-plugin.css du plugin.
 *
 * Couleurs : on lit la palette du thème si elle existe,
 * sinon la valeur de secours entre parenthèses.
 *
 ************************************************/

:root {
	--pi-orange: var(--wp--preset--color--accent, #ff3300);
	--pi-vert:   var(--wp--preset--color--accent-2, #29a6a3);
	--pi-beige-clair: var(--wp--preset--color--accent-5, #fdfaf5);
}


/************************************************
 * LISTE DES PERMANENCES (Accompagnement, Responsable)
 ************************************************/

/* Remise à zéro des marges : l'espacement est géré ci-dessous */
.liste-permanences .permanence :is(h3, p, ul) {
	margin-top: 0;
	margin-bottom: 0;
}
.liste-permanences .permanence h3 {
	font-weight: bold;
	font-size: 18px;
	line-height: 1.4em;
	text-transform: uppercase;
}
.liste-permanences .permanence p {
	font-size: 16px;
	line-height: 1.4em;
}
.liste-permanences .permanence ul {
	list-style-type: none;
	padding: 10px 0;
	font-size: 16px;
	line-height: 1.4em;
}
.liste-permanences .permanence {
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 1px #e3e3e3 solid;
}


/************************************************
 * FORMATIONS / ÉVÉNEMENTS
 ************************************************/

/* Remise à zéro des marges (navigateur / thème) : l'espacement est géré ci-dessous */
.liste-formations :is(h3, h4, h5, p, ul),
.liste-evenements :is(h3, h4, h5, p, ul) {
	margin-top: 0;
	margin-bottom: 0;
}

.liste-formations h3,
.liste-evenements h3 {
	font-weight: 600;
	font-size: 18px;
	line-height: 1.4em;
	margin-bottom: 10px;
}
.liste-formations p,
.liste-evenements p {
	font-size: 16px;
	line-height: 1.4em;
	padding-bottom: 0.5em;
}
.liste-formations ul,
.liste-evenements ul {
	list-style-type: none;
	padding: 10px 0;
	font-size: 16px;
	line-height: 1.4em;
}
.liste-formations .formation,
.liste-evenements .evenement {
	margin-bottom: 20px;
	border-bottom: 3px solid #eee;
	padding-bottom: 15px;
}
.liste-formations .formation a,
.liste-evenements .evenement a {
	color: var(--pi-vert) !important;
}

.liste-formations .formation-statut-complet {
	display: inline-block;
	background-color: var(--pi-vert);
	color: #ffffff;
	padding: 8px;
	font-weight: bold;
	font-size: 0.85rem;
	border-radius: 4px;
	margin-top: 0;
	margin-bottom: 10px;
	line-height: 1em !important;
}
.liste-formations .formation-details-wrapper,
.liste-evenements .evenement-details-wrapper {
	font-size: 16px;
}
.liste-formations .toggle-details,
.liste-evenements .toggle-details {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--pi-vert) !important;
	text-decoration: underline;
	cursor: pointer;
}
.liste-formations .details-content,
.liste-evenements .details-content {
	margin-top: 10px;
	padding: 20px;
	background: var(--pi-beige-clair) !important;
	border-left: 3px solid var(--pi-vert);
	border-radius: 5px;
	width: 75%;
}
.liste-formations .details-content h4,
.liste-evenements .details-content h4 {
	font-size: 18px;
	line-height: 1.4em;
	font-weight: bold;
}
.liste-formations .details-content h5,
.liste-evenements .details-content h5 {
	font-size: 16px;
	font-weight: bold;
	line-height: 1.4em;
	margin: 1rem 0 .5rem;
	text-transform: uppercase;
}
.liste-formations .lien-inscription,
.liste-evenements .lien-inscription {
	margin-top: 15px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: underline;
}

.icon-lucide {
	display: inline-block;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}
.liste-formations .lien-inscription:hover .icon-lucide,
.liste-evenements .lien-inscription:hover .icon-lucide {
	transform: translate(2px, -2px);
}


/************************************************
 * PRISE DE RENDEZ-VOUS
 ************************************************/

#pi-rdv-form {
	max-width: 500px;
}
#pi-rdv-form label {
	font-size: 16px;
	display: block;
	margin-top: 15px;
	font-weight: bold;
}
#pi-rdv-form input,
#pi-rdv-form select,
#pi-rdv-form textarea {
	width: 100%;
	display: block;
	margin-top: 5px;
	padding: 6px 8px;
	font-size: 13px;
}
#pi-rdv-form input[name="date_rdv"] {
	width: 100px;
}
#pi-rdv-form input[name="heure_rdv"] {
	width: 75px;
}
#pi-rdv-form select {
	height: 32px;
	font-size: 14px;
	padding: 0 40px 0 12px;
	border-radius: 0;
	border: 1px solid #bbb;
	appearance: none;
	background-color: #fff;
	/* Chevron en SVG intégré : plus de dépendance à la médiathèque */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 10px;
	cursor: pointer;
}
#pi-rdv-form textarea {
	height: 100px;
}
#pi-rdv-form .acceptation {
	display: flex;
	flex-direction: row;
	font-weight: normal;
}
#pi-rdv-form .acceptation input {
	width: 20px;
}
#pi-rdv-form button {
	display: block;
	background-color: var(--pi-orange);
	font-size: 20px;
	font-weight: 600;
	margin: 20px 0 0;
	padding: .5em 1em;
	color: #ffffff;
	border-radius: 6px;
	border: 1px solid var(--pi-orange);
	cursor: pointer;
}
#pi-rdv-form button:hover {
	background-color: #ffffff;
	color: var(--pi-orange);
}

.pi-required {
	color: #dc3232;
	font-weight: bold;
}
.pi-required-mention {
	margin-top: 20px;
}
.pi-success {
	background-color: #ecf7ed;
	border-left: 4px solid #46b450;
	padding: 12px 16px !important;
	margin: 15px 0;
	color: #2d6a30;
	font-size: 15px;
	border-radius: 5px;
}
.pi-error {
	background-color: #fde8e8;
	border-left: 4px solid #dc3232;
	padding: 12px 16px;
	margin: 15px 0;
	color: #8a1f1f;
	font-size: 15px;
	border-radius: 5px;
}


/************************************************
 * ESPACE MEMBRE (page Responsable)
 * Suppose un conteneur de classe .responsable
 ************************************************/

.responsable p {
	font-size: 16px;
}
.responsable .bonjour {
	font-size: 17px;
	padding: 20px 0 50px !important;
}
.responsable .bonjour .nom {
	font-weight: bold;
}
.responsable h2 {
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	margin-bottom: 10px;
}
.responsable .liste-permanences h2 {
	margin-bottom: 20px;
}
.responsable .no-rdv {
	background: #f8dda7;
	display: inline-block;
	padding: 0.5em 1em !important;
	margin: 30px 0;
}
.responsable .pi-rdv-table {
	margin-top: 30px;
}
.responsable .tab-rdv {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	border-left: none !important;
	border-right: none !important;
	border-top: none !important;
}
.responsable .tab-rdv thead th {
	border-bottom: 2px solid #222222;
	color: #000000 !important;
}

/* Lignes « volet » masquées par défaut (ouvertes en JS) */
[id^="volet-row-"] {
	display: none;
}

@media (max-width: 768px) {

	.responsable .tab-rdv thead {
		display: none;
	}

	.responsable .tab-rdv,
	.responsable .tab-rdv tbody,
	.responsable .tab-rdv tr,
	.responsable .tab-rdv td {
		display: block;
		width: 100%;
		box-sizing: border-box;
		border: none;
	}

	/* Une carte par ligne */
	.responsable .tab-rdv tbody tr {
		border: 1px solid #ddd;
		border-radius: 6px;
		margin-bottom: 15px;
		padding: 10px 12px;
		background: #fff;
		box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
	}

	/* Lignes « volet » : masquées aussi sur mobile (sinon carte vide « — ») */
	.responsable .tab-rdv tr[id^="volet-row-"] {
		display: none;
	}

	/* Label générique via data-label */
	.responsable .tab-rdv td::before {
		content: attr(data-label) ' — ';
		font-weight: bold;
	}

	/* Statut : pas de label devant le badge */
	.responsable .tab-rdv td[data-label="Statut"]::before {
		content: '';
	}

	/* Permanence en plus petit */
	.responsable .tab-rdv td[data-label="Permanence"] {
		font-size: 0.82em;
		color: #666;
	}

	/* Date en plus petit, séparée du reste par un filet */
	.responsable .tab-rdv td[data-label="Demande"] {
		font-size: 0.85em;
		color: #444;
		border-top: 1px solid #eee;
		margin-top: 6px;
		padding-top: 8px;
	}
}

.status-button {
	/* TODO phase 2 : cursor: pointer; */
	border-bottom: 1px solid rgba(0, 0, 0, .05);
	border-radius: 4px;
	padding: .5em 1em;
}
.status-demande {
	background: #f8dda7;
	color: #2c4700;
}
.status-rdv_pris {
	background: #c6e1c6;
	color: #2c4700;
}
.status-annule {
	background: #ff6b6b;
	color: #2c2c2c;
}

.responsable .volet-col {
	padding: 0 24px;
	background-color: #f9f9f9;
}
.responsable .rdv-volet {
	margin: 20px 0;
}
.responsable .rdv-volet h4 {
	font-weight: bold;
}
.responsable .rdv-volet h4.statut-actuel {
	margin: 40px 0 10px;
}
.responsable .rdv-volet h4 .titre-statut {
	margin-right: 10px;
}
.responsable .rdv-volet h4 .statut-date-heure {
	font-weight: normal;
	border: 1px solid #333;
	padding: .25em 0.75em;
	border-radius: 4px;
	font-size: .9em;
}
.responsable .rdv-volet .question.demande-annule {
	margin-bottom: 20px;
}
.responsable .rdv-actions {
	display: flex;
	gap: 10px;
	margin: 10px 0 20px;
}
.responsable .rdv-actions button {
	padding: 6px 12px;
	border-radius: 4px;
	border: none;
	cursor: pointer;
}
.responsable .rdv-volet h4.historique {
	margin-top: 30px;
}


/************************************************
 * ESPACE MEMBRE (page Responsable, [espace_membre])
 ************************************************/

.espace-membre__intro {
	text-align: center;
}
.espace-membre__barre {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 30px;
}

/************************************************
 * CONNEXION
 ************************************************/

#pi-login-form {
	max-width: 400px;
}
#pi-login-form label {
	display: block;
	margin-top: 15px;
	font-weight: bold;
	font-size: 16px;
}
#pi-login-form input[type="text"],
#pi-login-form input[type="password"] {
	width: 100%;
	display: block;
	margin-top: 5px;
	padding: 6px 8px;
	font-size: 13px;
}
#pi-login-form .pi-remember {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	font-weight: normal;
	margin-top: 15px;
}
#pi-login-form .pi-remember input {
	width: 20px;
	margin: 0;
}
#pi-login-form button {
	display: block;
	background-color: var(--pi-orange);
	font-size: 20px;
	font-weight: 600;
	margin: 30px 0 0;
	padding: .3em 1em;
	color: #ffffff;
	border-radius: 6px;
	border-width: 0;
	cursor: pointer;
}
#pi-login-form .pi-login-links {
	margin-top: 15px;
	font-size: 14px;
}
