/* ============================================
   Profile & Bookings Pages
   ============================================ */

.profile-page {
  padding: 2rem 0 4rem;
}

.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.profile__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.profile__subtitle {
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

/* Profile Form */
.profile-form {
  background: var(--color-bg-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.profile-form__section {
  margin-bottom: 2rem;
}

.profile-form__section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.profile-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .profile-form__row {
    grid-template-columns: 1fr;
  }
}

/* Bookings List */
.bookings-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.bookings__filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.bookings__filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-white);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.bookings__filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.bookings__filter-btn.is-active {
  background: var(--color-primary);
  color: var(--color-bg-white);
  border-color: var(--color-primary);
}

.booking-card {
  background: var(--color-bg-white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
  transition: box-shadow 0.2s;
}

.booking-card:hover {
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
}

.booking-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.booking-card__homestay {
  font-size: 1.125rem;
  font-weight: 600;
}

.booking-card__status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.booking-card__status--PENDING {
  background: #fff3cd;
  color: #856404;
}

.booking-card__status--CONFIRMED {
  background: #d4edda;
  color: #155724;
}

.booking-card__status--COMPLETED {
  background: #d1ecf1;
  color: #0c5460;
}

.booking-card__status--CANCELLED {
  background: #f8d7da;
  color: #721c24;
}

.booking-card__details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.booking-card__detail-label {
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.booking-card__detail-value {
  font-weight: 500;
  margin-top: 0.125rem;
}

.booking-card__actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

/* Apply Page */
.apply-page {
  padding: 2rem 0 4rem;
}

.apply-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.apply__homestay-info {
  background: var(--color-bg-white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.apply__homestay-image {
  width: 120px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.apply__homestay-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.apply__homestay-location {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.apply__homestay-price {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 0.25rem;
}

.apply-form {
  background: var(--color-bg-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.companion-entry {
  background: var(--color-bg);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.companion-entry__remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--color-danger, #dc3545);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.add-companion-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  background: none;
  border: 1px dashed var(--color-primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.add-companion-btn:hover {
  background: rgba(var(--color-primary-rgb, 0,123,255), 0.05);
}

/* Booking Summary */
.apply__summary {
  background: var(--color-bg);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.apply__summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
}

.apply__summary-row--total {
  font-weight: 700;
  font-size: 1.125rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

/* Empty State */
.bookings__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-light);
}

.bookings__empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.profile-tabs__btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.profile-tabs__btn:hover {
  color: var(--color-primary);
}

.profile-tabs__btn.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.profile-tab-panel {
  display: none;
}

.profile-tab-panel.is-active {
  display: block;
}

/* Inquiry Card */
.inquiry-card {
  background: var(--color-bg-white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.inquiry-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.inquiry-card__date {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

.inquiry-card__status {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.inquiry-card__status--waiting {
  background: #fff3cd;
  color: #856404;
}

.inquiry-card__status--replied {
  background: #d4edda;
  color: #155724;
}

.inquiry-card__message {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.inquiry-card__reply {
  background: #f0f9f4;
  border-left: 3px solid var(--color-primary);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  margin-top: 0.75rem;
}

.inquiry-card__reply-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.inquiry-card__reply-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.inquiry-card__reply-date {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 0.5rem;
}

/* Loading */
.profile-loading,
.bookings-loading {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-light);
}

@media (max-width: 600px) {
  .apply__homestay-info {
    flex-direction: column;
    text-align: center;
  }

  .booking-card__header {
    flex-direction: column;
    gap: 0.5rem;
  }
}
