body {
  font-family: sans-serif;
  background: #fceabb;
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

/* Make all elements use border-box for more predictable sizing */
*, *:before, *:after {
  box-sizing: inherit;
}

/* Styles for table action buttons */
.table-actions {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  flex-wrap: wrap; /* Allow buttons to wrap on small screens */
}

.table-actions button {
  padding: 5px 10px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8em;
  margin-bottom: 5px; /* Add space between wrapped buttons */
}

.table-actions button:hover {
  background: #c0392b;
}

/* Order status styles */
#queueList li .order-status.dining {
  background: #9b59b6;
}

#queueList li .order-status.check_requested {
  background: #34495e;
  content: "Ready for Payment";
}

#connectionStatus {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border-radius: 5px;
  background: white;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 100;
}

/* Modal styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-container {
  background: #fff;
  width: 90%;
  max-width: 500px;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalAppear 0.5s ease-out;
  overflow-y: auto;
  max-height: 90vh; /* Prevent modal from being taller than viewport */
}

@keyframes modalAppear {
  from { opacity: 0; transform: translateY(-50px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-family: 'Satisfy', cursive;
  color: #e74c3c;
  font-size: 2.5em;
  margin: 0;
  word-wrap: break-word; /* Ensure long text wraps */
}

.modal-content {
  margin-bottom: 20px;
}

.receipt {
  background: #fdf6e3;
  padding: 15px;
  border: 1px dashed #ccc;
  font-family: monospace;
  margin-bottom: 20px;
  overflow-x: auto; /* Allow horizontal scrolling if needed */
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.receipt-items {
  margin-bottom: 10px;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.receipt-item span {
  padding: 2px 0;
}

.receipt-total {
  border-top: 1px dashed #ccc;
  padding-top: 10px;
  text-align: right;
  font-weight: bold;
}

.modal-buttons {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-buttons button {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  background: #e74c3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 5px;
  flex: 1 1 auto; /* Allow buttons to grow and shrink */
  min-width: 120px; /* Minimum width for buttons */
  text-align: center;
}

.modal-buttons button:hover {
  background: #c0392b;
  transform: scale(1.05);
}

.payment-btn {
  background: #6772e5 !important; /* Stripe blue color */
  margin-top: 15px !important;
  width: 100%;
  font-size: 1.1em !important;
}

.payment-btn:hover {
  background: #5469d4 !important; /* Darker Stripe blue on hover */
}

#diner div {
  padding: 10px;
  margin: 5px;
  border: 2px solid brown;
  background: #fff0d4;
  display: inline-block;
  max-width: 100%;
  word-wrap: break-word; /* Ensure text wraps */
  overflow-wrap: break-word;
}

#chatBox {
  margin-top: 20px;
}

#menu, #kitchen {
  margin-top: 20px;
  /* background: #ffe; */
  padding: 10px;
  border: 1px solid #ccc;
}

#menu button {
  margin-right: 10px;
  margin-bottom: 5px;
}

.bounce {
  animation: bounce 0.4s ease;
}

@keyframes bounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

/* Chat input and button layout */
#chatInput {
  width: calc(100% - 100px);
  max-width: 100%;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
  /* Adjust grid layouts to stack on smaller screens */
  .welcome-section, .game-section {
    display: block !important; /* Override the grid layout from inline styles */
  }
  
  .retro-container {
    margin-bottom: 20px;
  }
  
  /* Make chat input take full width on mobile */
  #chatInput {
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* Make send button full width on mobile */
  #chatInput + button {
    width: 100%;
    margin-left: 0;
  }
  
  /* Adjust font sizes for better readability on mobile */
  h1 {
    font-size: 2.5em !important;
  }
  
  .section-title {
    font-size: 1.5em !important;
  }
  
  /* Adjust modal padding for smaller screens */
  .modal-container {
    padding: 15px;
  }
  
  /* Make modal buttons stack on very small screens */
  @media (max-width: 480px) {
    .modal-buttons button {
      width: 100%;
    }
  }
}

/* Fix for order status labels on mobile */
@media (max-width: 480px) {
  #queueList li {
    padding-right: 70px; /* Make room for status label */
    position: relative;
  }
  
  #queueList li .order-status {
    font-size: 0.7em;
    padding: 2px 5px;
    right: 5px;
  }
}

.retro-container .menu-categories {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 15px !important;
  margin-top: 15px;
}

.menu-category {
  background: #fdf6e3;
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #e74c3c;
  width: 100%;
}

.menu-category h4 {
  font-family: 'Satisfy', cursive;
  color: #e74c3c;
  margin: 0 0 10px 0;
  font-size: 1.2em;
}

.menu-category button {
  display: block;
  width: 100%;
  margin: 5px 0;
  text-align: left;
  padding: 8px 12px;
  font-size: 0.9em;
}

.retro-container.welcome-container {
  background-image: url(hostess.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.welcome-container .description {
  margin-top: 200px;
}
.welcome-container h3.section-title {
  font-size: 3em;
}
.welcome-container .description {
  font-size: 1.5em;
}
.retro-container.tables-container {
  background-image: url(tables.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
} 

.retro-container.chat-container {
  background-image: url(menubg.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
} 

.retro-container.kitchen-container {
  background-image: url(kitchen.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}   

.retro-container.menu-container {
  background-image: url(chalk.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
} 


/* Ensure menu items stack on mobile */
@media (max-width: 768px) {
  .retro-container .menu-categories {
    grid-template-columns: 1fr !important;
  }
}
