:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    min-height: 100vh;
    padding-top: 20px;
    padding-bottom: 40px;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.2rem;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    padding: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.form-label {
    font-weight: 500;
    color: #333;
}

.form-control, .form-select {
    border-radius: 8px;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

#photoPreview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 10px;
}

.alert {
    border-radius: 8px;
}

/* Style pour le backend */
.sidebar {
    min-height: calc(100vh - 56px);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: #cbd5e1;
    padding: 14px 20px;
    margin: 5px 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: #fff;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.sidebar .nav-link i {
    margin-right: 12px;
    width: 20px;
    font-size: 16px;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    padding: 15px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.badge {
    padding: 8px 16px;
    font-weight: 600;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge-en-cours {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-cloture {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge-envoye-eproxy {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.incident-photo {
    max-width: 100px;
    max-height: 100px;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.incident-photo:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-top: 10px;
    }
    
    .card {
        margin: 10px;
    }
    
    .sidebar {
        min-height: auto;
    }
}

/* Styles pour la carte (Leaflet) */
.leaflet-container {
    border: 2px solid #ddd;
}

/* Animation du bouton de soumission */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {transform: rotate(360deg);}
}

/* Animation du modal de succès */
.success-icon i {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Style pour les cartes statistiques */
.stat-card {
    border-left: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    transition: width 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
}

.stat-card:hover::before {
    width: 100%;
    opacity: 0.1;
}

.stat-card-primary::before {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.stat-card-success::before {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card-warning::before {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card-info::before {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Login page */
.login-container {
    max-width: 450px;
    margin: 100px auto;
}

.login-card {
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Slider Captcha */
.slider-captcha {
    margin: 20px 0;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 30px;
    overflow: hidden;
    border: 2px solid #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #64748b;
    user-select: none;
    pointer-events: none;
    font-size: 1rem;
}

.slider-thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 56px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 28px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: box-shadow 0.3s ease;
    z-index: 2;
}

.slider-thumb:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.slider-thumb:active {
    cursor: grabbing;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.slider-success {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    animation: slideSuccess 0.5s ease;
}

@keyframes slideSuccess {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.slider-track.completed .slider-text,
.slider-track.completed .slider-thumb {
    display: none;
}

.slider-track.completed .slider-success {
    display: flex;
}
