/* HOST MESSAGES CSS */

.messages-layout {
  display: flex;
  height: calc(100vh - 71px); /* minus navbar height */
  margin: -40px; /* offset the main-content padding */
  background: #fff;
}

/* Common Layout Elements */
.msg-sidebar-left {
  width: 350px;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  background: #fff;
  flex-shrink: 0;
}

.msg-center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8faf9;
  position: relative;
}

.msg-sidebar-right {
  width: 300px;
  border-left: 1px solid #eee;
  display: flex;
  flex-direction: column;
  background: #fff;
  flex-shrink: 0;
}

/* Custom Scrollbar */
.scrollable {
  overflow-y: auto;
}
.scrollable::-webkit-scrollbar { width: 6px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }
.scrollable::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* --- LEFT SIDEBAR (Inbox) --- */
.inbox-header {
  padding: 24px;
  border-bottom: 1px solid #eee;
}

.inbox-header h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.search-box {
  background: #f5f5f5;
  border-radius: 50px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.9rem;
}
.search-box input:focus {
  outline: none;
}
.search-box i {
  color: #888;
}

.filter-pills {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid #eee;
  overflow-x: auto;
}
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #f5f5f5;
  color: #666;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-pill:hover {
  background: #eee;
}
.filter-pill.active {
  background: var(--primary-green);
  color: #fff;
}

.convo-list {
  flex: 1;
}

.convo-item {
  padding: 16px 24px;
  border-bottom: 1px solid #f9f9f9;
  cursor: pointer;
  display: flex;
  gap: 16px;
  transition: background 0.2s;
  position: relative;
}
.convo-item:hover {
  background: #fcfcfc;
}
.convo-item.active {
  background: rgba(18, 94, 64, 0.05);
  border-left: 3px solid var(--primary-green);
}

.convo-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}
.convo-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #fff;
  border-radius: 50%;
}

.convo-content {
  flex: 1;
  min-width: 0;
}
.convo-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.convo-name {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo-time {
  font-size: 0.75rem;
  color: #888;
}
.convo-prop {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-gold);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo-msg {
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unread-badge {
  background: var(--primary-dark);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  position: absolute;
  right: 24px;
  bottom: 16px;
}
.convo-item.unread .convo-msg {
  font-weight: 700;
  color: var(--primary-dark);
}

/* --- CENTER PANEL (Chat) --- */
.chat-header {
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
  z-index: 10;
}
.chat-guest-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-guest-info img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-guest-name {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1.1rem;
  line-height: 1.2;
}
.chat-booking-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e5f6e5;
  color: #125e40;
}

.chat-actions .btn-icon {
  background: #f5f5f5;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--primary-dark);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-actions .btn-icon:hover {
  background: #e0e0e0;
}

.chat-area {
  flex: 1;
  padding: 24px;
  background: #f8faf9;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-date-divider {
  text-align: center;
  margin: 16px 0;
}
.msg-date-divider span {
  background: #e8e8e8;
  color: #666;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
}

/* Chat Bubbles */
.chat-bubble-container {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}
.chat-bubble-container.guest {
  align-self: flex-start;
}
.chat-bubble-container.host {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.guest .chat-bubble {
  background: #fff;
  color: #333;
  border-bottom-left-radius: 4px;
  border: 1px solid #eee;
}
.host .chat-bubble {
  background: var(--primary-dark);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-meta {
  font-size: 0.7rem;
  color: #888;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.host .msg-meta {
  justify-content: flex-end;
}
.read-status i {
  color: #10b981;
}

/* System Messages */
.system-msg {
  align-self: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  max-width: 80%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
  margin: 10px 0;
}
.system-msg i {
  color: var(--primary-gold);
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.system-msg .title {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.9rem;
}
.system-msg .desc {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

/* Message Input Area */
.chat-input-area {
  background: #fff;
  padding: 16px 24px;
  border-top: 1px solid #eee;
}
.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: #f5f5f5;
  border-radius: 20px;
  padding: 8px 16px;
}
.input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  max-height: 100px;
  min-height: 24px;
  font-size: 0.95rem;
  padding: 8px 0;
}
.input-wrapper textarea:focus {
  outline: none;
}
.input-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 4px;
}
.input-actions button {
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}
.input-actions button:hover {
  color: var(--primary-dark);
}
.btn-send {
  background: var(--primary-dark);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.btn-send:hover {
  background: var(--primary-green);
}
.btn-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* --- RIGHT SIDEBAR (Booking Details) --- */
.details-section {
  padding: 24px;
  border-bottom: 1px solid #eee;
}
.details-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.prop-preview {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 12px;
}
.prop-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.detail-label {
  color: #888;
}
.detail-val {
  font-weight: 600;
  color: var(--primary-dark);
  text-align: right;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.01);
}
.action-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-color: var(--primary-green);
  color: var(--primary-green);
}
.action-link.text-danger:hover {
  border-color: #dc3545;
  color: #dc3545 !important;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #f8faf9;
  text-align: center;
  padding: 40px;
}
.empty-state i {
  font-size: 5rem;
  color: #ddd;
  margin-bottom: 24px;
}
.empty-state h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--primary-dark);
}
.empty-state p {
  color: var(--text-muted);
}
