/* HIVESPLACE console shared styles */

/* Console wrapper */
.hp-console-wrapper {
  display: flex;
  min-height: calc(100vh - 72px);
}

.hp-console-content {
  flex: 1;
  padding: 1.5rem;
  overflow-x: hidden;
}

.hp-sidebar {
  width: 260px;
  min-height: calc(100vh - 72px);
  background-color: var(--hp-white);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem;
}

.hp-sidebar .nav-link {
  color: var(--hp-brown);
  border-radius: var(--bs-border-radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hp-sidebar .nav-link:hover,
.hp-sidebar .nav-link.active {
  background-color: var(--hp-cream);
  color: var(--hp-brown);
  font-weight: 600;
}

.hp-sidebar .nav-link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

/* Mobile console top tabs */
.hp-console-tabs {
  background-color: var(--hp-white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.hp-console-tabs .nav-link {
  color: var(--hp-brown);
  border-radius: 0;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1rem;
}

.hp-console-tabs .nav-link.active {
  background-color: transparent;
  color: var(--hp-yellow-dark);
  border-bottom-color: var(--hp-yellow-dark);
  font-weight: 600;
}

/* Console page header */
.hp-console-header {
  margin-bottom: 1.5rem;
}

.hp-console-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Status badges */
.badge-online {
  background-color: var(--hp-green);
  color: var(--hp-white);
}

.badge-pending {
  background-color: var(--hp-orange);
  color: var(--hp-white);
}

.badge-draft,
.badge-offline {
  background-color: var(--hp-gray);
  color: var(--hp-white);
}

.badge-rejected {
  background-color: var(--hp-red);
  color: var(--hp-white);
}

.badge-expired {
  background-color: #7048e8;
  color: var(--hp-white);
}

/* Auto-save indicator */
.hp-autosave-status {
  font-size: 0.875rem;
  color: var(--hp-brown-light);
  min-height: 1.25rem;
}

.hp-autosave-status.saving {
  color: var(--hp-blue);
}

.hp-autosave-status.saved {
  color: var(--hp-green);
}

.hp-autosave-status.error {
  color: var(--hp-red);
}

/* Message thread */
.hp-message-thread {
  max-height: 480px;
  overflow-y: auto;
  padding: 1rem;
  background-color: var(--hp-cream);
  border-radius: var(--bs-border-radius);
}

.hp-message-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.hp-message-row.own {
  flex-direction: row-reverse;
}

.hp-message-row.other {
  flex-direction: row;
}

.hp-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: var(--hp-white);
}

.hp-message-bubble {
  max-width: calc(80% - 40px);
  padding: 0.75rem 1rem;
  border-radius: var(--bs-border-radius);
  position: relative;
}

.hp-message-bubble.own {
  background-color: var(--hp-white);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.hp-message-bubble.other {
  background-color: var(--hp-yellow);
  color: var(--hp-brown);
}

.hp-message-meta {
  font-size: 0.75rem;
  color: var(--hp-brown-light);
  margin-top: 0.25rem;
}

.hp-message-read-status {
  margin-left: 0.25rem;
}

.hp-conversation-item {
  cursor: pointer;
  border-left: 3px solid transparent;
}

.hp-conversation-item:hover,
.hp-conversation-item.active {
  background-color: var(--hp-cream);
}

.hp-conversation-item.active {
  border-left-color: var(--hp-yellow-dark);
}

/* Listing cards in console */
.hp-console-listing-card .hp-card-img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--bs-border-radius-sm);
}

/* Avatar upload */
.hp-avatar-upload {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--hp-cream);
}

.hp-avatar-edit-btn {
  width: 36px;
  height: 36px;
}

.hp-reject-form {
  min-width: 260px;
}

/* Empty state */
.hp-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.hp-empty-state img {
  height: 80px;
  margin-bottom: 1rem;
}

/* Mobile responsive */
@media (max-width: 991.98px) {
  .hp-console-wrapper {
    flex-direction: column;
  }

  .hp-sidebar {
    display: none;
  }

  .hp-console-tabs {
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .hp-console-tabs .nav {
    flex-wrap: nowrap;
  }

  .hp-console-tabs .nav-item {
    flex: 0 0 auto;
  }

  .hp-console-tabs .nav-link {
    padding: 0.75rem 0.875rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .hp-console-tabs .nav-link i {
    display: inline-block;
    margin-right: 0.35rem;
  }

  .hp-console-content {
    width: 100%;
    min-width: 0;
    padding: 1rem;
  }

  .hp-message-thread {
    max-height: 50vh;
  }

  .hp-message-bubble {
    max-width: 85%;
  }

  .hp-console-header h1 {
    font-size: 1.25rem;
  }

  .hp-console-listing-card h5,
  .hp-conversation-item h6,
  .hp-conversation-item p {
    overflow-wrap: break-word;
  }

  .table-responsive td {
    white-space: nowrap;
  }

  .table-responsive td:first-child {
    white-space: normal;
    min-width: 140px;
  }
}

@media (min-width: 992px) {
  .hp-console-tabs {
    display: none;
  }
}
