/* Cartographie des imaginaires - Styles */

/* Nuage de mots-clés */
.wordcloud-tag {
	font-weight: 600;
	padding: 3px 7px;
	border-radius: 4px;
	background: rgba(255,255,255,0.6);
	transition: background 0.15s, transform 0.15s;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	line-height: 1.4;
}
.wordcloud-tag:hover {
	background: rgba(255,255,255,0.95);
	transform: scale(1.1);
}

/* Modal acteurs – badges par source */
.wc-badge-raison    { background-color: #0d6efd; }
.wc-badge-signature { background-color: #6f42c1; }
.wc-badge-mission   { background-color: #198754; }
.wc-badge-vision    { background-color: #fd7e14; }
.wc-badge-valeurs   { background-color: #dc3545; }

/* Carte acteur dans le modal */
.wc-actor-card {
	padding: 10px 14px;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	margin-bottom: 8px;
	background: #fff;
}
.wc-actor-meta {
	font-size: 12px;
	color: #6c757d;
}
.wc-edit-link {
	white-space: nowrap;
	flex-shrink: 0;
	font-size: 12px;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	background-color: #f5f5f5;
}

#header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 20px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
	margin: 0;
	font-size: 24px;
}

.filter-group {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.filter-group label {
	font-size: 12px;
	color: #666;
	font-weight: 600;
	text-transform: uppercase;
}

select,
input {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	min-width: 150px;
}

select:focus,
input:focus {
	outline: none;
	border-color: #667eea;
}

button {
	padding: 8px 20px;
	background: #667eea;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.3s;
}

button:hover {
	background: #5568d3;
}

#container {
	display: flex;
	height: 70vh;
	position: relative;
}

#map {
	width: 100%;
	height: 100%;
	position: relative;
	z-index: 1;
}

#cy {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	pointer-events: none !important;
	display: none;
}

#cy canvas {
	pointer-events: none !important;
}

.cytoscape-container {
	pointer-events: none !important;
}

#settings {
	background: white;
	padding: 20px;
	margin-top: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#settings h3 {
	margin-bottom: 15px;
	color: #333;
	font-size: 18px;
	border-bottom: 2px solid #667eea;
	padding-bottom: 10px;
}

.settings-section {
	margin-bottom: 25px;
}

.settings-section h4 {
	font-size: 14px;
	color: #555;
	margin-bottom: 10px;
	font-weight: 600;
}

/* Visualization mode buttons */
.visualization-mode {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
}

.visualization-mode button {
	flex: 1;
	padding: 8px 12px;
	font-size: 13px;
	background: #f5f5f5;
	color: #666;
	border: 2px solid #ddd;
	transition: all 0.3s ease;
	font-weight: 500;
	box-shadow: none;
}

.visualization-mode button.active {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border-color: #667eea;
	font-weight: 600;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
	transform: translateY(-1px);
}

.visualization-mode button:hover:not(.active) {
	background: #e8e8e8;
	border-color: #bbb;
	color: #333;
}

.filter-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.filter-btn {
	padding: 6px 12px;
	font-size: 12px;
	background: #e0e0e0;
	color: #333;
	border: 1px solid #ccc;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s;
}

.filter-btn.active {
	background: #667eea;
	color: white;
	border-color: #667eea;
}

.filter-btn:hover:not(:disabled) {
	opacity: 0.8;
}

.filter-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	background: #f0f0f0;
	color: #999;
}

.filter-btn .count {
	font-size: 11px;
	opacity: 0.8;
}

/* Word cloud labels */
.word-label {
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	font-weight: 600;
	white-space: nowrap;
	text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8),
		-1px -1px 2px rgba(255, 255, 255, 0.8);
	cursor: pointer;
	pointer-events: auto;
}

.discourse-layers {
	display: block;
	padding: 10px;
	background: #f8f9fa;
	border-radius: 4px;
	margin-bottom: 15px;
}

.discourse-layers h4 {
	font-size: 13px;
	margin-bottom: 10px;
	color: #333;
}

.layer-group {
	margin-bottom: 10px;
	padding: 8px;
	background: white;
	border-radius: 4px;
}

.layer-group-title {
	font-size: 12px;
	font-weight: 600;
	color: #555;
	margin-bottom: 5px;
}

.layer-toggles {
	display: flex;
	gap: 5px;
}

.layer-toggle {
	flex: 1;
	padding: 5px 8px;
	font-size: 11px;
	background: #e0e0e0;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.2s;
}

.layer-toggle.active {
	background: #667eea;
	color: white;
}

.layer-toggle:hover {
	opacity: 0.8;
}

.legend {
	position: absolute;
	bottom: 20px;
	right: 20px;
	background: white;
	padding: 15px;
	border-radius: 4px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	z-index: 1000;
	display: block;
	max-width: 250px;
}

.legend h4 {
	margin: 0 0 10px 0;
	font-size: 14px;
	color: #333;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	font-size: 12px;
}

.legend-symbol {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	flex-shrink: 0;
}

.legend-symbol.category {
	border: 3px solid #333;
}

.legend-symbol.keyword {
	border: 3px dashed #333;
}

.leaflet-popup-content {
	margin: 10px;
	line-height: 1.6;
}

.leaflet-popup-content h4 {
	margin: 0 0 10px 0;
	color: #667eea;
}

.popup-section {
	margin-bottom: 8px;
	font-size: 13px;
}

.popup-label {
	font-weight: 600;
	color: #555;
}

.popup-partenaires {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px;
}

.popup-partenaire {
	display: inline-block;
	background: #f0f4ff;
	border: 1px solid #c7d4f0;
	border-radius: 3px;
	padding: 1px 5px;
	font-size: 12px;
	white-space: nowrap;
}

.popup-partenaire a {
	color: #2c5282;
	text-decoration: none;
}

.popup-partenaire a:hover {
	text-decoration: underline;
}

.loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: white;
	padding: 20px 40px;
	border-radius: 8px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	z-index: 9999;
	display: none;
}

.loading.active {
	display: block;
}

.loader {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #667eea;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin: 0 auto 10px;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}
