/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fadeIn { animation: fadeIn 0.4s ease-out; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease-out; }
.animate-slideInLeft { animation: slideInLeft 0.4s ease-out; }
.animate-slideInRight { animation: slideInRight 0.4s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-scaleIn { animation: scaleIn 0.3s ease-out; }
.animate-pulse-soft { animation: pulse-soft 2s ease-in-out infinite; }

/* Staggered animation delays */
.stagger-1 { animation-delay: 0.05s; animation-fill-mode: both; }
.stagger-2 { animation-delay: 0.1s; animation-fill-mode: both; }
.stagger-3 { animation-delay: 0.15s; animation-fill-mode: both; }
.stagger-4 { animation-delay: 0.2s; animation-fill-mode: both; }
.stagger-5 { animation-delay: 0.25s; animation-fill-mode: both; }
.stagger-6 { animation-delay: 0.3s; animation-fill-mode: both; }

/* Sidebar navigation */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #cbd5e1;
    transition: all 0.2s ease;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(4px);
}
.nav-link.active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    box-shadow: inset 3px 0 0 #22c55e;
}

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    transition: all 0.25s ease;
}
.card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.06), 0 4px 10px rgba(0,0,0,0.04);
    transform: translateY(-2px);
}
.card-static {
    background: white;
    border-radius: 1rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Stat cards */
.stat-card {
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.1;
    transform: translate(20px, -20px);
}
.stat-card.blue::before { background: #3b82f6; }
.stat-card.green::before { background: #22c55e; }
.stat-card.purple::before { background: #8b5cf6; }
.stat-card.orange::before { background: #f59e0b; }

/* Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table thead th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}
.data-table tbody tr {
    transition: background 0.15s ease;
}
.data-table tbody tr:hover {
    background: #f8fafc;
}
.data-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-archived { background: #e2e8f0; color: #475569; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; box-shadow: 0 4px 12px rgba(22,163,74,0.3); }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 4px 12px rgba(220,38,38,0.3); }
.btn-outline { background: transparent; border: 1.5px solid #e2e8f0; color: #475569; }
.btn-outline:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; border-radius: 0.5rem; }

/* Form inputs */
.form-input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #fff;
}
.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

/* Map styles */
.leaflet-container {
    border-radius: 1rem;
    z-index: 1;
}
.resource-highlighted {
    stroke-width: 3 !important;
    stroke-opacity: 1 !important;
    fill-opacity: 0.35 !important;
}
.resource-dimmed {
    stroke-opacity: 0.2 !important;
    fill-opacity: 0.05 !important;
}

/* Login page background */
.auth-bg {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 25%, #2563eb 50%, #15803d 100%);
    position: relative;
    overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Scrollbar */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

/* Toast / Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInUp 0.3s ease-out;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 32rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.25s ease;
}

/* Tooltip for map */
.household-tooltip {
    background: white !important;
    border: none !important;
    border-radius: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}
