/* ============================================================
   messages.css - Messages Inbox Page (/messages)
   Namespace prefix: boh-messages
   ============================================================ */

.boh-messages {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background:
    radial-gradient(circle at 100% 0%, rgba(160, 193, 180, 0.18), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--boh-color-bg) 93%, white) 0%, color-mix(in srgb, var(--boh-color-bg) 97%, white) 100%);
}

.boh-messages__header {
  padding: 2.4rem var(--boh-space-screen) 0.8rem;
  flex-shrink: 0;
  background-color: transparent;
  position: relative;
  z-index: 10;
}

.boh-messages__header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.boh-messages__header-back {
  padding: 0.5rem;
  margin-left: -0.5rem;
  color: var(--boh-color-primary);
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.boh-messages__header-back:active {
  background: rgba(38, 86, 77, 0.08);
}

.boh-messages__header-back svg {
  width: 1.5rem;
  height: 1.5rem;
}

.boh-messages__header-title {
  margin: 0;
  font-family: var(--boh-font-sans);
  font-size: var(--boh-font-size-navtitle);
  font-weight: var(--boh-font-weight-700);
  color: var(--boh-color-primary);
}

.boh-messages__header-subtitle {
  margin: 0.45rem 0 0;
  text-align: center;
  color: color-mix(in srgb, var(--boh-color-muted) 74%, transparent);
  font-size: 13px;
  line-height: 1.35;
}

.boh-messages__main {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem var(--boh-space-screen) 1.3rem;
}

.boh-messages__main::-webkit-scrollbar {
  display: none;
}

.boh-messages__main {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.boh-messages__hotel-switcher,
.boh-messages__list,
.boh-messages__loading,
.boh-messages__empty {
  width: min(100%, var(--boh-container-max-width));
  margin-left: auto;
  margin-right: auto;
}

.boh-messages__hotel-switcher {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(38, 86, 77, 0.12);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(16, 46, 39, 0.08);
  padding: 0.75rem;
  margin-bottom: 0.85rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.boh-messages__hotel-label {
  display: block;
  margin-bottom: 0.5rem;
  color: color-mix(in srgb, var(--boh-color-muted) 78%, transparent);
  font-size: 11px;
  line-height: 1;
  font-weight: var(--boh-font-weight-700);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boh-messages__hotel-trigger {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(38, 86, 77, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 248, 247, 0.95) 100%);
  color: var(--boh-color-primary);
  padding: 0.58rem 0.74rem;
  font-size: 14px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.boh-messages__hotel-trigger:active {
  border-color: rgba(38, 86, 77, 0.34);
}

.boh-messages__hotel-trigger-arrow {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--boh-color-muted) 76%, transparent);
  transition: transform 0.2s ease;
}

.boh-messages__hotel-trigger-arrow svg {
  width: 100%;
  height: 100%;
}

.boh-messages__hotel-trigger.is-open .boh-messages__hotel-trigger-arrow {
  transform: rotate(180deg);
}

.boh-messages__hotel-list {
  margin-top: 0.45rem;
  border: 1px solid rgba(38, 86, 77, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  overflow: hidden;
}

.boh-messages__hotel-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(38, 86, 77, 0.1);
  background: transparent;
  color: var(--boh-color-primary);
  padding: 0.62rem 0.74rem;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.boh-messages__hotel-item:last-child {
  border-bottom: 0;
}

.boh-messages__hotel-item.is-active {
  background: color-mix(in srgb, var(--boh-color-primary) 12%, white);
  font-weight: var(--boh-font-weight-700);
}

.boh-messages__hotel-item:active {
  background: color-mix(in srgb, var(--boh-color-primary) 16%, white);
}

.boh-messages__list {
  display: grid;
  gap: 0.72rem;
}

.boh-messages__chat-btn {
  width: 100%;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  border: 1px solid rgba(38, 86, 77, 0.12);
  padding: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  box-shadow: 0 8px 20px rgba(16, 46, 39, 0.06);
  text-align: left;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.boh-messages__chat-btn.is-unread {
  border-color: rgba(38, 86, 77, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 249, 0.98) 100%);
}

.boh-messages__chat-btn:active {
  transform: scale(0.985);
  box-shadow: 0 6px 16px rgba(16, 46, 39, 0.06);
}

.boh-messages__avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.boh-messages__avatar-box {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2f6d62 0%, #225449 100%);
}

.boh-messages__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.boh-messages__avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8f4ec;
  font-weight: var(--boh-font-weight-700);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.boh-messages__badge {
  position: absolute;
  top: -0.22rem;
  right: -0.16rem;
  min-width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background-color: var(--boh-color-primary);
  border: 2px solid rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
}

.boh-messages__badge-text {
  color: var(--boh-color-surface);
  font-size: 10px;
  line-height: 1;
  font-weight: var(--boh-font-weight-700);
}

.boh-messages__status-dot {
  position: absolute;
  right: 0.05rem;
  bottom: 0.05rem;
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  background-color: #31a37a;
  border: 2px solid rgba(255, 255, 255, 0.95);
}

.boh-messages__info {
  flex: 1;
  min-width: 0;
}

.boh-messages__chat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.14rem;
}

.boh-messages__chat-name {
  color: var(--boh-color-primary);
  font-weight: var(--boh-font-weight-700);
  font-size: 16px;
  margin: 0;
  line-height: 1.22;
}

.boh-messages__chat-time {
  color: color-mix(in srgb, var(--boh-color-muted) 72%, transparent);
  font-size: 11px;
  font-weight: var(--boh-font-weight-600);
  flex-shrink: 0;
}

.boh-messages__chat-subtitle {
  color: color-mix(in srgb, var(--boh-color-primary) 88%, transparent);
  font-size: 13px;
  margin: 0 0 0.22rem;
  line-height: 1.25;
}

.boh-messages__chat-msg {
  color: color-mix(in srgb, var(--boh-color-muted) 84%, transparent);
  font-size: 13px;
  margin: 0;
  line-height: 1.28;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boh-messages__chat-go {
  color: color-mix(in srgb, var(--boh-color-muted) 70%, transparent);
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  flex-shrink: 0;
  transform: translateY(-1px);
}

.boh-messages__loading {
  margin-top: 0.24rem;
}

.boh-messages__loading-label {
  margin: 0 0 0.62rem;
  color: color-mix(in srgb, var(--boh-color-muted) 78%, transparent);
  font-size: 12px;
  line-height: 1.2;
  font-weight: var(--boh-font-weight-600);
}

.boh-messages__loading-skeleton {
  display: grid;
  gap: 0.68rem;
}

.boh-messages__skeleton-card {
  height: 84px;
  border-radius: 18px;
  border: 1px solid rgba(38, 86, 77, 0.09);
  background:
    linear-gradient(90deg, rgba(248, 251, 250, 0.6) 0%, rgba(255, 255, 255, 0.94) 42%, rgba(247, 251, 249, 0.62) 100%),
    rgba(255, 255, 255, 0.88);
  position: relative;
  overflow: hidden;
}

.boh-messages__skeleton-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 36%, rgba(255, 255, 255, 0.72) 50%, rgba(255, 255, 255, 0) 64%);
  transform: translateX(-120%);
  animation: boh-messages-skeleton-shimmer 1.25s linear infinite;
}

.boh-messages__empty {
  margin-top: 0.24rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(38, 86, 77, 0.12);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(16, 46, 39, 0.05);
  padding: 1.35rem 1rem;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.4rem;
}

.boh-messages__empty-icon {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--boh-color-primary) 10%, white);
  color: var(--boh-color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.boh-messages__empty-icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

.boh-messages__empty-title {
  margin: 0.12rem 0 0;
  color: var(--boh-color-primary);
  font-family: var(--boh-font-serif);
  font-size: 23px;
  font-weight: var(--boh-font-weight-600);
  line-height: 1.15;
}

.boh-messages__empty-message {
  margin: 0;
  color: color-mix(in srgb, var(--boh-color-muted) 82%, transparent);
  font-size: 13px;
  line-height: 1.35;
}

.boh-messages__start-btn {
  margin-top: 0.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--boh-color-primary);
  color: var(--boh-color-surface);
  font-size: 12px;
  font-weight: var(--boh-font-weight-700);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.62rem 0.94rem;
  cursor: pointer;
}

.boh-messages__start-btn:active {
  transform: scale(0.98);
}

@keyframes boh-messages-skeleton-shimmer {
  to {
    transform: translateX(120%);
  }
}

@media (max-width: 360px) {
  .boh-messages__header {
    padding-top: 2.2rem;
  }

  .boh-messages__chat-btn {
    padding: 0.78rem;
    gap: 0.62rem;
  }

  .boh-messages__chat-name {
    font-size: 15px;
  }

  .boh-messages__chat-subtitle,
  .boh-messages__chat-msg {
    font-size: 12px;
  }
}
