/* Modern UI Enhancements */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Glassmorphism card accents */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}
.dark .glass-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(51, 65, 85, 0.7);
}

/* Animated hover transitions */
.hover-lift {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Badges */
.badge-pending {
    background-color: #fee2e2;
    color: #991b1b;
}
.badge-partial {
    background-color: #fef3c7;
    color: #92400e;
}
.badge-paid {
    background-color: #dcfce7;
    color: #166534;
}

/* Mobile & Touch Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a, select, input, textarea {
    touch-action: manipulation;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.safe-bottom {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* Canvas mobile touch scrolling without gesture stall */
canvas {
    touch-action: pan-y !important;
}

/* Eliminate tap delay and unwanted hover state stickiness on mobile */
@media screen and (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    .hover-lift:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Modal and Drawer backdrop body lock */
body.overflow-hidden {
    overflow: hidden !important;
    touch-action: none;
    overscroll-behavior: none;
}

/* Modal Animations: Mobile Slide-Up Bottom Sheet vs Desktop Scale-Up */
@media screen and (max-width: 640px) {
    .modal-container.flex > div {
        animation: modalSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        will-change: transform, opacity;
    }
    @keyframes modalSlideUp {
        from {
            transform: translateY(100%);
            opacity: 0.5;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

@media screen and (min-width: 641px) {
    .modal-container.flex > div {
        animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        will-change: transform, opacity;
    }
    @keyframes modalScaleUp {
        from {
            transform: scale(0.95);
            opacity: 0;
        }
        to {
            transform: scale(1);
            opacity: 1;
        }
    }
}

/* Prevent auto-zooming on iOS form controls */
@media screen and (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]), 
    select, 
    textarea {
        font-size: 16px !important;
    }
}

