/* Cashier System Styles */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --info: #4299e1;
    --dark: #2d3748;
    --light: #f7fafc;
    --gray: #a0aec0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
}

.cashier-app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* بطاقات الإحصائيات */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

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

.stat-card.pending { border-right-color: #ecc94b; }
.stat-card.accepted { border-right-color: #4299e1; }
.stat-card.preparing { border-right-color: #ed8936; }
.stat-card.ready { border-right-color: #9f7aea; }
.stat-card.ontheway { border-right-color: #48bb78; }
.stat-card.delivered { border-right-color: #38a169; }
.stat-card.cancelled { border-right-color: #f56565; }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.pending .stat-icon { color: #ecc94b; }
.stat-card.accepted .stat-icon { color: #4299e1; }
.stat-card.preparing .stat-icon { color: #ed8936; }
.stat-card.ready .stat-icon { color: #9f7aea; }
.stat-card.ontheway .stat-icon { color: #48bb78; }
.stat-card.delivered .stat-icon { color: #38a169; }
.stat-card.cancelled .stat-icon { color: #f56565; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    color: #718096;
    font-size: 0.85rem;
    font-weight: 500;
}

/* تبويبات الحالات */
.status-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.status-tab {
    padding: 10px 18px;
    border: none;
    background: white;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.status-tab.active {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.status-tab.pending-tab.active { background: #ecc94b; }
.status-tab.accepted-tab.active { background: #4299e1; }
.status-tab.preparing-tab.active { background: #ed8936; }
.status-tab.ready-tab.active { background: #9f7aea; }
.status-tab.ontheway-tab.active { background: #48bb78; }
.status-tab.delivered-tab.active { background: #38a169; }
.status-tab.cancelled-tab.active { background: #f56565; }

/* شبكة الطلبات */
.orders-container {
    min-height: 400px;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.order-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.order-card.pending { border-top-color: #ecc94b; }
.order-card.accepted { border-top-color: #4299e1; }
.order-card.preparing { border-top-color: #ed8936; }
.order-card.ready { border-top-color: #9f7aea; }
.order-card.on_the_way { border-top-color: #48bb78; }
.order-card.delivered { border-top-color: #38a169; }
.order-card.cancelled { border-top-color: #f56565; }

.order-header {
    padding: 12px 15px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf2f7;
}

.order-id {
    font-weight: 700;
    color: #2d3748;
}

.order-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.order-status.badge-pending { background: #fefcbf; color: #975a16; }
.order-status.badge-accepted { background: #bee3f8; color: #2c5282; }
.order-status.badge-preparing { background: #feebc8; color: #c05621; }
.order-status.badge-ready { background: #e9d8fd; color: #553c9a; }
.order-status.badge-ontheway { background: #c6f6d5; color: #22543d; }
.order-status.badge-delivered { background: #c6f6d5; color: #22543d; }
.order-status.badge-cancelled { background: #fed7d7; color: #9b2c2c; }

.order-body {
    padding: 15px;
}

.customer-info {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.customer-info div {
    margin-bottom: 5px;
    color: #4a5568;
}

.customer-info i {
    width: 20px;
    color: #718096;
    margin-left: 5px;
}

.order-items {
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px;
    margin: 12px 0;
    max-height: 120px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.9rem;
}

.order-item:last-child {
    border-bottom: none;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 2px solid #edf2f7;
    font-weight: 700;
}

.total-price {
    font-size: 1.2rem;
    color: var(--primary);
}

.order-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.action-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.action-btn.accept {
    background: #c6f6d5;
    color: #22543d;
}

.action-btn.accept:hover {
    background: #9ae6b4;
}

.action-btn.reject {
    background: #fed7d7;
    color: #9b2c2c;
}

.action-btn.reject:hover {
    background: #fbb6b6;
}

.action-btn.update {
    background: #bee3f8;
    color: #2c5282;
}

.action-btn.update:hover {
    background: #90cdf4;
}

.action-btn.view {
    background: #e2e8f0;
    color: #4a5568;
    flex: 0.5;
}

.action-btn.view:hover {
    background: #cbd5e0;
}

/* الإشعارات */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    animation: slideDown 0.3s ease;
    border-right: 4px solid;
}

.notification.success {
    border-right-color: #48bb78;
    color: #22543d;
}

.notification.error {
    border-right-color: #f56565;
    color: #9b2c2c;
}

.notification.info {
    border-right-color: #4299e1;
    color: #2c5282;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.notification.fade-out {
    opacity: 0;
    transform: translate(-50%, -20px);
    transition: all 0.3s;
}

/* مؤشر التحميل */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* تنسيقات المودال */
.order-details {
    padding: 15px;
}

.details-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
}

.details-section h6 {
    color: #2d3748;
    font-weight: 700;
    margin-bottom: 10px;
}

.details-section p {
    margin-bottom: 5px;
    color: #4a5568;
}

/* صفحة التقارير */
.report-header {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.report-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.report-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.report-stat-label {
    color: #718096;
    font-size: 0.9rem;
}

.report-table-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th {
    background: #f8fafc;
    padding: 12px;
    font-weight: 600;
    color: #2d3748;
}

.report-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
}

.report-table tbody tr:hover {
    background: #f8fafc;
}

/* تنسيقات الطباعة */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    .order-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* تحسينات الجوال */
@media (max-width: 768px) {
    .cashier-app {
        padding: 10px;
    }
    
    .orders-grid {
        grid-template-columns: 1fr;
    }
    
    .status-tabs {
        margin: 0 -10px 15px;
        padding: 0 10px 10px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .action-btn {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .order-actions {
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1 0 calc(50% - 4px);
    }
}