/* Bakmie Merkah POS System - Main Stylesheet */
/* Version: 2.1.0 */

:root {
    --primary-red: #ef4444;
    --primary-amber: #f59e0b;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --green-500: #10b981;
    --blue-500: #3b82f6;
    --purple-500: #8b5cf6;
    --yellow-500: #eab308;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--slate-900);
    color: white;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--slate-800);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-600);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500);
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    #receipt-container,
    #receipt-container * {
        visibility: visible;
    }
    
    #receipt-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    @page {
        size: 80mm auto;
        margin: 0;
    }
}

/* Loading Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Component Styles */
.loading-spinner {
    border: 3px solid var(--slate-600);
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-red);
}

.product-card.promo {
    border-color: var(--primary-amber);
    animation: pulse 2s infinite;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    transform: translateX(400px);
    transition: transform 0.3s ease-in-out;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3);
}

.notification.show {
    transform: translateX(0);
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    background: linear-gradient(135deg, var(--green-500), #059669);
}

.notification.error {
    background: linear-gradient(135deg, var(--primary-red), #dc2626);
}

.notification.info {
    background: linear-gradient(135deg, var(--blue-500), #2563eb);
}

/* Modal Styles */
.modal-content {
    max-width: 90%;
    margin: auto;
    animation: fadeIn 0.3s ease-out;
}

.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Blur Effect */
#main-app-container.disabled {
    filter: blur(4px);
    pointer-events: none;
    transition: filter 0.3s ease;
}

/* Touch Target Optimization for Tablets */
.quantity-change,
.remove-item,
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* Responsive Typography */
@media (min-width: 768px) {
    .text-responsive-sm { font-size: 0.95rem; }
    .text-responsive-base { font-size: 1.05rem; }
    .text-responsive-lg { font-size: 1.2rem; }
    .text-responsive-xl { font-size: 1.4rem; }
    .text-responsive-2xl { font-size: 1.8rem; }
    .text-responsive-3xl { font-size: 2.2rem; }
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), #dc2626);
    border: none;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-primary:disabled {
    background: var(--slate-600);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--slate-700);
    border: 1px solid var(--slate-600);
    color: white;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--slate-600);
    border-color: var(--slate-500);
}

/* Form Styles */
.form-input {
    background: var(--slate-700);
    border: 2px solid var(--slate-600);
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input::placeholder {
    color: var(--slate-400);
}

/* Card Styles */
.card {
    background: var(--slate-800);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

/* Cart Item Styles */
.cart-item {
    background: var(--slate-700);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.cart-item:hover {
    background: var(--slate-600);
    border-left-color: var(--primary-red);
}

.cart-item.promo {
    border-left-color: var(--primary-amber);
}

/* Status Indicators */
.status-online {
    background: var(--green-500);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

.status-offline {
    background: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Chart Container */
.chart-container {
    position: relative;
    background: var(--slate-800);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .product-card {
        padding: 12px;
    }
    
    .cart-item {
        padding: 12px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* Print Media Queries */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
.focus-ring:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Gradient Backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary-red), #dc2626);
}

.gradient-secondary {
    background: linear-gradient(135deg, var(--slate-800), var(--slate-700));
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-slide-in {
    animation: slideInRight 0.3s ease-out;
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.box-shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.box-shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.box-shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid white;
    }
    
    .btn-primary {
        border: 2px solid white;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Overrides (for future use) */
@media (prefers-color-scheme: light) {
    /* Light mode styles can be added here if needed */
}

