/* Professional Tablet Order System CSS */
/* Optimized for touch interactions and tablet screens */

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

.tablet-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    touch-action: manipulation;
    position: fixed;
    top: 0;
    left: 0;
}

/* Header */
.tablet-header {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.tablet-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-actions .btn {
    min-width: 40px;
    height: 35px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.header-actions .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Main Container */
.tablet-container {
    height: calc(100vh - 55px);
    margin-top: 55px;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* Screen Management */
.order-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.order-screen.active {
    opacity: 1;
    visibility: visible;
}

/* ===== SCREEN 1: ORDER MODE SELECTION ===== */
.order-mode-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.order-mode-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 600px;
}

.btn-order-mode {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: 3px solid #0056b3;
    border-radius: 15px;
    padding: 30px 40px;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
    min-width: 250px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-order-mode:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 123, 255, 0.4);
    border-color: #004085;
}

.btn-order-mode.secondary {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border-color: #1e7e34;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.btn-order-mode.secondary:hover {
    box-shadow: 0 15px 30px rgba(40, 167, 69, 0.4);
    border-color: #155724;
}

.btn-order-mode.tertiary {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border-color: #e0a800;
    color: #212529;
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.3);
}

.btn-order-mode.tertiary:hover {
    box-shadow: 0 15px 30px rgba(255, 193, 7, 0.4);
    border-color: #d39e00;
}

.btn-order-mode i {
    font-size: 36px;
}

