/* Base styles */
body {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef3 50%, #dfe7ed 100%);
    background-attachment: fixed;
    transition: background 0.3s ease;
}

/* Mode sombre */
.dark body {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
}

.dark {
    color-scheme: dark;
}

/* Glass effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s ease;
}

.dark .glass-effect {
    background: rgba(45, 55, 72, 0.85);
}

/* Card shadows */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.dark .card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.card-shadow-hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.dark .card-shadow-hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Gradient buttons */
.gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

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

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

/* Couleurs adaptées au mode sombre */
.dark .text-gray-900 {
    color: #f7fafc !important;
}

.dark .text-gray-800 {
    color: #e2e8f0 !important;
}

.dark .text-gray-700 {
    color: #cbd5e0 !important;
}

.dark .text-gray-600 {
    color: #a0aec0 !important;
}

.dark .text-gray-500 {
    color: #718096 !important;
}

.dark .bg-white {
    background-color: #2d3748 !important;
}

.dark .bg-gray-50 {
    background-color: #1a202c !important;
}

.dark .bg-gray-100 {
    background-color: #2d3748 !important;
}

.dark .bg-gray-200 {
    background-color: #4a5568 !important;
}

.dark .border-gray-200 {
    border-color: #4a5568 !important;
}

.dark .border-gray-300 {
    border-color: #718096 !important;
}

.dark input,
.dark textarea,
.dark select {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
    border-color: #3b82f6;
    background-color: #1a202c;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #718096;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-in;
}

.animate-slideUp {
    animation: slideUp 0.6s ease-out;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

.toast {
    margin-bottom: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease-out;
}

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

/* Mode sombre pour les cartes */
.dark .bg-blue-50 {
    background-color: #1e3a8a !important;
}

.dark .bg-green-50 {
    background-color: #064e3b !important;
}

.dark .bg-yellow-50 {
    background-color: #78350f !important;
}

.dark .bg-red-50 {
    background-color: #7f1d1d !important;
}

.dark .bg-purple-50 {
    background-color: #581c87 !important;
}

.dark .bg-indigo-50 {
    background-color: #312e81 !important;
}

/* Hover states en mode sombre */
.dark .hover\:bg-gray-50:hover {
    background-color: #2d3748 !important;
}

.dark .hover\:bg-gray-100:hover {
    background-color: #4a5568 !important;
}

.dark .hover\:bg-blue-50:hover {
    background-color: #1e40af !important;
}

/* Textes de couleur en mode sombre */
.dark .text-blue-600 {
    color: #60a5fa !important;
}

.dark .text-green-600 {
    color: #34d399 !important;
}

.dark .text-yellow-600 {
    color: #fbbf24 !important;
}

.dark .text-red-600 {
    color: #f87171 !important;
}

.dark .text-purple-600 {
    color: #a78bfa !important;
}

.dark .text-indigo-600 {
    color: #818cf8 !important;
}

/* Bordures de couleur en mode sombre */
.dark .border-blue-200 {
    border-color: #1e40af !important;
}

.dark .border-green-200 {
    border-color: #065f46 !important;
}

.dark .border-yellow-200 {
    border-color: #92400e !important;
}

.dark .border-red-200 {
    border-color: #991b1b !important;
}

.dark .border-purple-200 {
    border-color: #6b21a8 !important;
}

/* Ombres en mode sombre */
.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3) !important;
}

.dark .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3) !important;
}

/* Dividers */
.dark hr {
    border-color: #4a5568 !important;
}

/* Tables */
.dark table {
    color: #e2e8f0;
}

.dark th {
    background-color: #2d3748;
    border-color: #4a5568;
}

.dark td {
    border-color: #4a5568;
}

.dark tbody tr:hover {
    background-color: #374151;
}

/* === PAGE LOADER MODAL === */
#pageLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dark #pageLoader {
    background: rgba(26, 32, 44, 0.98);
}

#pageLoader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    transform: translateY(-20px);
}

.loader-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 40px auto 40px 40px;
}

.loader-spinner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid #e5e7eb;
    border-radius: 50%;
}

.dark .loader-spinner::before {
    border-color: #4a5568;
}

.loader-spinner::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

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

.loader-progress {
    width: 200px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin: 20px auto;
}

.dark .loader-progress {
    background: #4a5568;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; transform: translateX(0); }
    50% { width: 70%; transform: translateX(0); }
    100% { width: 100%; transform: translateX(0); }
}

.loader-text {
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
}

.dark .loader-text {
    color: #9ca3af;
}

.loader-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.loader-logo svg {
    width: 32px;
    height: 32px;
    display: block;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

