:root {
    --primary: #0d6efd;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --light: #f8f9fa;
    --dark: #212529;
}

body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 56px;
}

.category-nav {
    background-color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1020;
    top: 56px;
}

.nav-scroll {
    display: flex;
    overflow-x: auto;
    padding: 0 15px;
    gap: 10px;
}

.category-btn {
    white-space: nowrap;
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background-color: white;
    color: var(--dark);
    transition: all 0.3s;
    cursor: pointer;
}

.category-btn:hover, .category-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.menu-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    cursor: pointer;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.menu-card .card-body {
    padding: 15px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

.bill-card {
    border-left: 4px solid var(--primary);
    margin-bottom: 15px;
}

.bill-card.pending {
    border-left-color: var(--warning);
}

.bill-card.paid {
    border-left-color: var(--success);
}

/* Loading spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Alert positioning */
.alert.position-fixed {
    z-index: 9999;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-nav {
        top: 56px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }
    
    .btn {
        min-height: 44px;
    }
}

/* Print styles */
@media print {
    .navbar, .category-nav, .btn {
        display: none !important;
    }
    
    body {
        background: white;
        padding-top: 0;
    }
}

/* Additional mobile fixes */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .menu-card {
        margin-bottom: 15px;
    }
    
    .category-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
}

/* Ensure all buttons have proper cursor */
.btn, .category-btn {
    cursor: pointer;
}

/* Loading state for buttons */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Install Prompt Styles */
#installPromptModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#installPromptModal .modal-header {
    border-radius: 15px 15px 0 0;
}

#installPromptModal .modal-body {
    padding: 2rem;
}

#installPromptModal .modal-footer {
    border-radius: 0 0 15px 15px;
    border-top: 1px solid #dee2e6;
}

/* PWA Badge for already installed apps */
.pwa-badge {
    position: fixed;
    top: 70px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    z-index: 9999;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* Orientation-specific utility classes */
.landscape-mode .menu-card {
    transition: all 0.3s ease;
}

.landscape-mode .category-nav {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Better table layout for landscape bills */
.landscape-mode .bill-card .card-body {
    padding: 1rem;
}

.landscape-mode .bill-card .btn-group {
    flex-direction: row;
    gap: 5px;
}

/* Improved modal sizing for landscape */
.landscape-mode .modal-dialog {
    margin: 1rem auto;
}

/* Fix for virtual keyboard on mobile landscape */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .modal.show .modal-dialog {
        transform: none;
        margin: 10px auto;
    }
    
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}


/* Add Item Modal Styles */
#addItemModal .modal-xl {
    max-width: 95%;
}

#addItemModal .category-nav {
    position: relative;
    top: 0;
    background: transparent;
    border-bottom: 1px solid #dee2e6;
}

#addItemModal .menu-card {
    min-height: 120px;
}

#addItemModal .menu-card .card-body {
    padding: 12px;
}

#addItemModal .add-item-cart-item {
    padding: 8px 0;
}

#addItemModal .item-quantity {
    width: 70px;
}

#addItemCart {
    max-height: 300px;
    overflow-y: auto;
}

/* Print styles for added items */
@media print {
    body * {
        visibility: hidden;
    }
    
    .added-items-print, .added-items-print * {
        visibility: visible;
    }
    
    .added-items-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}