/* ==========================================================
   ASK THE TEAM — private support chats with Owner / Admins
   Matches the existing AKINF2P dark + matte gold theme.
   ========================================================== */

.att-page {
  min-height: 100vh;
  padding: 110px 16px 60px;
  background:
    radial-gradient(1000px 500px at 50% -200px, rgba(134, 110, 67, 0.12), transparent 70%),
    #0c0c0c;
}

.att-container {
  max-width: 860px;
  margin: 0 auto;
}

/* ── Heading ─────────────────────────────────────────────── */

.att-heading {
  text-align: center;
  margin-bottom: 34px;
}

.att-heading h1 {
  font-family: "Cinzel", serif;
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
}

.att-heading p {
  color: #94a3b8;
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Team directory cards ────────────────────────────────── */

.att-team-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.att-team-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(145deg, #131313, #191919);
  border: 1px solid rgba(134, 110, 67, 0.35);
  border-radius: 16px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.att-team-card:hover {
  border-color: rgba(134, 110, 67, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.att-team-card.is-owner {
  border-color: rgba(134, 110, 67, 0.55);
  background: linear-gradient(145deg, #161310, #1c1812);
}

.att-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(134, 110, 67, 0.5);
  background: #1e1b16;
  flex-shrink: 0;
}

.att-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(134, 110, 67, 0.5);
  background: rgba(134, 110, 67, 0.15);
  color: var(--gold);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.att-team-info {
  flex: 1;
  min-width: 0;
}

.att-team-name {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-team-card.is-owner .att-team-name {
  color: var(--gold);
}

/* "Owner" subtitle line on the owner card */
.att-team-subrole {
  display: block;
  color: var(--gold);
  font-size: 0.98rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.att-team-role {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #866e43;
  background: rgba(134, 110, 67, 0.16);
  border: 1px solid rgba(134, 110, 67, 0.4);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.att-team-role.role-owner {
  color: var(--gold);
  background: rgba(134, 110, 67, 0.14);
  border-color: rgba(134, 110, 67, 0.5);
}

.att-team-role.role-admin {
  color: #f0a44b;
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.45);
}

/* Custom uploaded badge image (owner dashboard) */
.att-team-badge {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  align-self: center;
  margin-left: 8px;
  filter: drop-shadow(0 0 5px rgba(217, 119, 6, 0.45));
}

.att-team-desc {
  display: block;
  color: #d6d3cd;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 34ch;
}

/* Online status row under the description */
.att-online {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: #4ade80;
  font-size: 0.9rem;
  font-weight: 600;
}

.att-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  flex-shrink: 0;
}

.att-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 14px;
  border: 1px solid rgba(134, 110, 67, 0.55);
  background: transparent;
  color: var(--gold);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  font-family: inherit;
}

.att-chat-btn:hover {
  background: linear-gradient(135deg, #866e43, #6e5a35);
  color: #fff;
  box-shadow: 0 4px 16px rgba(134, 110, 67, 0.4);
}

.att-chat-caret {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* ── Recent conversations / inbox ────────────────────────── */

.att-recent {
  margin-top: 40px;
}

.att-recent h2 {
  font-family: "Cinzel", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

.att-conv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.att-conv-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: #131313;
  border: 1px solid rgba(134, 110, 67, 0.25);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: inherit;
  font-family: inherit;
}

.att-conv-item:hover {
  border-color: rgba(134, 110, 67, 0.55);
  background: #171717;
}

.att-conv-item.is-unread {
  border-color: rgba(134, 110, 67, 0.6);
}

.att-conv-main {
  flex: 1;
  min-width: 0;
}

.att-conv-title {
  display: block;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-conv-preview {
  display: block;
  color: #94a3b8;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-conv-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.att-conv-time {
  color: #64748b;
  font-size: 0.75rem;
  white-space: nowrap;
}

.att-unread-dot {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--gold);
  color: #0c0c0c;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Owner monitoring inbox: "User — Admin" two-line title */
.att-conv-pair {
  display: block;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-conv-pair .pair-admin {
  color: var(--gold);
}

/* ── Chat view ───────────────────────────────────────────── */

.att-chat-card {
  background: linear-gradient(145deg, #121212, #171717);
  border: 1px solid rgba(134, 110, 67, 0.35);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 460px;
}

.att-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(134, 110, 67, 0.08);
  border-bottom: 1px solid rgba(134, 110, 67, 0.3);
}

.att-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(134, 110, 67, 0.4);
  background: rgba(134, 110, 67, 0.12);
  color: var(--gold);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.att-back-btn:hover {
  background: rgba(134, 110, 67, 0.3);
}

.att-chat-peer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.att-chat-peer .att-avatar,
.att-chat-peer .att-avatar-fallback {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.att-chat-peer-name {
  display: block;
  font-weight: 800;
  color: #fff;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-chat-peer-role {
  display: block;
  font-size: 0.75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.att-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(134, 110, 67, 0.2);
  border: 1px solid rgba(134, 110, 67, 0.5);
  color: var(--gold);
  flex-shrink: 0;
}

/* ── Messages ────────────────────────────────────────────── */

.att-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.att-msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.93rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Profile line above each message: avatar + name + role badge */
.att-msg-profile {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.att-msg-profile-me {
  justify-content: flex-end;
}

.att-msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(134, 110, 67, 0.4);
}

.att-msg-name {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #cbb98f;
}

.att-msg-profile-me .att-msg-name {
  color: #e6d3a3;
}

.att-msg-role {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.3;
}

.att-role-owner {
  background: linear-gradient(135deg, #a8895a, #866e43);
  color: #fff;
}

.att-role-admin {
  background: rgba(134, 110, 67, 0.25);
  border: 1px solid rgba(203, 185, 143, 0.45);
  color: #e6d3a3;
}

.att-role-member {
  background: rgba(255, 255, 255, 0.07);
  color: #9d968a;
}

.att-role-vip {
  background: rgba(168, 137, 90, 0.2);
  border: 1px solid rgba(203, 185, 143, 0.4);
  color: #e6d3a3;
}

.att-msg.them {
  align-self: flex-start;
  background: #1e1e1e;
  border: 1px solid rgba(134, 110, 67, 0.22);
  border-bottom-left-radius: 6px;
  color: #e2e8f0;
}

.att-msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, #866e43, #6e5a35);
  border-bottom-right-radius: 6px;
  color: #fff;
}

.att-msg .att-msg-time {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  opacity: 0.65;
  text-align: right;
}

/* Fallback avatar circle inside the profile line */
.att-avatar-fallback.att-msg-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  color: #cbb98f;
  background: rgba(134, 110, 67, 0.2);
}

.att-msg.sender-tag {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.85;
}

/* Inline message editing (sender only) */
.att-msg-edit-btn {
  margin-left: 6px;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  transition: opacity 0.2s;
}

.att-msg-edit-btn:hover {
  opacity: 1;
}

.att-msg-edited {
  margin-left: 4px;
  font-style: italic;
}

.att-edit-box {
  margin: 4px 0 2px;
}

.att-edit-textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(134, 110, 67, 0.5);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  font-family: inherit;
  font-size: 0.93rem;
  line-height: 1.5;
  outline: none;
}

.att-edit-textarea:focus {
  border-color: rgba(203, 185, 143, 0.8);
}

.att-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.att-edit-save,
.att-edit-cancel {
  padding: 5px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  font-family: inherit;
}

.att-edit-save {
  background: rgba(255, 255, 255, 0.92);
  color: #6e5a35;
}

.att-edit-cancel {
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  opacity: 0.85;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Owner monitoring an admin channel: colour-code speakers */
.att-msg.them .sender-tag { color: var(--gold); }

.att-day-divider {
  align-self: center;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 8px 0 2px;
}

.att-empty-chat {
  margin: auto;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.att-empty-chat i {
  display: block;
  font-size: 1.8rem;
  color: #866e43;
  margin-bottom: 10px;
}

/* ── Input bar ───────────────────────────────────────────── */

.att-input-bar {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(134, 110, 67, 0.3);
  background: rgba(134, 110, 67, 0.05);
}

.att-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(134, 110, 67, 0.35);
  background: #0f0f0f;
  color: #fff;
  font-size: 0.93rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.att-input:focus {
  border-color: rgba(134, 110, 67, 0.65);
}

.att-input::placeholder {
  color: #64748b;
}

.att-send-btn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #866e43, #6e5a35);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.att-send-btn:hover {
  box-shadow: 0 4px 16px rgba(134, 110, 67, 0.45);
}

.att-send-btn:active {
  transform: scale(0.95);
}

.att-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Owner inbox tabs (My chats / Monitor team) ─────────── */

.att-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.att-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 10px;
  border-radius: 12px;
  border: 1px solid rgba(134, 110, 67, 0.35);
  background: transparent;
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.att-tab:hover {
  color: var(--gold);
  border-color: rgba(134, 110, 67, 0.5);
}

.att-tab.active {
  background: linear-gradient(135deg, #866e43, #6e5a35);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(134, 110, 67, 0.35);
}

/* ── Loading / error states ──────────────────────────────── */

.att-loading {
  text-align: center;
  color: #64748b;
  padding: 26px 0;
  font-size: 0.9rem;
}

.att-error {
  text-align: center;
  color: #ff6b6b;
  padding: 18px;
  font-size: 0.88rem;
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .att-page {
    padding: 100px 12px 90px;
  }

  .att-team-card {
    flex-wrap: wrap;
    padding: 16px;
  }

  .att-team-info {
    flex: 1 1 55%;
  }

  .att-team-name {
    white-space: normal;
    font-size: 1.1rem;
  }

  .att-team-desc {
    max-width: none;
    font-size: 0.88rem;
  }

  .att-chat-btn {
    margin-left: 74px;
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .att-chat-card {
    height: calc(100vh - 230px);
  }

  .att-msg {
    max-width: 88%;
  }
}
