/* Custom Animations & Styles for RFID Management System */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 25px rgba(59, 130, 246, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Strict Role-Based Visibility Override */
.role-restricted {
    display: none !important;
}

/* Glassmorphism effects */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.dark .glass-panel {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(55, 65, 81, 0.7);
}

/* Print Receipt Styles */
@media print {
    body * {
        visibility: hidden !important;
    }
    #printableReceiptModal,
    #printableReceiptModal * {
        visibility: visible !important;
    }
    #printableReceiptModal {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: white !important;
        color: black !important;
        padding: 20px !important;
        z-index: 999999 !important;
        display: block !important;
    }
    .no-print {
        display: none !important;
    }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile Smooth Scrolling & Overflow Control */
html, body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Touch momentum & scroll containment */
.overflow-x-auto, .overflow-y-auto {
    -webkit-overflow-scrolling: touch;
}

.overflow-x-auto {
    overscroll-behavior-x: contain;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Touch friendly inputs on mobile - 16px prevents iOS Safari auto-zoom */
@media (max-width: 640px) {
    input[type="text"], input[type="password"], input[type="date"], input[type="email"], input[type="number"], select, textarea {
        font-size: 16px !important;
    }
}

/* iOS Safe Area Support for Notch & Home Bar */
.mobile-safe-bottom {
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px)) !important;
}

/* Table cells readability on touch devices */
@media (max-width: 768px) {
    table th, table td {
        white-space: nowrap;
    }
}


/* ======================================================== */
/* BEATING RADAR & DISPATCH SCANNER SYSTEM */
/* ======================================================== */

.radar-beacon-card {
    position: relative;
    overflow: visible;
}

.radar-scope-wrapper {
    position: relative;
}

/* Beating Concentric Pulse Waves (Sonar/Heartbeat) */
.radar-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 9999px;
    pointer-events: none;
    opacity: 0;
}

.ring-wave-1 {
    width: 100%;
    height: 100%;
    animation: radar-heartbeat-wave 2.4s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}

.ring-wave-2 {
    width: 100%;
    height: 100%;
    animation: radar-heartbeat-wave 2.4s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
    animation-delay: 0.8s;
}

.ring-wave-3 {
    width: 100%;
    height: 100%;
    animation: radar-heartbeat-wave 2.4s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
    animation-delay: 1.6s;
}

@keyframes radar-heartbeat-wave {
    0% {
        width: 30%;
        height: 30%;
        opacity: 0.95;
        border: 2px solid rgba(16, 185, 129, 0.95);
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.7);
    }
    40% {
        opacity: 0.6;
        border: 1.5px solid rgba(16, 185, 129, 0.7);
    }
    80% {
        opacity: 0.2;
    }
    100% {
        width: 170%;
        height: 170%;
        opacity: 0;
        border: 1px solid rgba(16, 185, 129, 0);
        box-shadow: none;
    }
}

/* Radar Scope Dish & Rotating Sweeper Beam */
.radar-dish {
    position: relative;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.15) 0%, rgba(6, 78, 59, 0.35) 100%);
    box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.3);
}

.radar-sweeper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    background: conic-gradient(from 0deg, rgba(16, 185, 129, 0.5) 0deg, rgba(16, 185, 129, 0) 75deg);
    animation: radar-sweep-spin 2.6s linear infinite;
    transform-origin: center center;
    pointer-events: none;
}

@keyframes radar-sweep-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Radar Crosshairs */
.radar-crosshair-h {
    position: absolute;
    top: 50%;
    left: 12%;
    right: 12%;
    height: 1px;
    background: rgba(16, 185, 129, 0.25);
    pointer-events: none;
}

.radar-crosshair-v {
    position: absolute;
    left: 50%;
    top: 12%;
    bottom: 12%;
    width: 1px;
    background: rgba(16, 185, 129, 0.25);
    pointer-events: none;
}

/* Range Rings Inside Big Radar Dish */
.radar-range-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 9999px;
    border: 1px dashed rgba(16, 185, 129, 0.35);
    pointer-events: none;
}

.radar-range-ring.inner {
    width: 44%;
    height: 44%;
}

.radar-range-ring.outer {
    width: 74%;
    height: 74%;
}

/* Rhythmic Heartbeat Core */
.radar-heart-core {
    animation: radar-heart-pulse 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes radar-heart-pulse {
    0%, 100% {
        transform: scale(0.85);
        box-shadow: 0 0 4px 1px rgba(16, 185, 129, 0.65);
    }
    25% {
        transform: scale(1.35);
        box-shadow: 0 0 12px 4px rgba(16, 185, 129, 0.95);
    }
    40% {
        transform: scale(1.05);
        box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.8);
    }
    55% {
        transform: scale(1.25);
        box-shadow: 0 0 10px 3px rgba(16, 185, 129, 0.85);
    }
}

/* Card Scanned Flash Shockwave */
.radar-scan-active {
    animation: radar-flash-shockwave 0.85s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes radar-flash-shockwave {
    0% {
        border-color: rgba(16, 185, 129, 1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8), inset 0 0 20px rgba(16, 185, 129, 0.35);
        transform: scale(1.015);
    }
    40% {
        border-color: rgba(16, 185, 129, 0.9);
        box-shadow: 0 0 28px 6px rgba(16, 185, 129, 0.4), inset 0 0 15px rgba(16, 185, 129, 0.2);
    }
    100% {
        box-shadow: none;
        transform: scale(1);
    }
}

/* Inactive Window Standby Mode (Amber pulse when window blurred) */
.radar-beacon-card.window-inactive {
    border-color: rgba(245, 158, 11, 0.45) !important;
    background-color: rgba(245, 158, 11, 0.08) !important;
}
.radar-beacon-card.window-inactive .radar-dish {
    border-color: rgba(245, 158, 11, 0.45) !important;
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.15) 0%, rgba(120, 53, 15, 0.35) 100%) !important;
    box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.3) !important;
}
.radar-beacon-card.window-inactive .radar-sweeper {
    background: conic-gradient(from 0deg, rgba(245, 158, 11, 0.45) 0deg, rgba(245, 158, 11, 0) 75deg) !important;
}
.radar-beacon-card.window-inactive .radar-heart-core {
    background-color: #f59e0b !important;
    box-shadow: 0 0 8px #f59e0b !important;
}
.radar-beacon-card.window-inactive .radar-pulse-ring {
    border-color: rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.4) !important;
}

