/* Santa & Me POS - Custom Styles */

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    touch-action: manipulation;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 21, 56, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(139, 21, 56, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 21, 56, 0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.2s ease-out forwards;
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out forwards;
}

.animate-slideUp {
    animation: slideUp 0.3s ease-out forwards;
}

.animate-float {
    animation: floatAnimation 3s ease-in-out infinite;
}

.animate-pulse-ring {
    animation: pulse-ring 1.5s ease-out infinite;
}

.animate-bounce {
    animation: bounce 0.5s ease-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-card {
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.quick-add {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-card:hover .quick-add {
    opacity: 1;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 3px;
}

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

/* Firefox */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}

/* ============================================
   LOADING STATES
   ============================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 21, 56, 0.2);
    border-top-color: #8B1538;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(128, 128, 128, 0.1) 25%,
        rgba(128, 128, 128, 0.2) 50%,
        rgba(128, 128, 128, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================
   BUTTONS
   ============================================ */
button {
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

button:disabled {
    cursor: not-allowed;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

/* ============================================
   INPUTS
   ============================================ */
input {
    border: none;
    outline: none;
}

input:focus {
    outline: none;
}

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

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

/* ============================================
   MODAL BACKDROP
   ============================================ */
.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ============================================
   OFFLINE BANNER
   ============================================ */
.offline-banner {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    animation: blink 2s ease-in-out infinite;
}

/* ============================================
   SALE COMPLETE ANIMATION
   ============================================ */
.sale-complete {
    animation: scaleIn 0.3s ease-out, bounce 0.5s ease-out 0.3s;
}

/* ============================================
   CART ITEM HIGHLIGHT
   ============================================ */
.cart-item-added {
    animation: pulse-ring 0.5s ease-out;
}

/* ============================================
   KEYBOARD SHORTCUTS
   ============================================ */
kbd {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, 'Courier New', monospace;
}

/* ============================================
   PWA FULLSCREEN ADJUSTMENTS
   ============================================ */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body * {
        visibility: hidden;
    }
    
    .receipt, .receipt * {
        visibility: visible;
    }
    
    .receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        font-size: 12px;
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover {
        transform: none;
    }
    
    .product-card:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
    
    .quick-add {
        display: none;
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .product-card {
        padding: 0.5rem;
    }
}

/* ============================================
   GLASS MORPHISM (Dark Mode)
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   GRADIENT BORDERS
   ============================================ */
.gradient-border {
    position: relative;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #8B1538, #c41e3a);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* ============================================
   STOCK BADGES
   ============================================ */
.stock-badge-low {
    animation: blink 1.5s ease-in-out infinite;
}

/* ============================================
   SYNC INDICATOR
   ============================================ */
.sync-active {
    animation: spin 1s linear infinite;
}

.sync-success {
    animation: bounce 0.5s ease-out;
}

/* ============================================
   HELD SALES INDICATOR
   ============================================ */
.held-indicator {
    animation: pulse-ring 2s ease-out infinite;
}

/* ============================================
   CATEGORY PILLS SCROLL
   ============================================ */
.category-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

.category-scroll > * {
    scroll-snap-align: start;
}

/* ============================================
   PAYMENT BUTTON EFFECTS
   ============================================ */
.payment-btn-cash {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.payment-btn-cash:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.payment-btn-credit {
    background: linear-gradient(135deg, #8B1538, #c41e3a);
    box-shadow: 0 4px 15px rgba(139, 21, 56, 0.3);
}

.payment-btn-credit:hover {
    box-shadow: 0 6px 20px rgba(139, 21, 56, 0.4);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    animation: slideIn 0.3s ease-out forwards;
}

.toast-exit {
    animation: slideIn 0.3s ease-out reverse forwards;
}

/* ============================================
   COMMAND PALETTE
   ============================================ */
.command-palette-item {
    transition: all 0.15s ease;
}

.command-palette-item:hover,
.command-palette-item.active {
    background: rgba(139, 21, 56, 0.1);
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #8B1538;
    outline-offset: 2px;
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
    background: rgba(139, 21, 56, 0.3);
    color: inherit;
}

::-moz-selection {
    background: rgba(139, 21, 56, 0.3);
    color: inherit;
}
