/* ==========================================
   MicroFinance - Custom CSS
   Beyond Tailwind utilities
   ========================================== */

/* Custom scrollbar for sidebar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 20px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Slide-down animation for flash messages */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-down {
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Counter animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-count-up {
    animation: countUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card hover effect */
.card-hover {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.12);
}

/* Stat card shimmer effect */
.stat-shimmer {
    position: relative;
    overflow: hidden;
}

.stat-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.6s;
}

.stat-shimmer:hover::after {
    left: 100%;
}

/* Table row hover */
.table-row-hover {
    transition: background-color 0.15s ease;
}

.table-row-hover:hover {
    background-color: rgba(99, 102, 241, 0.04);
}

/* Login page background pattern */
.login-bg {
    background-color: #0f172a;
    background-image: 
        radial-gradient(at 20% 50%, rgba(99, 102, 241, 0.15) 0, transparent 50%),
        radial-gradient(at 80% 20%, rgba(139, 92, 246, 0.12) 0, transparent 50%),
        radial-gradient(at 50% 80%, rgba(59, 130, 246, 0.1) 0, transparent 50%);
}

/* Pulse dot animation */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Smooth dropdown */
.dropdown-enter {
    animation: dropdownEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    main {
        padding: 0 !important;
    }
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Form input focus glow */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Number input hide arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
