/* ===============================================
   CAMPUS TOUR BOOKING MODAL
   Theme: EduNova (--navbar, --mint, etc.)
   =============================================== */

:root {
  --navbar: #5DADE2;
  --bg: #F8FBFF;
  --mint: #7ED6A5;
  --mint-hover: #66c491;
  --hover-blue: #4A90E2;
  --text: #2C3E50;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(44, 62, 80, 0.08);
}

/* ---------- OVERLAY ---------- */
.tour-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 62, 80, 0.55);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tour-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---------- MODAL BOX ---------- */
.tour-modal {
  background: var(--white);
  border-radius: 20px;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(44, 62, 80, 0.25);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.tour-modal-overlay.active .tour-modal {
  transform: scale(1) translateY(0);
}

.tour-modal::-webkit-scrollbar {
  width: 6px;
}
.tour-modal::-webkit-scrollbar-thumb {
  background: #c5d9eb;
  border-radius: 10px;
}

/* ---------- HEADER ---------- */
.tour-modal-header {
  background: linear-gradient(135deg, var(--navbar), #4A90E2);
  color: var(--white);
  padding: 28px 32px 24px;
  border-radius: 20px 20px 0 0;
  position: relative;
}

.tour-modal-header .modal-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.tour-modal-header h2 {
  font-family: "Poppins", sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--white);
}

.tour-modal-header p {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
  margin: 0;
}

.tour-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.tour-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg);
}

/* ---------- BODY / FORM ---------- */
.tour-modal-body {
  padding: 24px 28px 28px;
}

.tour-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.tour-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0; /* prevent overflow in grid */
}

.tour-form-group.full-width {
  grid-column: 1 / -1;
}

.tour-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.tour-form-group label .required {
  color: #e74c3c;
}

.tour-form-group input,
.tour-form-group select,
.tour-form-group textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid #d6e4f0;
  border-radius: 10px;
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  background: #fafcfe;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  outline: none;
  box-sizing: border-box;
}

.tour-form-group input:focus,
.tour-form-group select:focus,
.tour-form-group textarea:focus {
  border-color: var(--navbar);
  box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.18);
  background: var(--white);
}

.tour-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.tour-form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235DADE2' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* Error */
.tour-form-group.error input,
.tour-form-group.error select,
.tour-form-group.error textarea,
.tour-form-group input.input-invalid,
.tour-form-group select.input-invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
  background: #fff5f5;
}

.form-error-msg {
  font-size: 0.78rem;
  color: #e74c3c;
  font-weight: 600;
  display: none;
}

.tour-form-group.error .form-error-msg {
  display: block;
}

/* ---------- FOOTER ---------- */
.tour-modal-footer {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #eef3f8;
}

.tour-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 12px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.tour-btn-cancel {
  background: #f0f4f8;
  color: #5a6a7a;
}

.tour-btn-cancel:hover {
  background: #e2eaf2;
}

.tour-btn-submit {
  background: linear-gradient(135deg, var(--navbar), #4A90E2);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(93, 173, 226, 0.3);
}

.tour-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(93, 173, 226, 0.4);
}

.tour-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.tour-btn-submit .spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: tourSpin 0.7s linear infinite;
  display: none;
}

.tour-btn-submit.loading .spinner {
  display: block;
}

.tour-btn-submit.loading .btn-text {
  display: none;
}

@keyframes tourSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- SUCCESS ---------- */
.tour-success {
  display: none;
  text-align: center;
  padding: 40px 28px;
}

.tour-success.active {
  display: block;
}

.tour-success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--mint), #5ecf94);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2.2rem;
  color: white;
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.tour-success h3 {
  font-family: "Poppins", sans-serif;
  font-size: 1.35rem;
  color: var(--text);
  margin-bottom: 10px;
}

.tour-success p {
  color: #5a6a7a;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ---------- RESPONSIVE — keep 2 columns where possible ---------- */
@media (max-width: 600px) {
  .tour-modal-header {
    padding: 22px 18px 18px;
  }

  .tour-modal-header h2 {
    font-size: 1.25rem;
    padding-right: 36px;
  }

  .tour-modal-body {
    padding: 18px 16px 20px;
  }

  /* Still 2 fields per row on phones */
  .tour-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px 10px;
  }

  .tour-form-group input,
  .tour-form-group select,
  .tour-form-group textarea {
    padding: 10px;
    font-size: 0.88rem;
  }

  .tour-form-group label {
    font-size: 0.78rem;
  }

  /* Cancel + Book Tour side by side */
  .tour-modal-footer {
    flex-direction: row;
    gap: 10px;
  }

  .tour-btn {
    padding: 12px 10px;
    font-size: 0.85rem;
  }
}

@media (max-width: 380px) {
  /* very small phones: still 2 cols but tighter */
  .tour-form-grid {
    gap: 10px 8px;
  }

  .tour-form-group label {
    font-size: 0.72rem;
  }

  .tour-form-group input,
  .tour-form-group select {
    font-size: 0.82rem;
    padding: 9px 8px;
  }
}