/* ===== MODERN DESIGN SYSTEM ===== */

:root {
    /* Couleurs principales - Charte graphique Locaux34 */
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #66b3ff;
    --secondary-color: #ff6b35;
    --secondary-dark: #e55a2b;
    --secondary-light: #ff8c66;
    
    /* Couleurs système */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #007bff;
    
    /* Couleurs de rôles */
    --admin-color: #dc3545;
    --editor-color: #ff6b35;
    --reader-color: #007bff;
    
    /* Couleurs neutres */
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Ombres */
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 35px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    
    /* Rayons de bordure */
    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --radius-xl: 25px;
    
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

/* ===== COMPOSANTS DE BASE ===== */

/* Cartes modernes */
.modern-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid #f0f0f0;
    transition: var(--transition-normal);
    overflow: hidden;
    position: relative;
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.modern-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.modern-card-header {
    background: var(--primary-color);
    color: white !important;
    padding: 1.5rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modern-card-header h1,
.modern-card-header h2,
.modern-card-header h3,
.modern-card-header h4,
.modern-card-header h5,
.modern-card-header h6 {
    color: white !important;
}

.modern-card-body {
    padding: 1.5rem;
}

/* Boutons modernes */
.btn-modern {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--transition-fast);
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-3px);
    text-decoration: none;
}

.btn-primary-modern {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary-modern:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
    color: white;
}

.btn-secondary-modern {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-secondary-modern:hover {
    background: var(--secondary-dark);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    color: white;
}

.btn-success-modern {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success-modern:hover {
    background: #218838;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-warning-modern {
    background: var(--warning-color);
    color: var(--dark-color);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning-modern:hover {
    background: #e0a800;
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
    color: var(--dark-color);
}

.btn-danger-modern {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger-modern:hover {
    background: #c82333;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    color: white;
}

.btn-info-modern {
    background: var(--info-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-info-modern:hover {
    background: #0056b3;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
    color: white;
}

.btn-dark-modern {
    background: var(--dark-color);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 58, 64, 0.3);
}

.btn-dark-modern:hover {
    background: #23272b;
    box-shadow: 0 8px 25px rgba(52, 58, 64, 0.4);
    color: white;
}

/* Formulaires modernes */
.form-modern .form-control {
    border: 2px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: var(--transition-normal);
    background: #f8f9fa;
}

.form-modern .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background: white;
}

.form-modern .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.form-modern .form-select {
    border: 2px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    transition: var(--transition-normal);
}

.form-modern .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background: white;
}

/* Alertes modernes */
.alert-modern {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.alert-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255,255,255,0.5);
}

.alert-success-modern {
    background: var(--success-color);
    color: white;
}

.alert-danger-modern {
    background: var(--danger-color);
    color: white;
}

.alert-warning-modern {
    background: var(--warning-color);
    color: var(--dark-color);
}

.alert-info-modern {
    background: var(--info-color);
    color: white;
}

/* Headers de section */
.section-header-modern {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.section-header-modern::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.section-header-modern h1,
.section-header-modern h2 {
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    color: white !important;
}

.section-header-modern p {
    margin-bottom: 0;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    color: white !important;
}

/* Badges modernes */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: 600;
    gap: 0.5rem;
}

.badge-admin-modern {
    background: var(--admin-color);
    color: white;
}

.badge-editor-modern {
    background: var(--editor-color);
    color: white;
}

.badge-reader-modern {
    background: var(--reader-color);
    color: white;
}

/* Grilles modernes */
.modern-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.modern-grid-2 {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.modern-grid-3 {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.modern-grid-4 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Statistiques */
.stat-card-modern {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon-modern {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
    background: var(--primary-color);
}

/* Avatars */
.avatar-modern {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    background: var(--primary-color);
    font-size: 1.2rem;
}

.avatar-modern.large {
    width: 80px;
    height: 80px;
    font-size: 1.8rem;
}

/* Tables modernes */
.table-modern {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-modern thead {
    background: var(--primary-color);
    color: white;
}

.table-modern th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table-modern td {
    border: none;
    padding: 1rem;
    border-bottom: 1px solid #f8f9fa;
}

.table-modern tbody tr:hover {
    background: #f8f9fa;
}

/* Navigation moderne */
.nav-modern {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem;
}

.nav-modern .nav-link {
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
    color: #6c757d;
    font-weight: 500;
}

.nav-modern .nav-link:hover,
.nav-modern .nav-link.active {
    background: var(--primary-color);
    color: white;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .modern-grid,
    .modern-grid-2,
    .modern-grid-3,
    .modern-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .section-header-modern {
        padding: 1.5rem;
        text-align: center;
    }
    
    .btn-modern {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
}

/* Cartes thématiques spécifiques - toutes en bleu pour cohérence */
.card-map::before,
.card-restitution::before {
    background: var(--primary-color) !important;
}

.card-map .modern-card-header,
.card-restitution .modern-card-header {
    background: var(--primary-color) !important;
}

/* États vides */
.empty-state-modern {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state-modern i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--gray-400);
}

.empty-state-modern h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Loader moderne */
.loader-modern {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* Tooltips modernes */
.tooltip-modern {
    position: relative;
    cursor: help;
}

.tooltip-modern::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 1000;
}

.tooltip-modern:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Icônes spécifiques */
.proprietaire-icon-inline {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 50%;
}