/* style.css */

/* Base reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f0f0f0;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header styling */
.header {
  background-color: #e0e0e0;
  padding: 5px 10px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
}
.header-item {
  display: flex;
  align-items: center;
}

.business-date,
.current-date {
  margin-right: 20px;
}

/* Main content area: left "order-panel" + right "menu-panel" */
.main-content {
  display: flex;
  flex: 1;
}

/* Order panel on the left */
.order-panel {
  width: 30%;                /* narrower left side */
  background-color: #c8d6e5;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #aaa;
}

.order-header {
  display: flex;
  padding: 10px;
  background-color: #c8d6e5;
  border-bottom: 1px solid #aaa;
}

.order-header-item {
  display: flex;
  align-items: center;
  margin-right: 20px;
}
.order-header-item label {
  margin-right: 5px;
}
.order-header-item input {
  width: 60px;
  padding: 3px;
  border: 1px solid #999;
}

.order-type {
  text-transform: uppercase;
  font-weight: bold;
  padding: 2px 5px;
  background-color: #ddd;
}

/* The list of ordered items */
.order-items {
  flex: 1;                /* fill leftover vertical space */
  overflow-y: auto;
}

.order-table {
  width: 100%;
  border-collapse: collapse;
}
.order-table th {
  background-color: #a9b7c6;
  padding: 6px;
  text-align: left;
  border-bottom: 1px solid #888;
}
.order-table td {
  padding: 6px;
  border-bottom: 1px solid #ddd;
}

/* The bottom row with total amount */
.order-total {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background-color: #c8d6e5;
  border-top: 1px solid #aaa;
}
.order-total-label {
  font-weight: bold;
  margin-right: 10px;
}
.order-total-value {
  width: 80px;
  text-align: right;
  padding: 3px;
  border: 1px solid #999;
}

/* The panel that shows total quantity */
.quantity-panel {
  padding: 10px;
  background-color: #e0eeff;
}
.quantity-label {
  margin-right: 10px;
}
.quantity-input {
  width: 80px;
  text-align: right;
  padding: 3px;
  border: 1px solid #999;
  background-color: #d9edff;
}

/* Menu panel on the right (70% width),
   stacked in a column: 
   - top: .menu-items
   - middle: .menu-categories
   - bottom: .function-keys
*/
.menu-panel {
  display: flex;
  flex-direction: column;
  flex: 1;  /* fill all remaining horizontal space */
}

/* Top: item buttons (scrollable area) */
.menu-items {
  flex: 1;                /* Grow to fill space vertically */
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: flex-start; /* avoid vertical stretching */
  gap: 3px;               /* spacing between buttons */
  background-color: #aaa;
  padding: 6px;
  font-size: larger;
}

/* Each item button has a fixed size so they're large and uniform */
.menu-item {
  flex: 0 0 150px;        /* 150px width */
  height: 120px;          /* 120px tall */
  background-color: #f0f0f0;
  margin: 0;              /* gap: 8px handles spacing */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  padding: 4px;
}
.menu-item:hover {
  opacity: 0.9;
}

/* Middle: category row (fixed height) */
.menu-categories {
  flex: 0 0 60px;      /* fixed 60px tall */
  display: flex;
  overflow-x: auto;
  background-color: #f0f0f0;
  gap: 4px;
  padding: 4px;
}
.menu-category {
  flex: 0 0 auto;
  min-width: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  border: 1px solid #aaa;
  border-radius: 4px;
  padding: 6px;
}
.menu-category:hover {
  background-color: #e5e5e5;
}
.menu-category.active {
  background-color: #d0d0d0;
}

/* Bottom: function keys row (fixed height) */
.function-keys {
  flex: 0 0 80px;      /* fixed 80px tall */
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1px;
  padding: 1px;
  background-color: #aaa;
}
.function-key {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: #e0e0e0;
  cursor: pointer;
  font-size: 0.85em;
}
.function-key:hover {
  background-color: #d0d0d0;
}
.function-key:first-child {
  background-color: #9aff9a;
}

/* Loading Overlay */
.loading {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.loading-spinner {
  width: 50px; height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error message (red box) */
.error-message {
  position: fixed;
  top: 20px; right: 20px;
  padding: 10px 20px;
  background-color: #f44336;
  color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: fadeOut 5s forwards;
}
@keyframes fadeOut {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
/* Info message (blue box) */
.info-message {
  position: fixed;
  top: 20px; right: 20px;
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: fadeOut 5s forwards;
}

/* Payment Modal */
#payment-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}
#payment-modal.active {
  display: flex;
}
#payment-modal .modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 6px;
  min-width: 300px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  text-align: center;
}
#payment-modal-message {
  margin-bottom: 15px;
  font-size: 16px;
}
#payment-modal button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background-color: #4a80f5;
  color: #fff;
  cursor: pointer;
}

/* The .modal base style (shared by payment method, receipt, etc.) */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal.active {
  display: flex;
}
.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from {opacity: 0; transform: translateY(20px);}
  to {opacity: 1; transform: translateY(0);}
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}
.modal-header h2 {
  font-size: 20px;
  color: #304080;
}
.modal-close {
  font-size: 24px;
  cursor: pointer;
  color: #999;
}
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.btn-primary {
  background-color: #4a80f5;
  color: white;
}

/* Payment option buttons */
.payment-option-btn {
  padding: 20px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 150px;
  justify-content: center;
  text-align: center;
  margin: 0 auto;
}
.payment-option-btn:not(:first-child) {
  background-color: #007bff;
}
.payment-option-btn:last-child {
  background-color: #ffc107;
}

/* Receipt content area */
#receipt-content {
  padding: 20px;
  background-color: white;
  border: 1px solid #ccc;
  min-height: 300px;
  font-family: monospace;
  white-space: pre-line;
}

.kitchen-order-section {
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.kitchen-order-header {
  background-color: #f5f5f5;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

.kitchen-order-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.kitchen-order-items {
  padding: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.kitchen-order-content {
  font-family: monospace;
  white-space: pre-wrap;
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
}

#print-all-kitchen-orders {
  margin-top: 15px;
}
.order-panel {
  border: 2px solid #000 !important;
  border-radius: 6px !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
}

/* Thick black border for the menu items container */
.menu-items {
  border: 2px solid #000 !important;
  border-radius: 6px !important;
  padding: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}
/* Add these styles to your style.css file */
