/**
 * POS Kasir Modern - Custom Stylesheet & Design System
 */

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Glassmorphism & Soft Cards */
.card-soft {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.card-soft:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

/* Scanner target box & laser line animation */
.scanner-container {
    position: relative;
    overflow: hidden;
    background-color: #0f172a;
    border-radius: 12px;
}

.scanner-laser {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ef4444, #f87171, #ef4444, transparent);
    box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.8);
    animation: scanMove 2s infinite ease-in-out;
    z-index: 10;
}

@keyframes scanMove {
    0% { top: 10%; opacity: 0.3; }
    50% { top: 90%; opacity: 1; }
    100% { top: 10%; opacity: 0.3; }
}

.scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}

.scanner-frame::before,
.scanner-frame::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #3b82f6;
    border-style: solid;
}
.scanner-frame::before {
    top: -2px;
    left: -2px;
    border-width: 4px 0 0 4px;
    border-top-left-radius: 12px;
}
.scanner-frame::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 4px 4px 0;
    border-bottom-right-radius: 12px;
}

/* Toast container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s ease;
}

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

.toast.toast-leave {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
}

.toast-success {
    background: #065f46;
    color: #ecfdf5;
    border: 1px solid #059669;
}
.toast-error {
    background: #991b1b;
    color: #fef2f2;
    border: 1px solid #dc2626;
}
.toast-info {
    background: #1e40af;
    color: #eff6ff;
    border: 1px solid #2563eb;
}
.toast-warning {
    background: #92400e;
    color: #fffbeb;
    border: 1px solid #d97706;
}

/* Pulse badge for critical stock */
.badge-critical {
    animation: pulseCritical 1.8s infinite;
}

@keyframes pulseCritical {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

/* Thermal Receipt Styling */
@media print {
    body * {
        visibility: hidden;
    }
    #printable-receipt, #printable-receipt * {
        visibility: visible;
    }
    #printable-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        font-family: 'Courier New', Courier, monospace !important;
        color: #000 !important;
        background: #fff !important;
    }
    .no-print {
        display: none !important;
    }
    @page {
        margin: 4mm;
        size: auto;
    }
}

/* Receipt paper look in modal */
.receipt-paper {
    background: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px dashed #cbd5e1;
}

/* Mobile bottom nav active indicator */
.nav-item-active {
    color: #4f46e5 !important;
    font-weight: 600;
}
.nav-item-active svg {
    stroke: #4f46e5 !important;
}

/* Product card interactive click feedback */
.product-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}
.product-card:active {
    transform: scale(0.97);
}

/* ======================================================== */
/* MOBILE RESPONSIVE OPTIMIZATIONS (100% MOBILE READY)      */
/* ======================================================== */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth Touch Scrolling */
.touch-scroll {
    -webkit-overflow-scrolling: touch;
}

/* iOS Safari: Prevent automatic zoom on input focus */
@media (max-width: 640px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Mobile Slide-Up Bottom Sheet Animation */
@keyframes slideUpDrawer {
    from {
        transform: translateY(100%);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-drawer {
    animation: slideUpDrawer 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Floating Cart Bar Glow */
.floating-cart-glow {
    box-shadow: 0 10px 25px -3px rgba(79, 70, 229, 0.35), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}
