/**
 * Styles pour la carte de France interactive
 */

/* Variables */
:root {
    --background-alt: #ffffff;
    --background-glass: rgba(255, 255, 255, 0.8);
    --primary-light: #e6eaff;
    --primary: #6b7dff;
    --primary-dark: #4557e8;
    --text: #1a1f36;
    --text-light: #4f566b;
    --text-muted: #697386;
    --border: #e3e8ee;
    --border-focus: #6b7dff;
}

/* Container */
.france-map-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    background: #f5f7ff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Carte */
.france-map {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.france-map svg {
    width: 100%;
    height: auto;
    max-height: 600px;
    filter: drop-shadow(0 12px 24px rgba(107, 125, 255, 0.15));
}

/* Style de base pour éviter le flash noir */
path {
    fill: #e6eaff;
    stroke: white;
    stroke-width: 0.8px;
}

/* Départements - FRONT-END uniquement */
.france-map path {
    fill: rgb(230, 234, 255) !important; /* Bleu clair par défaut */
    stroke: white !important;
    stroke-width: 0.8px !important;
    stroke-opacity: 0.6 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    filter: url(#map-shadow) !important;
}

/* IMPORTANT: Effet de survol pour la carte front-end uniquement */
.france-map path:hover {
    fill: rgb(107, 125, 255) !important; /* Bleu plus foncé au survol */
    stroke-opacity: 1 !important;
}

.france-map path.selected,
.france-map path.active {
    fill: rgb(69, 87, 232) !important; /* Bleu encore plus foncé pour la sélection */
    stroke-opacity: 1 !important;
}

/* Style pour les numéros de département */
.france-map .department-number {
    fill: #1a1f36; /* Bleu foncé/noir */
    font-size: 8px;
    font-weight: 500;
    text-anchor: middle;
    /* Remplacement de dominant-baseline par vertical-align pour compatibilité */
    vertical-align: middle;
    pointer-events: none;
    text-shadow: none;
}

/* Ajustements spécifiques pour certains départements */
.departement-92 + .department-number {
    transform: translate(-5px, -5px);
}

.departement-75 + .department-number {
    transform: translate(-3px, -3px);
}

.departement-93 + .department-number {
    transform: translate(-4px, -4px);
}

.departement-94 + .department-number {
    transform: translate(-4px, -6px);
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(107, 125, 255, 0.08),
        0 4px 16px rgba(107, 125, 255, 0.05);
}

/* Select styles */
select {
    appearance: none;
    background-color: var(--background-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: all 0.2s ease;
}

select:hover {
    border-color: var(--primary);
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(107, 125, 255, 0.2);
}

/* Button styles */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.button-primary {
    background-color: var(--primary);
    color: white;
}

.button-primary:hover {
    background-color: var(--primary-dark);
}

.button-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 125, 255, 0.4);
}

/* Info Box */
.department-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 1rem;
    z-index: 10;
    min-width: 200px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.department-info.visible {
    opacity: 1;
    transform: translateY(0);
}

.department-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.5rem 0;
}

.department-info p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.875rem;
}

/* Legend */
.map-legend {
    margin-top: 1rem;
    padding: 1rem;
}

.map-legend h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.75rem 0;
}

.map-legend-items {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-legend-color {
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
}

.map-legend-color.default {
    background-color: rgb(230, 234, 255);
}

.map-legend-color.hover {
    background-color: rgb(107, 125, 255);
}

.map-legend-color.selected {
    background-color: rgb(69, 87, 232);
}

.map-legend-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .map-legend-items {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Base */
body {
    background-color: var(--background);
    color: var(--text);
}

/* Department labels */
.france-map text {
    font-family: 'Inter', sans-serif;
    font-size: 8px;
    fill: var(--text);
    pointer-events: none;
}

/* Styles des inputs */
input[type="text"] {
    background-color: var(--background-alt);
    border: none;
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    width: 100%;
}

input[type="text"]::placeholder {
    color: var(--text-light);
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 125, 255, 0.2);
}

/* Styles de la légende */
.legend {
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

.font-tech {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
