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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Noto Sans Myanmar';
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overscroll-behavior: none; /* Prevent pull-to-refresh issues on mobile */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px; /* Reduced padding for mobile */
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}


.logo {
    font-size: 24px; /* Slightly smaller for mobile */
    font-weight: bold;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 10px 16px; /* Adjusted for mobile */
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px; /* Smaller font for mobile */
    font-weight: 600;
    transition: all 0.3s ease;
    touch-action: manipulation; /* Improve touch responsiveness */
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-btn.active {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile by default */
    gap: 16px;
    min-height: calc(100vh - 120px);
}

.menu-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.order-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative; /* Remove sticky for mobile */
}

.section-title {
    font-size: 20px; /* Adjusted for mobile */
    margin-bottom: 16px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    overflow-x: auto; /* Allow horizontal scrolling for tabs */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.category-tabs::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.category-tab {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* Prevent text wrapping in tabs */
    font-size: 13px;
    color: #333;
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.category-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.category-tab:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.location-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    overflow-x: auto; /* Allow horizontal scrolling for buttons */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.location-buttons::-webkit-scrollbar {
    display: none;
}

.location-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.location-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.location-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.location-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.table-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    touch-action: manipulation;
}

.table-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.table-item.occupied {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-color: #ff6b6b;
}

.table-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.table-item:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.table-item .status {
    font-size: 11px;
    margin-top: 8px;
    opacity: 0.8;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-top: 12px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.menu-item {
    background: white;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.menu-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

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

.item-price {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
}

.item-description {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.order-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    background: white;
    margin-bottom: 4px;
    border-radius: 6px;
}

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

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

.quantity-controls .quantity {
    font-weight: bold;
    margin: 0 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
    touch-action: manipulation;
}

.qty-btn:hover {
    background: #5a6fd8;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ee5a52, #ff6b6b);
}

.total-section {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.total-final {
    font-size: 18px;
    font-weight: bold;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding-top: 8px;
    margin-top: 8px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 70px;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    width: 95%;
    max-width: 95%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
    margin: 10px;
}

.close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    cursor: pointer;
    color: #333;
    touch-action: manipulation;
}

.close:hover {
    color: #667eea;
}

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

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-3px);
}

.card-header {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.card-body {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.card-body p {
    margin: 4px 0;
}

.card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending {
    background-color: #fdf6b2;
    color: #856404;
}

.status-confirmed {
    background: #e2e3e5;
    color: #383d41;
}

.status-preparing {
    background: #d1ecf1;
    color: #0c5460;
}

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

.status-served {
    background: #cce5ff;
    color: #004085;
}

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

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.notification {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 12px 16px;
    background: #28a745;
    color: white;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transform: translateX(300px);
    transition: transform 0.3s ease;
}

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

.notification.error {
    background: #ff6b6b;
}

.voucher {
    max-width: 95%;
    margin: 16px auto;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.voucher h4 {
    text-align: center;
    margin-bottom: 12px;
    font-size: 18px;
    color: #333;
}

.voucher-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.voucher-table th,
.voucher-table td {
    border: 1px solid #e9ecef;
    padding: 6px;
    text-align: left;
    font-size: 13px;
}

.voucher-table th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    font-weight: 600;
}

#modify-order-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#modify-order-content .menu-items {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
}

#modify-order-content #modify-order-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
}

#modify-order-content .order-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

#modify-order-content .item-name {
    font-size: 14px;
}

#modify-order-content .item-price {
    font-size: 13px;
}

@media print {
    body * {
        visibility: hidden;
    }
    .voucher,
    .voucher * {
        visibility: visible;
    }
    .voucher {
        position: absolute;
        left: 0;
        top: 0;
        max-width: 100%;
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 10px;
    }
    .voucher-table th,
    .voucher-table td {
        border: 1px solid #000;
    }
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 260px 1fr;
    }
    .menu-items {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .order-panel {
        position: sticky;
        top: 16px;
    }
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: 280px 1fr;
    }
    .menu-items {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .card-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .menu-items {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .order-panel {
        position: relative;
        top: 0;
        order: -1;
    }
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    .nav-buttons {
        width: 100%;
        justify-content: center;
    }
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 16px;
        margin: 8px;
    }
    .btn {
        padding: 10px;
        font-size: 13px;
        min-width: 60px;
    }
    .btn-small {
        padding: 3px 6px;
        font-size: 10px;
    }
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-title {
        font-size: 18px;
    }
    .logo {
        font-size: 20px;
    }
    .nav-btn {
        font-size: 12px;
        padding: 8px 14px;
    }
    .category-tab,
    .location-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    .table-item .status {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    .menu-items {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    .modal-content {
        padding: 12px;
        margin: 6px;
    }
    .btn {
        padding: 8px;
        font-size: 12px;
        min-width: 50px;
    }
    .section-title {
        font-size: 16px;
    }
    .logo {
        font-size: 18px;
    }
    .nav-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
    .category-tab,
    .location-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    .table-item .status {
        font-size: 9px;
    }
    .btn-small {
        padding: 2px 5px;
        font-size: 9px;
    }
}

