/* style.css */

/* Base layout */
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f6f8;
  margin: 0;
  padding: 20px;
  text-align: center;
}

/* Unified header */
h1 {
  font-size: 32px;
  color: #333;
  margin-bottom: 30px;
  animation: fadeIn 1s ease-in-out;
}

/* Card layout */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: slideUp 0.6s ease;
}

/* Section headers */
.card h2 {
  margin-top: 0;
  color: #444;
  font-size: 20px;
  margin-bottom: 10px;
}

/* Buttons */
button {
  background-color: #0078d4;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  margin: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}
button:hover {
  background-color: #005fa3;
}

/* Queue list */
.queue {
  font-size: 16px;
  color: #333;
  margin-top: 10px;
}

/* Counter boxes */
.counter-boxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}
.counter-box {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 160px;
  padding: 15px;
  animation: fadeInBox 0.5s ease;
}
.counter-box h3 {
  margin: 0;
  font-size: 18px;
  color: #0078d4;
}
.counter-box p {
  margin: 8px 0 0;
  font-size: 16px;
  color: #333;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInBox {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .card {
    padding: 15px;
    margin: 10px;
  }
  h1 {
    font-size: 24px;
  }
  button {
    width: 100%;
    margin: 8px 0;
  }
  .counter-box {
    width: 100%;
  }
}

/* Action cards */
.action-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.action-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 160px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  animation: fadeInBox 0.5s ease;
}
.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.action-card h3 {
  margin: 0;
  font-size: 18px;
  color: #0078d4;
}
.action-card p {
  margin: 8px 0 0;
  font-size: 14px;
  color: #333;
}
.action-card:active {
  transform: scale(0.98);
}

/* Responsive for mobile */
@media (max-width: 600px) {
  .action-card {
    width: 100%;
  }
}

/* Rectangular manual update card */
.manual-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 20px;
  margin: 15px auto;
  max-width: 500px;   /* wider rectangle */
  text-align: center;
  animation: fadeInBox 0.5s ease;
}

.manual-card h3 {
  margin: 0 0 15px;
  font-size: 20px;
  color: #0078d4;
}

