@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;500&family=Poppins:wght@500;600&display=swap');

/* Custom Reservation Admin Styles */

body.custom-reservation-admin,
body.toplevel_page_custom_reservation {
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #222;
}

h1, h2, h3, h4, h5 {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
}

label {
  font-weight: 500;
  color: #333;
}

input[type=text],
input[type=email],
select,
textarea {
  font-family: "Lato", sans-serif;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 10px;
}

input[type=submit],
button,
.button-primary {
  border: none;
  border-radius: 6px;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  cursor: pointer;
}

input[type=submit]:hover,
.button-primary:hover {
  background-color: #1e5c99;
}

.wrap h1 {
  letter-spacing: 0.5px;
  font-weight: 600;
}


.cr-step h2 {
  font-size: 23px;
  text-align: center;
  margin-bottom: 20px;
  width: 90%;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
  font-family: 'Poppins';
}

.cr-step { display: none; text-align: center; }
.cr-step.active { display: block; }

/* --- Reservation Type Section --- */

.cr-options {
  display: flex;
  flex-direction: column; /* Stack vertically */
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  width: 100%;
}

.cr-option {
  cursor: pointer;
  width: 90%;
  max-width: 400px;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column; /* Stack vertically */
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center; /* Center all inner text */
  transition: all 0.25s ease-in-out;
}

.cr-option span,
.cr-option svg,
.cr-option img {
  font-size: 32px; /* Larger icon */
  margin-bottom: 4px;
}

.cr-option h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: #222;
  font-family: 'Poppins';
}

.cr-option p {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

.cr-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-color: #4d762d;
  background: #e4ebda;
}

.cr-option:active {
  transform: scale(0.98);
}

/* Icon style */
.cr-option span,
.cr-option svg,
.cr-option img {
  font-size: 26px;
  flex-shrink: 0;
}


/* --- Highlight Selected --- */
.cr-option.selected {
  border-color: #4d762d;
  background: #e4ebda;
  box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}


/* --- Modal Overlay --- */
.cr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: all 0.3s ease-in-out;
}

/* Show state (visible + animated) */
.cr-modal.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* --- Modal Content --- */
.cr-modal-content {
  background: #fff;
  padding: 25px 30px;
  border-radius: 12px;
  max-width: 450px;
  width: 90%;
  text-align: left;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
  transform: scale(0.95);
  transition: all 0.3s ease-in-out;
}

/* Smooth fade when closing modal */
.cr-modal.fade-out {
  opacity: 0;
  transform: scale(0.95);
  visibility: hidden;
}

/* Scale up when showing */
.cr-modal.show .cr-modal-content {
  transform: scale(1);
}

/* --- Modal Title --- */
#cr-modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #222;
  font-family: 'Poppins';
}

/* --- Terms Text --- */
.cr-modal-content p {
  margin: 0 0 10px 0;
}

.cr-modal-content ul {
  margin: 0 0 15px 20px;
  font-size: 0.9rem;
  color: #555;
}

/* --- Checkbox Label --- */
.cr-modal-content label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #333;
}

/* --- Buttons --- */
.cr-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.cr-modal-buttons button {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

#cr-cancel {
  background: #ededed;
  color: #333;
  font-size: 16px; /* 🔹 increased from ~14px */
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Cancel Button Hover */
#cr-cancel:hover {
  background-color: rgb(210, 210, 210);
  transform: scale(1.05);
}

#cr-confirm {
  background: #4d762d;
  color: #fff;
  font-size: 16px; /* 🔹 increased from ~14px */
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#cr-confirm:disabled {
  background: #e4ebda;
  cursor: not-allowed;
}

/* Confirm Button Active State */
#cr-confirm:not(:disabled):hover {
  transform: scale(1.05);
}

#cr-confirm:hover:not(:disabled) {
  background: #325418;
}

/* Checkbox when selected */
#cr-agree:checked {
  accent-color: #325418;
}

/* Confirm button active (after agreeing) */
#cr-confirm.enabled {
  background-color: #4d762d !important;
  color: #fff;
  border: none;
  transition: background-color 0.2s ease;
}

#cr-confirm.enabled:hover {
  background-color: #325418 !important;
}

/* Checkbox custom styling (modern browsers) */
#cr-agree {
  accent-color: #325418; /* Native green accent for checkbox */
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Optional: label text next to checkbox */
label[for="cr-agree"] {
  cursor: pointer;
  color: #333;
  font-size: 14px;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}


#cr-form { max-width: 400px; margin: auto; text-align: left; }
#cr-form label { display: block; margin-top: 10px; }
#cr-form input, #cr-form select { width: 100%; padding: 8px; margin-top: 5px; border-radius: 6px; border: 1px solid #ccc; }
.cr-buttons { display: flex; justify-content: space-between; margin-top: 20px; }

/* --- Icon Hover Animation --- */

.cr-option span {
  display: block;
  font-size: 32px;
  transition: transform 0.3s ease, color 0.3s ease;
  color: #444;
}

/* Bounce + color change on hover */
.cr-option:hover span {
  transform: translateY(-4px) scale(1.1);
  color: #0073aa;
}

