/* Custom styles for POS System */

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.2s ease;
}

/* Dark mode support */
.dark {
    color-scheme: dark;
}

/* Custom scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dark .custom-scrollbar::-webkit-scrollbar-track {
    background: #374151;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Product card hover effects */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Cart item animations */
.cart-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Modal animations */
.modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Table row hover effects */
.table-row:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
}

/* Search input focus effects */
.search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Success/Error message animations */
.message {
    animation: messageSlideIn 0.5s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .cart-container {
        margin-top: 1rem;
    }
}

/* Print styles for receipts */
@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }
}

/* Custom focus styles for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-100 {
        background-color: #ffffff !important;
    }

    .text-gray-600 {
        color: #000000 !important;
    }

    .border-gray-300 {
        border-color: #000000 !important;
    }
}

/* Enhanced navigation button styling */
.nav-btn {
    @apply text-gray-700 dark:text-white hover:text-blue-600 dark:hover:text-blue-400;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.nav-btn.active {
    @apply bg-gradient-to-r from-blue-500 to-purple-600 text-white shadow-lg;
    transform: scale(1.05);
    border-color: transparent;
    box-shadow: 0 10px 30px  #48AB65;
}

.nav-btn.active:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

/* Enhanced navigation bar background */
nav {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

/* Enhanced table styling */
.table-row {
    transition: all 0.3s ease;
}

.table-row:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .table-row:hover {
    background-color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Enhanced form styling */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    transform: scale(1.02);
}

/* Enhanced button animations */
.btn-enhanced {
    position: relative;
    overflow: hidden;
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-enhanced:hover::before {
    width: 300px;
    height: 300px;
}

/* Loading animations */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

/* Enhanced card hover effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .card-hover:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Success/Error message animations */
.message {
    animation: messageSlideIn 0.5s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced modal animations */
.modal-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .product-card {
        padding: 1rem;
    }

    .product-image {
        width: 3rem;
        height: 3rem;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        @apply px-3 py-2 text-xs;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    pointer-events: auto;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    transform: translateX(0);
}

.toast.slide-out {
    transform: translateX(400px);
}

.toast.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.toast.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fef2f2 100%);
}

.toast.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.toast.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.dark .toast {
    background: #1f2937;
    color: white;
}

.dark .toast.success {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

.dark .toast.error {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

.dark .toast.warning {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
}

.dark .toast.info {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: #374151;
}

.toast-message {
    font-size: 14px;
    color: #6b7280;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.dark .toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
}

/* Toast animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.slide-in {
    animation: slideInRight 0.3s ease forwards;
}

.toast.slide-out {
    animation: slideOutRight 0.3s ease forwards;
}

/* Product Image Styles */
.product-image {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.product-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dark .product-image:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Image Upload Styles */
.image-upload-area {
    transition: all 0.3s ease;
}

.image-upload-area:hover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

.dark .image-upload-area:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.image-preview-container {
    animation: fadeIn 0.3s ease-in;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced search results styling */
#products-grid:empty::after {
    content: 'No products found';
    display: block;
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 1.1rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .product-card {
        padding: 1rem;
    }

    .product-image {
        width: 3rem;
        height: 3rem;
    }
}



/* Enhanced table styling */
.overflow-x-auto table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}



/* Enhanced button hover effects */
button:not(.nav-btn):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* User Menu Styles */
#user-menu {
    z-index: 9999 !important;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    position: absolute;
}

#user-menu a {
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 2px;
}

#user-menu a:hover {
    background-color: #f3f4f6;
    transform: translateX(4px);
}

/* Product grid improvements for larger images */
#products-grid {
    grid-template-columns:  1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    #products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}