/* Importer une police moderne et lisible depuis Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Variables de Couleur et Style Racine --- */
:root {
    --primary-blue: #1e3a8a; /* Indigo 900 - Pour les titres, sidebar */
    --secondary-blue: #3b82f6; /* Blue 500 - Pour les boutons, liens */
    --accent-green: #10b981; /* Emerald 500 - Pour la croissance, succès */
    --bg-light: #f8fafc; /* Slate 50 - Pour les fonds de page */
    --card-bg: #ffffff;
    --text-primary: #1e293b; /* Slate 800 */
    --text-secondary: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
}

/* --- Styles Globaux et Typographie --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
}

/* Gradients subtils */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #3730a3 100%);
}
.gradient-card {
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
}

/* Ombres élégantes */
.shadow-elegant {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.shadow-hover {
    transition: box-shadow 0.3s ease-in-out;
}
.shadow-hover:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Animations fluides */
.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Personnalisation des Composants --- */

/* Sidebar */
.sidebar-custom {
    background: var(--primary-blue);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    transition: all 0.3s ease-in-out;
    background: transparent;
    border: none;
}
.sidebar-custom .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(4px);
}
.sidebar-custom .nav-link.active,
.sidebar-custom .nav-link[class*="bg-white"] {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
}

/* Boutons de la sidebar (Déconnexion, etc.) */
.sidebar-custom button,
.sidebar-custom .btn,
.sidebar-custom [class*="bg-white bg-opacity"] {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease-in-out;
}

.sidebar-custom button:hover,
.sidebar-custom .btn:hover,
.sidebar-custom [class*="bg-white bg-opacity"]:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Bouton circulaire (IA) */
.sidebar-custom [class*="rounded-full"] {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
}

.sidebar-custom [class*="rounded-full"]:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Cartes Statistiques */
.stat-card {
    @apply bg-white rounded-2xl shadow-elegant p-6 flex flex-col justify-between relative overflow-hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-blue), var(--accent-green));
}
.stat-card .stat-value {
    @apply text-3xl font-bold;
}
.stat-card .stat-label {
    @apply text-sm font-medium text-gray-500 uppercase tracking-wider;
}

/* Tableaux Modernes */
.modern-table {
    @apply bg-white rounded-2xl shadow-elegant overflow-hidden;
}
.modern-table thead {
    @apply bg-gray-50 border-b border-gray-200;
}
.modern-table thead th {
    @apply px-6 py-4 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider;
}
.modern-table tbody tr {
    @apply border-b border-gray-100 hover:bg-gray-50 transition-colors duration-150;
}
.modern-table tbody td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-700;
}

/* Boutons Premium */
.btn-primary {
    @apply bg-gradient-to-r from-blue-500 to-blue-600 text-white font-semibold py-2 px-4 rounded-lg shadow-md hover:from-blue-600 hover:to-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-all duration-300 transform hover:scale-105;
}
.btn-success {
    @apply bg-gradient-to-r from-emerald-500 to-emerald-600 text-white font-semibold py-2 px-4 rounded-lg shadow-md hover:from-emerald-600 hover:to-emerald-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-emerald-500 transition-all duration-300 transform hover:scale-105;
}

/* Formulaires */
.form-input {
    @apply w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200;
}

/* Animations personnalisées */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.animate-shimmer {
    animation: shimmer 2s infinite;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Styles pour Leaflet */
#location-map {
    z-index: 1;
}

.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
}

.leaflet-popup-content {
    margin: 12px 16px;
}

/* Animations pour les alertes modernes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.alert-fade-enter-active,
.alert-fade-leave-active {
    transition: opacity 0.2s ease;
}

.alert-fade-enter-from,
.alert-fade-leave-to {
    opacity: 0;
}