/* ============================================================
   BALI WAVE BOARDS – Rental Booking System Styles
   ============================================================ */

/* ---------- Modal Overlay ---------- */
#rental-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: overlayFadeIn 0.25s ease;
}
#rental-modal-overlay.active {
  display: flex;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Modal Box ---------- */
#rental-modal {
  background: #0f1923;
  border: 1px solid rgba(0, 212, 180, 0.2);
  border-radius: 20px;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 36px 40px;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,212,180,0.08);
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Modal Header ---------- */
#rental-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
#rental-modal-board-name {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  color: #fff;
  line-height: 1.1;
}
#rental-modal-board-name span {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #00d4b4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
#rental-modal-close {
  background: rgba(255,255,255,0.07);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #aaa;
  font-size: 22px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
  margin-left: 16px;
}
#rental-modal-close:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

/* ---------- Calendar Container ---------- */
.bali-calendar-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

/* ---------- Single Month ---------- */
.bali-month {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 18px;
}
.bali-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.bali-month-nav {
  background: none;
  border: none;
  color: #00d4b4;
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
  transition: background 0.2s;
}
.bali-month-nav:hover { background: rgba(0,212,180,0.15); }
.bali-month-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Weekday Labels ---------- */
.bali-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}
.bali-weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  padding: 4px 0;
}

/* ---------- Day Cells ---------- */
.bali-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.bali-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #ccc;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  user-select: none;
}
.bali-day:hover:not(.disabled):not(.empty) {
  background: rgba(0,212,180,0.2);
  color: #fff;
}
.bali-day.empty { cursor: default; }
.bali-day.past  { color: #333; cursor: not-allowed; }
.bali-day.unavailable {
  color: #3a3a3a;
  cursor: not-allowed;
  text-decoration: line-through;
}
.bali-day.unavailable::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, transparent, transparent 3px, rgba(255,0,0,0.07) 3px, rgba(255,0,0,0.07) 4px);
}
.bali-day.start-date {
  background: #00d4b4;
  color: #0a0f14;
  font-weight: 700;
  border-radius: 8px 0 0 8px;
}
.bali-day.end-date {
  background: #00d4b4;
  color: #0a0f14;
  font-weight: 700;
  border-radius: 0 8px 8px 0;
}
.bali-day.start-date.end-date {
  border-radius: 8px;
}
.bali-day.in-range {
  background: rgba(0,212,180,0.15);
  color: #fff;
  border-radius: 0;
}
.bali-day.hover-range {
  background: rgba(0,212,180,0.08);
}
.bali-day.today {
  font-weight: 700;
  color: #00d4b4;
}
.bali-day.today.in-range,
.bali-day.today.start-date,
.bali-day.today.end-date {
  color: inherit;
}

/* ---------- Price Summary ---------- */
#rental-price-summary {
  background: rgba(0,212,180,0.07);
  border: 1px solid rgba(0,212,180,0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 56px;
}
#rental-price-summary.hidden { display: none; }
.rental-summary-dates {
  font-size: 0.9rem;
  color: #aaa;
}
.rental-summary-dates strong {
  color: #fff;
  font-weight: 600;
}
.rental-summary-total {
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  color: #00d4b4;
  line-height: 1;
}
.rental-summary-total small {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: #888;
  margin-left: 4px;
  font-weight: 500;
}
#rental-price-placeholder {
  color: #555;
  font-size: 0.9rem;
}

/* ---------- Booking Form ---------- */
#rental-booking-form { display: none; }
#rental-booking-form.visible { display: block; }
.rental-form-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rental-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.rental-form-grid .full-width { grid-column: 1 / -1; }
.rental-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.rental-field input,
.rental-field textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.rental-field input:focus,
.rental-field textarea:focus {
  border-color: #00d4b4;
  background: rgba(0,212,180,0.05);
}
.rental-field input::placeholder,
.rental-field textarea::placeholder { color: #444; }

/* ---------- Consent Checkbox ---------- */
.rental-consent-wrap {
  margin-top: 5px;
  margin-bottom: 5px;
}
.rental-consent-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #aaa;
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
}
.rental-consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #00d4b4;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.rental-consent-label a {
  color: #00d4b4;
  text-decoration: underline;
  transition: color 0.2s;
}
.rental-consent-label a:hover {
  color: #fff;
}

/* ---------- Form Actions ---------- */
.rental-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
#rental-submit-btn {
  flex: 1;
  background: linear-gradient(135deg, #00d4b4, #00a896);
  color: #0a0f14;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#rental-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,212,180,0.35);
}
#rental-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#rental-back-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 20px;
  color: #aaa;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#rental-back-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ---------- Proceed Button ---------- */
#rental-proceed-btn {
  width: 100%;
  background: linear-gradient(135deg, #00d4b4, #00a896);
  color: #0a0f14;
  border: none;
  border-radius: 12px;
  padding: 15px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
  display: none;
}
#rental-proceed-btn.visible {
  display: block;
}
#rental-proceed-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,212,180,0.35);
}

/* ---------- Success Screen ---------- */
#rental-success {
  display: none;
  text-align: center;
  padding: 20px 0;
}
#rental-success.visible { display: block; }
.rental-success-icon {
  width: 72px;
  height: 72px;
  background: rgba(0,212,180,0.15);
  border: 2px solid #00d4b4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}
#rental-success h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 10px;
}
#rental-success p {
  color: #aaa;
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.6;
}
.rental-success-wa {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  border-radius: 12px;
  padding: 14px 28px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
}
.rental-success-wa:hover {
  background: #1ebe5a;
  transform: translateY(-2px);
}

/* ---------- Error Message ---------- */
.rental-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin-top: 10px;
  text-align: center;
}

/* ---------- Modal Layout Split ---------- */
.rental-modal-split {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.rental-modal-details {
  flex: 0 0 320px;
}
.rental-modal-details img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.rental-modal-desc-text {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.rental-modal-flow {
  flex: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  #rental-modal { max-width: 700px; padding: 24px 20px; }
  .rental-modal-split { flex-direction: column; gap: 24px; }
  .rental-modal-details { flex: auto; display: flex; align-items: flex-start; gap: 20px; }
  .rental-modal-details img { width: 40%; margin-bottom: 0; }
  .rental-modal-desc-text { font-size: 0.85rem; margin-bottom: 10px; }
}
@media (max-width: 680px) {
  .bali-calendar-wrap { grid-template-columns: 1fr; }
  .rental-form-grid { grid-template-columns: 1fr; }
  .rental-form-grid .full-width { grid-column: 1; }
  #rental-modal-board-name { font-size: 1.5rem; }
}
@media (max-width: 500px) {
  .rental-modal-details { flex-direction: column; gap: 12px; }
  .rental-modal-details img { width: 100%; border-radius: 8px; }
  .bali-day { font-size: 0.72rem; }
  .bali-month { padding: 12px; }
}

/* ---------- Loader ---------- */
.loading-dates {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}
.loading-dates::after {
  content: "Загрузка...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #00d4b4;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: bold;
  z-index: 10;
}