.manual-card select,
.manual-card input {
  width: 60%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.manual-card button {
  margin-top: 12px;
  width: 40%;
}

/* Reset button style */
.reset-btn {
  background-color: #d9534f;   /* Bootstrap-style red */
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  margin-top: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.reset-btn:hover {
  background-color: #c9302c;   /* darker red on hover */
}

.reset-btn:active {
  transform: scale(0.97);
}

.centered-card {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.card-link {
  background-color: #f3f3f3;
  border: 2px solid #0078d4;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 600px; /* Match other cards */
  text-align: center;
}

.card-link h3 {
  margin-top: 0;
  color: #0078d4;
}

.card-link p {
  margin: 8px 0;
  color: #333;
}

.card-button {
  display: inline-block;
  padding: 8px 14px;
  background-color: #0078d4;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
}

.card-button:hover {
  background-color: #005a9e;
}

body {
  font-family: Arial, sans-serif;
  margin: 10px;
  padding: 0;
  background-color: #f9f9f9;
}

h2 {
  font-size: 1.2em;
  margin-bottom: 10px;
}

.section {
  background: #fff;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

button, input, select {
  font-size: 1em;
  padding: 12px;
  margin: 5px 0;
  width: 100%;          /* full width on mobile */
  box-sizing: border-box;
}

@media (min-width: 600px) {
  .section {
    max-width: 500px;
    margin: auto;
  }
  button, input, select {
    width: auto;        /* normal width on larger screens */
  }
}

/* General layout */
body {
  font-family: Arial, sans-serif;
  margin: 10px;
  padding: 0;
  background-color: #f9f9f9;
}

h1 {
  text-align: center;
  font-size: 1.5em;
  margin-bottom: 20px;
}

h2 {
  font-size: 1.2em;
  margin-bottom: 10px;
}

/* Card styling */
.card, .centered-card {
  background: #fff;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.centered-card {
  text-align: center;
}

/* Action grid for counters */
.action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-card {
  flex: 1 1 100%; /* full width on mobile */
  background: #e9f5ff;
  padding: 15px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}

.action-card:hover {
  background: #d0ebff;
}

/* Counter boxes */
.counter-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.counter-box {
  flex: 1 1 100%; /* full width on mobile */
  background: #f0f0f0;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}

/* Manual control */
.manual-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manual-card select,
.manual-card input,
.manual-card button {
  font-size: 1em;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
}

/* Customer link */
.card-link {
  margin-top: 10px;
}

.card-button {
  display: inline-block;
  background: #007bff;
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1em;
}

.card-button:hover {
  background: #0056b3;
}

/* Reset button */
.reset-btn {
  background: #dc3545;
  color: #fff;
  padding: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.reset-btn:hover {
  background: #b02a37;
}

/* Responsive tweaks for larger screens */
@media (min-width: 600px) {
  .action-card, .counter-box {
    flex: 1 1 calc(50% - 10px); /* two per row */
  }
  .manual-card {
    flex-direction: row;
    align-items: center;
  }
  .manual-card select,
  .manual-card input {
    flex: 1;
    margin-right: 10px;
  }
  .manual-card button {
    flex: 0 0 auto;
    width: auto;
  }
}

.modal {
  display: none; /* keep hidden until triggered */
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 550px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.close {
  float: right;
  font-size: 1.5em;
  cursor: pointer;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

form label {
  font-weight: 500;
  margin-bottom: 4px;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form select {
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.blue-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
}

.blue-btn:hover {
  background: #0056b3;
}

.checkbox-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-button {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  background-color: #f9f9f9;
  transition: border-color 0.2s, background-color 0.2s;
  box-sizing: border-box;
  min-width: 180px;
}

.checkbox-button input[type="checkbox"] {
  accent-color: #007bff;
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-button:hover {
  border-color: #007bff;
  background-color: #eef6ff;
}

.confirmation-box {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.checkbox-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.checkbox-box input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.checkbox-box span {
  flex-grow: 1;
}
#queueNumber {
  color: #007bff;
}

.checkbox-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-button {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  background-color: #f9f9f9;
  transition: border-color 0.2s, background-color 0.2s;
  box-sizing: border-box;
  min-width: 180px;
}

.checkbox-button input[type="checkbox"] {
  accent-color: #007bff;
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-button:hover {
  border-color: #007bff;
  background-color: #eef6ff;
}

.action-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.action-card {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 16px;
  border-radius: 8px;
  flex: 1;
  min-width: 250px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-card h3 {
  margin-top: 0;
}

.blue-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

/* Modal overlay */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  overflow: hidden;
  z-index: 9999;
}

/* Centered dialog */
.modal-dialog {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Modal content wrapper */
.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Scrollable body */
.modal-body {
  flex: 1;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 16px;
  box-sizing: border-box;
}

/* Form layout */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Label and input alignment */
label {
  font-weight: bold;
  width: 100%;
  box-sizing: border-box;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="checkbox"] {
  width: 100%;
  box-sizing: border-box;
}

/* Checkbox layout */
.checkbox-grid-boxed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.checkbox-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.checkbox-box:hover {
  background-color: #eef;
}

.checkbox-box input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.checkbox-box span {
  flex-grow: 1;
}

.modal-body {
  padding: 16px; 
  width: 100%;
  box-sizing: border-box;
  
  /* --- CRITICAL CHANGE: Use Flexbox to center the form --- */
  display: flex; /* Turn it into a flex container */
  justify-content: center; /* Horizontally center the child elements (the form) */
  /* Revert display: block; from your original CSS as it conflicts with flex */
}

.modal-dialog {
  margin: 5vh auto 0 auto;
  width: 90%;
  max-width: 500px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

form {
  /* Set width/max-width to ensure the form respects its size limits */
  width: 100%;
  max-width: 500px; 
  
  /* IMPORTANT: Set padding and margins to 0 or adjust as needed */
  padding: 0; /* Remove padding here if you want .modal-body's 16px padding to define the space */
  margin: 0; /* Ensures no auto margins interfere with flex centering */
  
  box-sizing: border-box;
  transform: translateX(-10px);
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 1rem;
}