/* Optional: gentle "pop" animation when selected */
.cr-option.selected span {
  animation: pop 0.3s ease;
  color: #0073aa;
}

/* Keyframes for the pop effect */
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Calendar */
#cr-calendar {
  margin: 10px 0 20px;
  max-width: 320px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ✅ Flatpickr selected date styling */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover {
  background: #4d762d !important;
  border-color: #4d762d !important;
  color: #fff !important;
}

/* Optional: hover state for unselected days */
.flatpickr-day:hover {
  background: #e9f0e4;
  border-color: #4d762d;
}


/* Timeslot Button Grid */
.cr-timeslots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Equal size buttons */
  gap: 10px;
  justify-content: center;
  padding: 10px 0;
}

.cr-timeslot {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 45px;
  background-color: #f2f2f2;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap; /* Keep "12:00 NN" on one line */
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.cr-timeslot:hover {
  background: #e6f2ff;
  border-color: #4d762d;
}

/* Hover state */
.cr-timeslot:hover:not(:disabled) {
  background-color: #e5e5e5;
  transform: scale(1.05);
}

.cr-timeslot.selected {
  background-color: #4d762d;
  color: #fff;
  border-color: #4d762d;
  font-weight: 600;
}

.cr-timeslot-placeholder {
  font-size: 14px;
  color: #777;
}

.cr-timeslot:disabled {
  background-color: #ddd;
  color: #888;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Shared Button Styles */
#cr-cancel,
#cr-confirm,
#cr-back,
#cr-form button[type="submit"] {
  font-size: 16px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  border: none;
}

/* Primary (Confirm / Submit) Buttons */
#cr-confirm:not(:disabled),
#cr-form button[type="submit"] {
  background-color: #4d762d;
  color: #fff;
}

#cr-confirm:not(:disabled):hover,
#cr-form button[type="submit"]:hover {
  background-color: #325418;
  transform: scale(1.05);
}

/* Secondary (Cancel / Back) Buttons */
#cr-cancel,
#cr-back {
  background-color: #eaeaea;
  color: #333;
}

#cr-cancel:hover,
#cr-back:hover {
  background-color: #d6d6d6;
  transform: scale(1.05);
}

/* Align buttons properly in step 3 */
.cr-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

#cr-phone {
  letter-spacing: 1px;
}
.cr-input-note {
  display: block;
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}

#cr-pax-note {
  display: block;
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

#cr-diet {
  width: 100%;
  resize: vertical;
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

#cr-diet::placeholder {
  color: #777;
  font-size: 13px;
}

/* === Modal Transition Base === */
#cr-modal {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.97);
  transition: all 0.25s ease;
}

/* === Modal When Active === */
#cr-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

#cr-fullname {
  text-transform: capitalize;
}

/* --- Terms & Conditions Styling --- */
#cr-terms-content {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#cr-modal.show #cr-terms-content {
  opacity: 1;
  transform: translateY(0);
}

#cr-terms-content p strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#cr-terms-content ul {
  margin: 0.5em 0 0 1.5em;
  padding: 0;
  list-style-type: disc;
}

#cr-terms-content li {
  margin-bottom: 0.3em;
  line-height: 1.5;
  color: #444;
}

/* Disabled date feedback */
.flatpickr-disabled {
  opacity: 0.4 !important;
  pointer-events: none;
}

/* Timeslot buttons */
.cr-timeslot-btn {
  padding: 8px 12px;
  margin: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cr-timeslot-btn:hover {
  background: #eee;
}

.cr-timeslot-btn.active {
  background: #333;
  color: white;
}

/* Notice for unavailable dates/times */
#cr-timeslots p {
  color: #999;
  font-style: italic;
}

.cr-blocked-timeslot {
  opacity: 0.5;
  cursor: not-allowed;
  background: #ccc;
}

.cr-blocked-date {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  color: #d9534f;
  font-weight: 500;
  margin-top: 8px;
}

.cr-timeslot.past-slot {
  opacity: 0.5;
  cursor: not-allowed;
  background: #eee;
  color: #666;
}

/* Grey out past dates */
.cr-past-date {
  background: #f0f0f0 !important;
  color: #aaa !important;
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* Keep blocked dates visually distinct */
.cr-blocked-date {
  background: #ffe6e6 !important;
  color: #b30000 !important;
  border-radius: 50%;
}

.cr-past-date,
.flatpickr-disabled {
  pointer-events: none !important;
  opacity: 0.4 !important;
  color: #999 !important;
  background: #f5f5f5 !important;
  cursor: not-allowed !important;
}

/* Loading Spinner */
.cr-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  animation: cr-spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes cr-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Dim the button while loading */
#cr-submit.cr-loading {
  opacity: 0.8;
  cursor: not-allowed;
  pointer-events: none;
}


/* --- Mobile Friendly --- */
@media (max-width: 600px) {
  .cr-option {
    width: 95%;
    padding: 18px;
  }

  .cr-option span {
    font-size: 28px;
  }

  .cr-option h3 {
    font-size: 0.95rem;
  }

  .cr-option p {
    font-size: 0.75rem;
  }
}
