/* 
 * File: reservation.css
 * Author: SEHS4517 - Group 102 - Group No.1 Team
 * Description: CSS for the reservation page
 */

/* --- PAGE SECTIONS --- */
.section-reserve-form {
  background-color: #ffffff;
  padding: 20px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
}

.section-select-room {
  background-color: #D5EAD5;
  padding: 40px 20px;
}

.section-submit-reservation {
  background-color: #fff;
  padding: 10px 20px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

/* --- RESERVATION FORM --- */
.reservation-form {
  color: #000;
  font-size: 14px;
  background-color: #ffffff;
  padding: 20px;
  border-radius: 10px;
  position: relative;
  width: 100%;
  margin: 0 auto;
  animation: breathing-shadow 3s ease-in-out infinite;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.section-reserve-form form {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.reserve-form-fields {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-right: 40px;
}
.reserve-form-fields .form-group {
  width: 100%;
}

.reserve-form-buttons {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.reserve-form-buttons .button {
  width: 100%;
}
.reserve-form-buttons .button svg {
  width: 20px;
  height: 20px;
  fill: var(--accent-color);
}
.reserve-form-buttons .search-button {
  background-color: var(--brand-color-super-light);
  border: 1px solid var(--brand-color-super-light);
  color: #fff;
}
.reserve-form-buttons .search-button svg {
  fill: #fff;
}
.reserve-form-buttons .reset-button {
  background-color: #fafafa;
  border: 1px solid #fafafa;
  color: #666;
}
.reserve-form-buttons .reset-button:hover {
  background-color: #666;
  border: 1px solid #666;
  color: #fff;
}
.reserve-form-buttons .reset-button svg {
  fill: #333;
}

/* Reservation form special action buttons (sticky at bottom of form) */
.reservation-form-bottom-buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  padding: 0 20px;
}
.reservation-form-submit {
  background-color: var(--brand-color-super-light);
  color: #fff;
  border: 1px solid var(--brand-color-super-light);
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 10px;
  max-width: 300px;
}
.reservation-form-submit:hover {
  color: var(--brand-color);
}
.reservation-form-reset {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 40px;
  height: 40px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
}
.reservation-form-reset svg {
  width: 25px;
  height: 25px;
  fill: var(--brand-color-super-light);
}
.reservation-form-reset:hover {
  background-color: #000;
  border: 1px solid #000;
}
.reservation-form-reset:hover svg {
  fill: var(--accent-color);
}

/* --- SUMMARY/HIGHLIGHT --- */
#reservation-search-summary {
  color: var(--text-color);
  font-size: 14px;
  margin-bottom: 20px;
  border-left: 5px solid var(--brand-color-super-light);
  background-color: #fff;
  padding: 15px 20px;
}

/* --- ROOMS LIST --- */
.reservation-rooms-wrapper {
  display: flex;
}

.reservation-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.reservation-rooms-list .reservation-room-item {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.reservation-rooms-list .reservation-room-item.selected {
  outline: 5px solid var(--brand-color-super-light);
}
.reservation-rooms-list .reservation-room-item.selected .room-select-wrapper .room-deselect-button {
  display: block;
}
.reservation-rooms-list .reservation-room-item.selected .room-select-wrapper .room-select-button {
  display: none;
}

/* ROOM SLIDER */
.reservation-rooms-list .reservation-room-item .reservation-room-slider {
  width: 40%;
  height: 400px;
}
.reservation-rooms-list .reservation-room-item .reservation-room-slider .slider-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* ROOM CONTENT */
.reservation-rooms-list .reservation-room-item .reservation-room-content {
  width: 60%;
  padding: 20px;
  padding-bottom: 100px;
  background-color: #fff;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  font-size: 16px;
}

.reservation-rooms-list .reservation-room-item .reservation-room-content .room-title {
  font-size: 30px;
  font-weight: 600;
  font-family: 'Oranienbaum', sans-serif;
  color: var(--brand-color);
}
.reservation-rooms-list .reservation-room-item .reservation-room-content .room-offer {
  font-size: 14px;
  border-left: 5px solid var(--accent-color);
  background-color: #fafafa;
  color: var(--text-color);
  padding: 10px 15px;
}

/* ROOM FACILITIES */
.reservation-rooms-list .reservation-room-item .reservation-room-content .room-facilities {
  display: block;
}
.reservation-rooms-list .reservation-room-item .reservation-room-content .room-facilities .facilities-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.reservation-rooms-list .reservation-room-item .reservation-room-content .room-facilities .facilities-tags .facility-tag {
  background-color: var(--accent-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
}

/* ROOM PRICE/SELECT SECTION */
.room-select-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 20px;
  width: 100%;
  border-top: 1px solid var(--border-color);
}
.room-select-wrapper .room-total-price {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  margin-right: auto;
  display: flex;
}
.room-select-wrapper .room-total-price .nights-count {
  margin-left: 5px;
}
.room-select-wrapper .button {
  background-color: var(--brand-color-super-light);
  font-size: 16px;
  padding: 10px 20px;
  border: 1px solid var(--brand-color-super-light);
  color: #fff;
}
.room-select-wrapper .button.selected {
  background-color: #666;
  border: 1px solid #666;
  color: #fff;
}
.room-select-wrapper .room-deselect-button {
  display: none;
  background-color: #666;
  border: 1px solid #666;
  color: #fff;
}

/* --- SUBMIT/BOOKING SUMMARY --- */
.submit-reservation-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-color);
  font-size: 14px;
}
.submit-reservation-wrapper .submit-reservation-items {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.submit-reservation-wrapper .submit-reservation-items .submit-reservation-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 20px;
  width: auto;
  border-right: 1px solid var(--border-color);
}
.submit-reservation-wrapper .submit-reservation-items .submit-reservation-item:last-child {
  border-right: none;
}
.submit-reservation-wrapper .submit-reservation-items .submit-reservation-item .label {
  color: #999;
  font-size: 11px;
}
.submit-reservation-wrapper .submit-reservation-items .submit-reservation-item .value {
  font-weight: 600;
  color: #000;
  display: flex;
  align-items: center;
  gap: 5px;
}
.submit-reservation-wrapper .submit-reservation-items .submit-reservation-item .value svg {
  width: 14px;
  height: 14px;
  transform: rotate(180deg);
}
.submit-reservation-wrapper .submit-reservation-button {
  padding: 12px 30px;
  font-size: 15px;
}
.submit-reservation-button-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  padding: 10px;
  gap: 20px;
}
.submit-reservation-button-wrapper .cancel-button {
  border: 1px solid #666;
  color: #666;
}
.submit-reservation-button-wrapper .cancel-button:hover {
  background-color: #666;
  border: 1px solid #666;
  color: #fff;
}