.secondary-buttons {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

/* ===== SCREEN 2: TABLE SELECTION ===== */
.table-selection-container {
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.table-title {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.table-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
}

.table-item {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 15px;
    padding: 20px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.table-item.occupied {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.table-item.reserved {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: #000;
}

.table-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.table-number {
    font-size: 24px;
    font-weight: 700;
}

.table-seats {
    font-size: 14px;
    opacity: 0.9;
}

.table-status {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.table-running-order-hint {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    margin-top: 5px;
}

/* ===== SCREEN 3: ITEM/CART SELECTION ===== */
.item-cart-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Top Navigation */
.top-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.order-info {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.user-info {
    font-size: 14px;
    color: #666;
}

/* Main Categories Section */
.main-categories-section {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.main-categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

.main-category-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.main-category-btn:hover,
.main-category-btn.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #0056b3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* Main Content Area */
.main-content-area {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 200px 600px;
    gap: 0;
    overflow: hidden;
    min-height: calc(100vh - 200px);
}

/* Items Section */
.items-section {
    background: white;
    overflow-y: auto;
    padding: 20px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.item-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 60px;
    justify-content: center;
    user-select: none;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.item-card:nth-child(even) {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border-color: #9c27b0;
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.2);
}

.item-card:nth-child(3n) {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.item-card:nth-child(4n) {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
    border-color: #ff9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #1976d2;
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

.item-card:nth-child(even):hover {
    border-color: #7b1fa2;
    background: linear-gradient(135deg, #e1bee7 0%, #ce93d8 100%);
}

.item-card:nth-child(3n):hover {
    border-color: #388e3c;
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

.item-card:nth-child(4n):hover {
    border-color: #f57c00;
    background: linear-gradient(135deg, #ffcc80 0%, #ffb74d 100%);
}

.item-card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #90caf9 0%, #64b5f6 100%);
}

.item-card:nth-child(even):active {
    background: linear-gradient(135deg, #ce93d8 0%, #ba68c8 100%);
}

.item-card:nth-child(3n):active {
    background: linear-gradient(135deg, #a5d6a7 0%, #81c784 100%);
}

.item-card:nth-child(4n):active {
    background: linear-gradient(135deg, #ffb74d 0%, #ffa726 100%);
}

/* Item image removed - no longer needed */

.item-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    text-align: center;
}

/* Item price removed - no longer displayed on item cards */

/* Add to cart button removed - entire card is now clickable */

/* Sub Categories Section */
.sub-categories-section {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    padding: 15px;
}

.sub-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-category-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sub-category-btn:hover,
.sub-category-btn.active {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-color: #495057;
    color: white;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Order List Section */
.order-list-section {
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.order-list-header h5 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.cart-count {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.order-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    min-height: 400px;
    max-height: calc(100vh - 350px);
}

.cart-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 12px;
    color: #007bff;
    font-weight: 600;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: 2px solid #20c997;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.template-btn:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    border-color: #17a2b8;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.template-btn:active {
    transform: scale(0.95);
}

.quantity-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: 2px solid #0056b3;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
}

.quantity-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    border-color: #004085;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.quantity-display {
    font-weight: 600;
    color: #333;
    min-width: 25px;
    text-align: center;
}

.order-summary {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.summary-row.total {
    font-size: 16px;
    font-weight: 700;
    color: #007bff;
    border-top: 1px solid #e9ecef;
    padding-top: 8px;
    margin-top: 8px;
}

.order-actions {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content-area {
        grid-template-columns: 1fr 180px 280px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 992px) {
    .main-content-area {
        grid-template-columns: 1fr 160px 250px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    .btn-order-mode {
        font-size: 20px;
        padding: 25px 30px;
    }
    
    .btn-order-mode i {
        font-size: 30px;
    }
}

@media (max-width: 768px) {
    .main-content-area {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 60px 300px;
    }
    
    .sub-categories-section {
        border-right: none;
        border-top: 1px solid #e9ecef;
    }
    
    .sub-categories {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sub-category-btn {
        white-space: nowrap;
        min-width: 120px;
    }
    
    .order-list-section {
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
    
    .table-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .table-item {
        min-height: 100px;
        padding: 15px;
    }
    
    .table-number {
        font-size: 20px;
    }
    
    .secondary-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-order-mode.secondary {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .tablet-title {
        font-size: 16px;
    }
    
    .header-actions .btn {
        min-width: 35px;
        height: 30px;
        font-size: 14px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .table-title {
        font-size: 24px;
    }
    
    .top-navigation {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .btn-order-mode {
        font-size: 18px;
        padding: 20px 25px;
        min-height: 100px;
    }
    
    .btn-order-mode i {
        font-size: 24px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn-order-mode,
    .table-item,
    .item-card,
    .add-to-cart-btn,
    .quantity-btn,
    .main-category-btn,
    .sub-category-btn {
        min-height: 44px;
    }
    
    .btn-order-mode {
        min-height: 100px;
    }
    
    .table-item {
        min-height: 100px;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

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

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

/* Prevent text selection for better touch experience */
.tablet-body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields */
input, textarea, select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Scrollbar styling */
.items-section::-webkit-scrollbar,
.sub-categories-section::-webkit-scrollbar,
.order-items::-webkit-scrollbar,
.table-grid::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.items-section::-webkit-scrollbar-track,
.sub-categories-section::-webkit-scrollbar-track,
.order-items::-webkit-scrollbar-track,
.table-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.items-section::-webkit-scrollbar-thumb,
.sub-categories-section::-webkit-scrollbar-thumb,
.order-items::-webkit-scrollbar-thumb,
.table-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.items-section::-webkit-scrollbar-thumb:hover,
.sub-categories-section::-webkit-scrollbar-thumb:hover,
.order-items::-webkit-scrollbar-thumb:hover,
.table-grid::-webkit-scrollbar-thumb:hover {
    background: #0d6efd;
}

/* iPad/Tablet specific styles */
@media (max-width: 1024px) and (min-width: 768px) {
    .main-content-area {
        grid-template-columns: 1fr 180px 400px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .order-items {
        min-height: 350px;
        max-height: calc(100vh - 400px);
    }
    
    .order-actions {
        padding: 20px;
        background: white;
        border-top: 2px solid #e9ecef;
    }
    
    .order-actions .btn {
        padding: 15px 20px;
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 10px;
    }
}

/* Ensure hold button is always visible on touch devices */
@media (hover: none) and (pointer: coarse) {
    .order-actions {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 20px;
        border-top: 2px solid #e9ecef;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    }
    
    .order-actions .btn {
        min-height: 50px;
        font-size: 16px;
        font-weight: 600;
    }
}

/* Table Orders Modal */
.table-orders-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Context Menu Styles */
.table-context-menu {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 123, 255, 0.2);
    z-index: 10001;
    min-width: 200px;
    max-width: 280px;
    overflow: hidden;
    animation: contextMenuFadeIn 0.2s ease-out;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.context-menu-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.context-menu-header h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.context-menu-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

.context-menu-actions {
    padding: 8px;
}

.context-menu-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    min-height: 56px; /* Touch-friendly height */
}

.context-menu-btn:last-child {
    margin-bottom: 0;
}

.context-menu-btn:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.context-menu-btn:active {
    background: #e9ecef;
    transform: translateX(2px);
}

.context-menu-btn i {
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
    color: #007bff;
}

.context-menu-btn span {
    flex: 1;
}

/* Context menu button variants */
.context-menu-btn.print-btn i {
    color: #28a745;
}

.context-menu-btn.running-order-btn i {
    color: #ff6b35;
}

.context-menu-btn.view-details-btn i {
    color: #6c757d;
}

.context-menu-btn.print-btn:hover {
    background: rgba(40, 167, 69, 0.1);
}

.context-menu-btn.running-order-btn:hover {
    background: rgba(255, 107, 53, 0.1);
}

.context-menu-btn.view-details-btn:hover {
    background: rgba(108, 117, 125, 0.1);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .table-context-menu {
        min-width: 180px;
        max-width: 250px;
    }
    
    .context-menu-btn {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 52px;
    }
    
    .context-menu-btn i {
        font-size: 16px;
        margin-right: 10px;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10001;
}

.modal-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
}

.order-item.running-order-item {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.order-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.running-order-badge {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.order-id {
    font-weight: 600;
    color: #007bff;
    font-size: 16px;
}

.order-time {
    color: #6c757d;
    font-size: 14px;
}

.order-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.order-status.held {
    background: #fff3cd;
    color: #856404;
}

.order-status.active {
    background: #d4edda;
    color: #155724;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.item-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.item-quantity {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 10px;
}

.item-price {
    font-weight: 600;
    color: #28a745;
    min-width: 60px;
    text-align: right;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-modifiers {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
}

.item-remarks {
    font-size: 11px;
    color: #ffc107;
    font-style: italic;
    font-weight: 500;
}

.order-total {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px solid #dee2e6;
    text-align: right;
    font-size: 16px;
    color: #007bff;
}

.payment-totals {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.payment-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.payment-label {
    font-weight: 600;
    color: #495057;
}

.payment-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 16px;
}

.order-total-amount {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    text-align: right;
    font-size: 16px;
    color: #007bff;
}

.no-orders {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
}

/* Running Order Styling - now handled in context menu */

.running-order-indicator {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3); }
    50% { box-shadow: 0 4px 16px rgba(255, 107, 53, 0.5); }
    100% { box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3); }
}

/* Modal actions removed - now handled by context menu */

.modal-actions .btn {
    min-width: 200px;
    font-size: 16px;
    font-weight: 600;
}

/* Print Button Styling */
.print-order-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    border: 2px solid #0056b3 !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3) !important;
    font-size: 14px !important;
}

.print-order-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
    border-color: #004085 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4) !important;
}

.order-actions {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

/* Responsive modal for tablets */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 70vh;
    }
    
    .order-header {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .item-row {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .item-quantity {
        margin: 0;
    }
    
    .item-price {
        text-align: left;
    }

    .modal-actions {
        padding: 15px;
    }

    .modal-actions .btn {
        min-width: 100%;
        font-size: 14px;
    }
}

/* Table Transfer Modal Styles */
.table-transfer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-transfer-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.table-transfer-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.table-transfer-modal .modal-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-transfer-modal .modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.table-transfer-modal .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.table-transfer-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.table-transfer-modal .modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Transfer Flow Visualization */
.transfer-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.transfer-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.transfer-step {
    text-align: center;
    flex: 1;
    max-width: 150px;
}

.step-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.step-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.step-table {
    font-size: 1.1rem;
    font-weight: 600;
    color: #007bff;
    min-height: 24px;
}

.transfer-arrow {
    color: #007bff;
    font-size: 24px;
    animation: arrowPulse 2s infinite;
}

@keyframes arrowPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Transfer Sections */
.transfer-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.section-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h6 {
    margin: 0;
    color: #495057;
    font-weight: 600;
}

.section-header .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
}

/* Source Table Info */
.source-table-info {
    padding: 20px;
}

.table-info {
    line-height: 1.6;
    color: #495057;
}

.table-info strong {
    color: #212529;
}

/* Target Tables Grid */
.target-tables-container {
    padding: 20px;
    min-height: 200px;
}

.loading-spinner {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.loading-spinner i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.error-message, .no-tables {
    text-align: center;
    color: #dc3545;
    padding: 40px 20px;
    font-weight: 500;
}

.no-tables {
    color: #6c757d;
}

.target-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.target-table-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.target-table-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.target-table-card.selected {
    border-color: #28a745;
    background: #f8fff9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.table-card-header {
    margin-bottom: 10px;
}

.table-card-header i {
    font-size: 24px;
    color: #007bff;
    margin-bottom: 5px;
    display: block;
}

.table-name {
    font-weight: 600;
    color: #212529;
    font-size: 1.1rem;
}

.table-card-body {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #6c757d;
}

.table-seats {
    font-weight: 500;
    margin-bottom: 3px;
}

.table-floor {
    font-size: 0.8rem;
}

.select-table-btn {
    width: 100%;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.select-table-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.target-table-card.selected .select-table-btn {
    background: #28a745;
}

.target-table-card.selected .select-table-btn:hover {
    background: #218838;
}

/* Transfer Status */
.transfer-status {
    flex: 1;
    margin-right: 15px;
}

.status-ready {
    color: #28a745;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-waiting {
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal Footer */
.table-transfer-modal .modal-footer {
    background: #f8f9fa;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions .btn {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-actions .btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.modal-actions .btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

.modal-actions .btn-primary {
    background: #007bff;
    border-color: #007bff;
}

.modal-actions .btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.modal-actions .btn-primary:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .table-transfer-modal .modal-content {
        width: 95%;
        max-height: 95%;
    }
    
    .table-transfer-modal .modal-body {
        padding: 15px;
        max-height: 70vh;
    }
    
    .transfer-flow {
        flex-direction: column;
        gap: 15px;
    }
    
    .transfer-arrow {
        transform: rotate(90deg);
    }
    
    .target-tables-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .table-transfer-modal .modal-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .transfer-status {
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .modal-actions {
        justify-content: center;
    }
}

/* Context Menu Transfer Button */
.context-menu-btn.transfer-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border-color: #17a2b8;
}

.context-menu-btn.transfer-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    border-color: #117a8b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* ===== TEMPLATE MODAL STYLING ===== */
.template-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.template-card:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.template-icon-large {
    font-size: 32px;
    margin-bottom: 10px;
}

.template-name {
    font-weight: 600;
    font-size: 14px;
}

/* Template Options Modal */
.template-options {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.template-option {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    cursor: pointer;
}

.template-option:hover {
    background-color: #e3f2fd;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.template-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.template-option input[type="radio"]:checked + label {
    font-weight: bold;
    color: #007bff;
}

.template-option input[type="radio"]:checked {
    accent-color: #007bff;
}

.template-option label {
    cursor: pointer;
    font-size: 14px;
    margin: 0;
    display: flex;
    align-items: center;
    width: 100%;
}
