/* =========================================================
   group_detail.css (SCOPED)
   Only applies inside .gh-group-page (group_detail.html)
   Merged from old groups.css + existing mobile overrides
   ========================================================= */

.gh-group-page .gh-group-card {
  padding: 0.8rem 0.9rem;
}

/* The whole group page takes the viewport height. */
.gh-group-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Bootstrap .row is already flex; here we make it fill the page and not grow with content. */
.gh-group-page .gh-group-row {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

.gh-group-page .gh-group-col {
  height: 80vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Main card in each column (channels / chat / members) */
.gh-group-page .gh-group-main-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Inner wrapper around chat area */
.gh-group-page .gh-group-chat-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#group-message-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.send-border {
  border-top-right-radius: 14px !important;
  border-bottom-right-radius: 14px !important;
}

/* =============================== */
/* FONT SIZE OVERRIDES: GROUP PAGE */
/* =============================== */

.gh-group-page .gh-group-chat-messages,
.gh-group-page .gh-group-chat-message,
.gh-group-page .gh-group-chat-meta,
.gh-group-page .gh-group-chat-author,
.gh-group-page .group-message-body {
  font-size: 0.9rem !important;
}

.gh-group-page .gh-group-members-list,
.gh-group-page .gh-group-member-name {
  font-size: 0.9rem !important;
}

/* === LEFT COLUMN: AVATAR + CHANNELS === */

.gh-group-page .gh-group-avatar-card {
  text-align: center;
  padding: 0.75rem 0.75rem 0.6rem;
  flex-shrink: 0;
}

.gh-group-page .gh-group-avatar-img {
  display: block;
  width: 100%;
  border-radius: 7%;
  object-fit: cover;
  margin: 0 auto;
}

.gh-group-page .gh-group-avatar-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.gh-group-page .gh-group-channels-card {
  font-size: 0.85rem;
  padding-top: 0.6rem;
  padding-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gh-group-page .gh-group-channels-header {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.25rem;
}

.gh-group-page .gh-group-channel-list {
  margin: 0;
  padding: 0.1rem 0 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.gh-group-page .gh-group-channel-item {
  margin-bottom: 0.15rem;
}

.gh-group-page .gh-group-channel-link {
  display: block;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  opacity: 0.9;
}

.gh-group-page .gh-group-channel-item.is-active .gh-group-channel-link {
  background: rgba(255, 223, 0, 0.16);
  opacity: 1;
}

.gh-inline-add-btn {
  color: #FFDF00;
  border-color: #FFDF00;
}

.gh-inline-add-btn:hover {
  color: #000000;
  border-color: #FFDF00;
  background-color:  #FFDF00;
}

.gh-group-page .gh-group-channel-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.gh-channel-delete-btn {
  color: rgba(190, 0, 0, 0.747) !important;
}

/* === MIDDLE COLUMN: CHAT === */

.gh-group-page .gh-group-chat-card {
  padding: 0.9rem 1.1rem 0.7rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gh-group-page .gh-group-chat-header {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.4rem;
}

.gh-group-page .gh-group-chat-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.gh-group-page .gh-group-chat-subtitle {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* SCROLLABLE MESSAGES AREA */
.gh-group-page .gh-group-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
  font-size: 0.85rem;
}

.gh-group-page .gh-group-chat-message {
  line-height: 1.3;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
  transition: background 0.16s ease, transform 0.16s ease;
}

.gh-group-page .gh-group-chat-message--self {
  background: rgba(255, 223, 0, 0.04);
}

.gh-group-page .gh-group-chat-message--self:hover {
  background: rgba(255, 223, 0, 0.07);
}

.gh-group-page .gh-group-chat-message:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
}

.gh-group-page .msg-timesince {
  color: #927f00;
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Avatar circle */
.gh-group-page .gh-chat-avatar {
  flex-shrink: 0;
}

.gh-group-page .gh-chat-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #111;
}

/* Bubble content */
.gh-group-page .gh-chat-bubble {
  flex: 1;
  min-width: 0;
}

.gh-group-page .gh-group-chat-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.9;
  font-size: 0.75rem;
  margin-bottom: 0.05rem;
}

.gh-group-page .gh-group-chat-author {
  color: #fff;
}

.gh-group-page .gh-group-chat-input {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.45rem;
  margin-top: 0.3rem;
}

/* === RIGHT COLUMN: MEMBERS === */

.gh-group-page .gh-group-members-card {
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gh-group-page .gh-group-members-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* === Member list layout === */

.gh-group-page .gh-member-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.2rem 0;
}

.gh-group-page .gh-member-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.gh-group-page .gh-member-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.gh-group-page .gh-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: #111;
  border: 1px solid rgba(255,255,255,0.18);
  display: block;
  object-position: center;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
}

/* Members list: avatar wrapper to position presence dot */
.gh-group-page .gh-member-avatar-wrap {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

/* Reuse the same pulse-dot base, but override placement for small member avatars */
.gh-group-page .gh-member-avatar-wrap .pulse-dot {
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-width: 2px;
}

.gh-group-page .gh-member-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.gh-group-page .gh-member-name-line {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.gh-group-page .gh-member-name {
  font-weight: 500;
}

.gh-group-page .gh-member-crown {
  font-size: 0.85rem;
  color: #FFDF00;
  text-shadow: 0 0 8px rgba(255,223,0,0.6);
  position: relative;
  top: -3px;
  display: inline-block;
}

.gh-group-page .gh-member-role-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
}

/* === MENTIONS (highlight in messages) === */

.gh-group-page .group-message-body .mention {
  font-weight: 600;
  padding: 0 2px;
  border-radius: 4px;
  line-height: 1.35;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Mention dropdown (autocomplete) */
.gh-group-page .gh-mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0.5rem;
  transform: translateY(-6px);
  width: 220px;
  background-color: #101015;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  z-index: 60;
  font-size: 0.8rem;
}

.gh-group-page .gh-mention-dropdown .mention-item {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.gh-group-page .gh-mention-dropdown .mention-item::before {
  content: "●";
  font-size: 0.55rem;
  opacity: 0.6;
  margin-top: 1px;
}

.gh-group-page .gh-mention-dropdown .mention-item:hover {
  background: linear-gradient(
    90deg,
    rgba(255, 223, 0, 0.15),
    rgba(255, 223, 0, 0.02)
  );
}

/* === INLINE CHANNEL CREATE === */

.gh-group-page .gh-inline-channel-create {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.gh-group-page .gh-inline-channel-input {
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  background: #0b0b0f;
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.gh-group-page .gh-inline-channel-input:focus {
  box-shadow: 0 0 0 2px rgba(255,223,0,0.3);
  border-color: rgba(255,223,0,0.5);
}

.gh-group-page .gh-inline-channel-form {
  margin: 0;
}

/* Drag & drop look */
.gh-group-page .gh-group-channel-item[draggable="true"] { cursor: grab; }
.gh-group-page .gh-group-channel-item.dragging { opacity: 0.6; }

/* Topic edit */
.gh-group-page .gh-topic-edit-box { margin-top: 0.35rem; }

.gh-group-page .gh-topic-input {
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  background: #0b0b0f;
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.gh-group-page .gh-topic-input:focus {
  box-shadow: 0 0 0 2px rgba(255,223,0,0.3);
  border-color: rgba(255,223,0,0.5);
}


/* =========================================================
   MOBILE OVERRIDES (your existing group_detail.css content)
   ========================================================= */

@media (max-width: 767.98px){

  .gh-group-page .gh-group-avatar-card{
    width: 250px;
    height: 250px;
    padding: 0.60rem 0.75rem 0.55rem;
    text-align: center;
    margin: 0 auto;
  }

  .gh-group-page .gh-group-avatar-inner{
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .gh-group-page .gh-group-avatar-img{
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }

  .gh-group-page .gh-group-avatar-name{
    margin-top: 0.45rem;
    font-size: 0.90rem;
    line-height: 1.15;
    text-align: center;
  }

  .gh-group-page .gh-group-members-strip-card{
    padding: 0.75rem 0.85rem 0.70rem;
  }

  .gh-group-page .gh-members-strip-header{
    padding-bottom: 0.35rem;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .gh-group-page .gh-members-strip{
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .gh-group-page .gh-members-strip::-webkit-scrollbar{
    height: 6px;
  }

  .gh-group-page .gh-members-strip::-webkit-scrollbar-thumb{
    background: rgba(255, 223, 0, 0.25);
    border-radius: 999px;
  }

  .gh-group-page .gh-members-strip-item{
    flex: 0 0 auto;
    width: 72px;
    text-align: center;
    scroll-snap-align: start;
  }

  .gh-group-page .gh-members-strip-avatar-wrap{
    position: relative;
    width: 54px;
    height: 54px;
    margin: 0 auto 0.35rem;
  }

  .gh-group-page .gh-members-strip-avatar{
    width: 54px;
    height: 54px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255,255,255,0.16);
    background: #111;
  }

  .gh-group-page .gh-members-strip-avatar-wrap .pulse-dot{
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-width: 2px;
  }

  .gh-group-page .gh-members-strip-username{
    font-size: 0.72rem;
    line-height: 1.10;
    opacity: 0.92;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* CHANNELS HEIGHT (detail page only) */
  .gh-group-page .gh-group-row > .gh-group-col:first-child{
    height: auto !important;
    display: block !important;
  }

  .gh-group-page .gh-group-channels-card{
    height: 220px !important;
    display: flex;
    flex-direction: column;
  }

  .gh-group-page .gh-group-channel-list{
    flex: 1;
    overflow-y: auto;
  }
}
