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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #ffffff;
  color: #222;
  padding: 20px;
  max-width: 960px;
  margin: auto;
}

h2, h3 {
  color: #c70000;
  margin-bottom: 15px;
}

form {
  background-color: #fff;
  border: 1px solid #ccc;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-section {
  margin-bottom: 30px;
  padding: 15px;
  border-left: 4px solid #c70000;
  background: #fef2f2;
  border-radius: 8px;
}

label {
  display: block;
  margin: 10px 0 4px;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
}

input:focus, select:focus {
  border-color: #c70000;
  outline: none;
}

button {
  background-color: #c70000;
  color: white;
  padding: 12px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}

button:hover {
  background-color: #a80000;
}

canvas {
  border: 1px solid #ccc;
  margin-top: 10px;
  width: 100%;
  max-width: 320px;
  height: 150px;
  border-radius: 6px;
}

#clearBtn {
  background-color: #555;
  margin-top: 10px;
}

#clearBtn:hover {
  background-color: #333;
}

.guest-entry,
.car-entry {
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.car-entry input {
  flex: 1;
  min-width: 120px;
}

/* Responsive Layout */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .guest-entry, .car-entry {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  h2, h3 {
    font-size: 18px;
  }

  label {
    font-size: 14px;
  }

  input, select, button {
    font-size: 14px;
    padding: 8px;
  }

  canvas {
    height: 120px;
  }
}

@media (max-width: 320px) {
  body {
    padding: 10px;
  }

  form {
    padding: 15px;
  }

  button {
    width: 100%;
    padding: 10px;
  }
}

/* 🔧 Add this to fix show/hide issue */
.hidden {
  display: none !important;
}

/* ✅ Popup Modal Styling */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: white;
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.popup-content h3 {
  color: #c70000;
  margin-bottom: 15px;
}

.popup-content p {
  margin-bottom: 20px;
  font-size: 16px;
}

.popup-content button {
  background-color: #c70000;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
}

.popup-content button:hover {
  background-color: #a80000;
}

.popup-overlay.active {
  display: flex;
}

/* ✅ Modal Styling (Appended) */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
}

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
}

// Guest Field CSS Styling

#guestFields .guest-entry {
  display: flex;
  gap: 8px; /* Reduced horizontal space between fields */
  margin-bottom: 8px; /* Less space between rows */
  align-items: center;
  flex-wrap: wrap;
}

#guestFields .guest-entry:first-child {
  margin-top: 16px; /* Or any value you prefer */
}


#guestFields .guest-entry label {
  font-weight: bold;
  white-space: nowrap;
  font-size: 14px;
}

/* Guest Name - wider */
#guestFields input[name="guestName[]"] {
  flex: 2;
  min-width: 160px;
  padding: 10px 12px;
  font-size: 14px;
  text-transform: uppercase;
}

/* Age - narrower */
#guestFields input[name="guestAge[]"] {
  flex: 0 0 80px;
  padding: 10px 12px;
  font-size: 14px;
}

/* Gender - dropdown */
#guestFields select[name="guestGender[]"] {
  flex: 0 0 105px;
  padding: 10px 12px;
  font-size: 14px;
}

/* Responsive (mobile) adjustments */
@media (max-width: 768px) {
  #guestFields .guest-entry {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  #guestFields input[name="guestName[]"],
  #guestFields input[name="guestAge[]"],
  #guestFields select[name="guestGender[]"] {
    width: 100% !important;
    flex: none !important;
    min-width: unset !important;
    padding: 8px !important;
    font-size: 14px !important;
  }

  #guestFields .guest-entry > * {
    margin-bottom: 6px;
  }
}
label:has(+ input[required])::before,
label:has(+ select[required])::before {
  content: "* ";
  color: red;
}

