/* Custom Styles for Customer POS */

/* Mobile-first responsive design with large, touch-friendly elements */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;

    /* remove scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
}

body {
    font-family: 'Kanit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Disable context menu on images */
img {
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Smooth transitions for view changes */
.view {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced button hover effects */
button {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

button:active {
    transform: scale(0.98);
}

/* Input focus states optimized for mobile */
input:focus {
    outline: none;
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #FFF7ED;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #DC2626, #F97316);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #B91C1C, #EA580C);
}

/* Toast notification animation */
#toast {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* User menu dropdown animation */
#user-menu {
    animation: dropDown 0.2s ease-out;
}

@keyframes dropDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced gradient text */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

/* Card hover effects */
.hover\:shadow-2xl:hover {
    box-shadow: 0 25px 50px -12px rgba(220, 38, 38, 0.25);
}

/* Prevent text selection on buttons */
button, .no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading state (for future use) */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #F97316;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Touch-friendly spacing for mobile */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .text-6xl {
        font-size: 3rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    #app-header,
    #user-menu,
    button:not(.no-print) {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    button {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode override (keep light theme for daylight work) */
@media (prefers-color-scheme: dark) {
    /* Force light theme regardless of system preference */
    body {
        background: linear-gradient(to bottom right, #FFF7ED, #FFEDD5);
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid #F97316;
    outline-offset: 2px;
}

/* Better touch targets for mobile */
@media (pointer: coarse) {
    button,
    input,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    input {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0px, #e0e0e0 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    color: transparent !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    user-select: none;
    pointer-events: none;
}

/* Toast */
#toast-message:empty {
    display: none;
}