/* --- SUBMIT RESERVATION MOBILE TOGGLE & OVERLAY --- */
.submit-reservation-mobile-toggle {
  display: none;
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  align-items: center;
  gap: 8px;
  z-index: 101;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}
.submit-reservation-mobile-toggle .toggle-icon {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}
.submit-reservation-mobile-toggle .toggle-icon svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  transform: rotate(90deg);
}
.submit-reservation-mobile-toggle:hover {
  background-color: var(--accent-color);
}
.section-submit-reservation.collapsed .submit-reservation-mobile-toggle .toggle-icon svg {
  transform: rotate(-90deg);
}
.section-submit-reservation.collapsed .submit-reservation-mobile-toggle .toggle-text::before {
  content: 'Hide Summary';
}
.submit-reservation-mobile-toggle .toggle-text::before {
  content: 'Show Summary';
}

/* Overlay */
.submit-reservation-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.submit-reservation-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* --- LOADING STATES --- */
.skeleton-pulse {
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.search-summary-loading {
  height: 50px;
  width: 100%;
  border-radius: 4px;
}

/* Room list skeleton loading */
.reservation-rooms-loading {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.room-loading-item {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.room-loading-image {
  width: 40%;
  height: 300px;
  min-height: 300px;
}
.room-loading-content {
  width: 60%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.room-loading-title {
  height: 32px;
  width: 60%;
}
.room-loading-text {
  height: 16px;
  width: 100%;
}
.room-loading-tags {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.room-loading-tag {
  height: 28px;
  width: 80px;
  border-radius: 5px;
}
.room-loading-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #eee;
}
.room-loading-price {
  height: 24px;
  width: 120px;
}
.room-loading-button {
  height: 40px;
  width: 100px;
  border-radius: 5px;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
  /* Form layout and rooms list */
  .reservation-form {
    flex-direction: column;
  }
  .section-reserve-form form {
    flex-direction: column;
  }
  .reserve-form-buttons {
    flex-direction: column;
    width: 100%;
    margin-top: 20px;
  }
  .reserve-form-fields {
    flex-direction: column;
    padding-right: 0;
  }
  .reservation-room-item {
    flex-direction: column;
  }
  .reservation-rooms-list .reservation-room-item .reservation-room-slider {
    width: 100%;
    height: 250px;
  }
  .reservation-rooms-list .reservation-room-item .reservation-room-content {
    width: 100%;
  }

  /* Summary and booking section */
  .submit-reservation-wrapper {
    flex-direction: column;
  }
  .submit-reservation-wrapper .submit-reservation-items {
    padding: 10px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .submit-reservation-wrapper .submit-reservation-items .submit-reservation-item:first-child {
    grid-column: span 2;
    border-right: none;
  }
  .submit-reservation-wrapper .submit-reservation-items .submit-reservation-item {
    padding: 0;
  }
  .submit-reservation-wrapper .submit-reservation-items .submit-reservation-item:nth-child(3) {
    border-right: none;
  }

  /* Mobile-specific toggles for summary */
  .submit-reservation-mobile-toggle {
    display: flex;
  }
  .section-submit-reservation.collapsed {
    transform: translateY(0);
  }
  .section-submit-reservation {
    max-height: 500px;
    transition: all 0.3s ease-in-out;
  }
  .section-submit-reservation:not(.collapsed) {
    transform: translateY(100%);
  }

  /* Loading states - mobile */
  .room-loading-item {
    flex-direction: column;
  }
  .room-loading-image {
    width: 100%;
    height: 200px;
    min-height: 200px;
  }
  .room-loading-content {
    width: 100%;
  }
}