/**
 * Custom CSS - Asset Management System ONG
 * Design inspiré du projet COOPI avec Tailwind CSS
 */

:root {
    /* Palette ONG */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    
    --success: #10B981;
    --success-light: #D1FAE5;
    
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    
    --info: #06B6D4;
    --info-light: #CFFAFE;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Components */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
    transition: all 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-color: #CBD5E1;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    min-width: 320px;
    width: min(640px, calc(100vw - 2rem));
    border-left: 4px solid var(--primary);
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.95rem;
    color: #334155;
}

.toast i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
}

.toast-success {
    border-left-color: var(--success);
}

.toast-success i {
    color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-error i {
    color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-warning i {
    color: var(--warning);
}

.toast-primary {
    border-left-color: var(--primary);
}

.toast-primary i {
    color: var(--primary);
}

/* Sidebar Enhancements */
.nav-item-active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.01) 100%);
    border-left-color: var(--primary);
    color: var(--primary-dark);
}

.nav-item-hover:hover {
    background: linear-gradient(90deg, rgba(241, 245, 249, 0.8) 0%, rgba(241, 245, 249, 0.2) 100%);
    transform: translateX(4px);
}

/* KPI Cards Style */
.kpi-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
    border-left: 4px solid;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.kpi-card-icon {
    font-size: 2.5rem;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.kpi-card:hover .kpi-card-icon {
    transform: scale(1.1) rotate(5deg);
    opacity: 1;
}

.kpi-card-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.kpi-card:hover .kpi-card-value {
    transform: scale(1.05);
}

/* Signature Canvas */
.signature-canvas {
    display: block;
    width: 100%;
    max-width: 500px;
    height: 200px;
    border: 2px solid #CBD5E1;
    border-radius: 0.5rem;
    background: white;
    cursor: crosshair;
    touch-action: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.signature-canvas:hover {
    border-color: var(--primary);
    box-shadow: inset 0 2px 4px rgba(37, 99, 235, 0.1), 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.signature-container {
    border: 2px dashed #CBD5E1;
    border-radius: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
    transition: all 0.3s ease;
}

.signature-container:hover {
    border-color: var(--primary);
    border-style: solid;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

/* Table Styles */
.table {
    width: 100%;
    font-size: 0.9375rem;
}

.table thead th {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #475569;
    padding: 1rem;
    border-bottom: 3px solid var(--primary);
    vertical-align: middle;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #E2E8F0;
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, var(--primary-light) 0%, rgba(219, 234, 254, 0.3) 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Badge Styles */
.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    display: inline-block;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Form Styles */
.form-control,
.form-select {
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 0.5rem;
    min-height: 44px;
    width: 100%;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light), 0 4px 6px -1px rgba(37, 99, 235, 0.1);
    outline: none;
    transform: translateY(-1px);
}

/* Button Styles */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--gray-100);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

/* Progress Bar */
.progress {
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    transition: width 0.6s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .toast {
        min-width: auto;
        width: calc(100vw - 2rem);
    }
}
