/*
Plugin Name: DS Activités
Description: Plugin WordPress pour afficher et filtrer les activités/projets de l'association
Version: 1.0.0
Author: Les DIGIVORES | https://lesdigivores.ch
Text Domain: ds-activites
*/

/* DS Activités - Styles principaux */

:root {
	/* Couleurs par défaut - peuvent être modifiées via l'admin */
	--ds-header-bg: #9d2255;
	--ds-header-text: #ffffff;
	--ds-card-bg: #ffffff;
	--ds-card-text: #333333;
	--ds-button-bg: #9d2255;
	--ds-button-text: #ffffff;
	--ds-filter-bg: transparent;
	--ds-filter-text: #666666;
	--ds-accent: #fc8b9a;
	--ds-gray-light: #fbfbfb;
	--ds-gray-medium: #e9ecef;
	--ds-shadow: rgba(0, 0, 0, 0.1);
}

/* Reset et base */
.ds-activites-container * {
	box-sizing: border-box;
}

.ds-activites-container {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background-color: var(--ds-gray-light);
	color: var(--ds-card-text);
	line-height: 1.6;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Header - Supprimé selon la demande */

/* Navigation/Filtres */
.ds-activites-filters {
	background: transparent;
	padding: 1rem 0;
	margin-bottom: 3rem;
	border: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ds-filters-container {
	display: flex;
	align-items: stretch; /* Étend tous les éléments sur toute la hauteur */
	gap: 1rem;
	flex-wrap: nowrap; /* Empêche le retour à la ligne pour maintenir la hauteur */
}

.ds-filters-label {
	background: #EFEBE7;
	color: var(--ds-filter-text);
	font-size: 1rem;
	font-weight: 500;
	margin: 0;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	height: auto; /* Hauteur automatique basée sur le contenu */
	align-self: stretch; /* S'étend sur toute la hauteur disponible */
	flex-shrink: 0; /* Empêche la réduction de taille */
}

.ds-filters-label::before {
	content: '\f0b0'; /* FontAwesome filter icon */
	font-family: 'Font Awesome 5 Free';
	font-weight: 900;
	font-size: 1.1rem;
	color: #9D2255; /* Couleur de l'icône */
}

.ds-filters-grid {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	align-items: center; /* Centre les boutons verticalement */
	flex: 1; /* Prend l'espace restant */
}

.ds-filter-button {
	background: var(--ds-card-bg);
	border: 1px solid var(--ds-gray-medium);
	border-radius: 25px;
	padding: 0.75rem 1.25rem;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	color: var(--ds-filter-text);
	font-size: 0.9rem;
	font-weight: 500;
	white-space: nowrap;
}

.ds-filter-button:hover,
.ds-filter-button.active {
	background: var(--ds-button-bg);
	color: var(--ds-button-text);
	border-color: var(--ds-button-bg);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(157, 34, 85, 0.2);
}

.ds-filter-button img {
	width: 20px;
	height: 20px;
	object-fit: cover;
	border-radius: 50%;
}

.ds-filter-button span {
	font-weight: 500;
}

/* Grille des activités */
.ds-activites-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
	margin-bottom: 3rem;
}

.ds-activity-card {
	background: var(--ds-card-bg);
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	position: relative;
}

.ds-activity-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ds-activity-image-container {
	position: relative;
	width: 100%;
	height: 200px;
	overflow: hidden;
}

.ds-activity-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.ds-activity-card:hover .ds-activity-image {
	transform: scale(1.05);
}

/* Badge de catégorie sur l'image */
.ds-activity-category-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 20px;
	padding: 0.5rem 0.75rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	backdrop-filter: blur(5px);
}

.ds-activity-category-badge img {
	width: 16px;
	height: 16px;
	object-fit: cover;
	border-radius: 50%;
}

.ds-activity-category-badge span {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ds-card-text);
	white-space: nowrap;
}

.ds-activity-content {
	padding: 1.5rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
}

.ds-activity-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--ds-card-text);
	margin: 0 0 1rem 0;
	line-height: 1.3;
}

.ds-activity-button {
	display: inline-block;
	background: var(--ds-button-bg);
	color: var(--ds-button-text);
	text-decoration: none;
	padding: 0.75rem 1.5rem;
	border-radius: 25px;
	font-weight: 500;
	font-size: 0.9rem;
	transition: all 0.3s ease;
	margin-top: auto;
	cursor: pointer;
}

.ds-activity-button:hover {
	background: var(--ds-accent);
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(157, 34, 85, 0.3);
}

/* État de chargement */
.ds-loading {
	text-align: center;
	padding: 3rem;
	color: #666;
}

.ds-loading::after {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #ddd;
	border-top: 2px solid var(--ds-button-bg);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-left: 10px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* État vide */
.ds-no-activities {
	text-align: center;
	padding: 3rem;
	color: #666;
	background: var(--ds-card-bg);
	border-radius: 15px;
	box-shadow: 0 4px 6px var(--ds-shadow);
}

.ds-no-activities h3 {
	color: var(--ds-card-text);
	margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
	.ds-activites-container {
		padding: 0 15px;
	}
	
	.ds-filters-grid {
		grid-template-columns: 1fr;
	}
	
	.ds-activites-grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
	
	.ds-filter-button {
		min-width: auto;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.ds-activites-filters {
		padding: 1.5rem;
	}
	
	.ds-activity-content {
		padding: 1rem;
	}
}

/* Animations d'apparition */
.ds-activity-card {
	opacity: 0;
	transform: translateY(20px);
	animation: fadeInUp 0.6s ease forwards;
}

.ds-activity-card:nth-child(1) { animation-delay: 0.1s; }
.ds-activity-card:nth-child(2) { animation-delay: 0.2s; }
.ds-activity-card:nth-child(3) { animation-delay: 0.3s; }
.ds-activity-card:nth-child(4) { animation-delay: 0.4s; }
.ds-activity-card:nth-child(5) { animation-delay: 0.5s; }
.ds-activity-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Styles pour l'admin */
.ds-admin-styles {
	background: var(--ds-card-bg);
	padding: 2rem;
	border-radius: 15px;
	margin-top: 2rem;
	box-shadow: 0 4px 6px var(--ds-shadow);
}

.ds-admin-styles h3 {
	color: var(--ds-card-text);
	margin-bottom: 1rem;
	border-bottom: 2px solid var(--ds-gray-medium);
	padding-bottom: 0.5rem;
} 

/* Lien de la carte */
.ds-activity-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
	transition: transform 0.3s ease;
}

.ds-activity-card-link:hover {
	transform: translateY(-5px);
}

.ds-activity-card-link:hover .ds-activity-card {
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Style de base pour le conteneur */ 