/* Reset và base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.btn-add {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Order list */
.order-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 20px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.list-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

/* Filter buttons */
.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.filter-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Filter count badge */
.filter-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.filter-btn.active .filter-count {
    background: #ffffff;
    color: #3b82f6;
}



/* Stats bottom */
.stats-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 4px;
}

.order-item {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}

.order-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.order-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #e2e8f0;
}

.order-item:hover::before {
    opacity: 1;
}

.order-item.selected {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.order-item.selected::before {
    opacity: 1;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.order-item.swiping {
    background: #f8fafc !important;
    border-color: #3b82f6 !important;
    transform: scale(0.98) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
    transition: all 0.1s ease !important;
}

.order-item.swipe-left {
    transform: translateX(-20px) scale(0.98) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3) !important;
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    border-color: #f59e0b !important;
    transition: all 0.1s ease !important;
}

.order-item.swipe-right {
    transform: translateX(20px) scale(0.98) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3) !important;
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    border-color: #f59e0b !important;
    transition: all 0.1s ease !important;
}

/* Swipe Action Text */
.swipe-action-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.swipe-action-text.action-delete {
    background: rgba(220, 38, 38, 0.9);
    border-color: rgba(220, 38, 38, 0.3);
}

.swipe-action-text.action-cooked {
    background: rgba(37, 99, 235, 0.9);
    border-color: rgba(37, 99, 235, 0.3);
}

.swipe-action-text.action-pending {
    background: rgba(217, 119, 6, 0.9);
    border-color: rgba(217, 119, 6, 0.3);
}

.swipe-action-text.action-paid {
    background: rgba(22, 163, 74, 0.9);
    border-color: rgba(22, 163, 74, 0.3);
}

/* Reset animation khi hủy thao tác */
.order-item.swipe-reset {
    transform: translateX(0) scale(1) !important;
    background: white !important;
    border-color: #f1f5f9 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Animation xóa món */
.order-item.item-deleting {
    transform: translateX(-100%) scale(0.8) !important;
    opacity: 0 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: none !important;
}

/* Animation update món */
.order-item.item-updating {
    transform: translateY(-20px) scale(0.95) !important;
    opacity: 0.7 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: none !important;
}

/* Animation cho các item khác dồn lên */
.order-item.item-deleting + .order-item,
.order-item.item-updating + .order-item {
    transform: translateY(-20px) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}



.order-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.order-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.customer-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.dish-info {
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
    font-weight: 500;
}

.order-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.order-price {
    font-size: 16px;
    font-weight: 700;
    color: #059669;
    text-align: right;
    white-space: nowrap;
    background: #f0fdf4;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
}

.order-time {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    white-space: nowrap;
    font-weight: 500;
}







/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Form */
form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Dish options */
.dish-options {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.dish-option {
    padding: 8px 16px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
}

.dish-option:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.dish-option.selected {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.dish-option.none-option {
    background: #f3f4f6;
    color: #6b7280;
}

.dish-option.none-option:hover {
    background: #e5e7eb;
    color: #374151;
}

.dish-option.none-option.selected {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}

/* Quantity control */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.quantity-btn:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.quantity-control input[type="number"] {
    width: 60px;
    height: 36px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
}

.quantity-control input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}



/* Modal actions */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 12px 24px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-primary {
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #2563eb;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 3000;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}



/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        margin-bottom: 16px;
        padding: 8px 0;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .stats-bottom {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .list-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    

    
    .modal-actions {
        flex-direction: column;
    }
    
    .order-item {
        padding: 16px;
        border-radius: 12px;
    }
    
    .order-content {
        gap: 12px;
    }
    
    .customer-name {
        font-size: 15px;
    }
    
    .dish-info {
        font-size: 13px;
    }
    
    .order-price {
        font-size: 15px;
        padding: 3px 6px;
    }
    
    .order-time {
        font-size: 11px;
    }
    

}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .stats-bottom {
        gap: 12px;
    }
    
    .stat-item {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
    }
    
    .order-item {
        padding: 12px;
        border-radius: 10px;
    }
    
    .order-content {
        gap: 8px;
    }
    
    .customer-name {
        font-size: 14px;
    }
    
    .dish-info {
        font-size: 12px;
    }
    
    .order-price {
        font-size: 13px;
        padding: 2px 5px;
    }
    
    .order-time {
        font-size: 10px;
    }
    
    .swipe-action-text {
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 16px;
    }
    

}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
} 