/* FILE: public/assets/css/my-chats.css */

html,
body {
  height: 100%;
}

body {
  overflow-x: hidden;
}

.my-chats-page {
  min-height: calc(100vh - 80px);
  background: #f8fafc;
}

.my-chats-section {
  padding: 24px 0 36px;
}

.my-chats-layout {
  height: calc(100vh - 170px);
  min-height: 620px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.my-chats-sidebar {
  min-width: 0;
  min-height: 0;
  padding: 22px 18px;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.my-chats-sidebar__head {
  margin-bottom: 18px;
}

.my-chats-sidebar__head h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
}

.my-chats-sidebar__head p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.55;
}

.my-chats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.my-chats-tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    transform 0.12s ease;
}

.my-chats-tab:hover {
  background: #f9fafb;
  transform: translateY(-1px);
}

.my-chats-tab.is-active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.my-chats-tab__count {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  color: inherit;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}

.my-chats-tab.is-active .my-chats-tab__count {
  background: rgba(255, 255, 255, 0.18);
}

.my-chats-info {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #ffffff;
}

.my-chats-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 5px 11px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  font-size: 12px;
  font-weight: 800;
}

.my-chats-title {
  margin: 0;
  color: #111827;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.my-chats-subtitle {
  margin: 12px 0 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.65;
}

.my-chats-profile-link {
  width: 100%;
  margin-top: 16px;
}

.my-chat {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
}

.my-chat__head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  z-index: 2;
}

.my-chat__head h2 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
}

.my-chat__head p {
  margin: 5px 0 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.my-chat__vk {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid #111827;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.my-chat__vk:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.my-chat__messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 24px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.my-chat__msg {
  max-width: min(78%, 680px);
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.my-chat__msg--system,
.my-chat__msg--other {
  align-self: flex-start;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 8px;
}

.my-chat__msg--user {
  align-self: flex-end;
  background: #111827;
  color: #ffffff;
  border: 1px solid #111827;
  border-bottom-right-radius: 8px;
}

.my-chat__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.78;
  font-weight: 800;
}

.my-chat__meta time {
  flex: 0 0 auto;
  font-weight: 600;
  opacity: 0.76;
}

.my-chat__text {
  white-space: normal;
}

.my-chat__footer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 16px 18px 18px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  z-index: 2;
}

.my-chat__attach,
.my-chat__send {
  width: 44px;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    transform 0.12s ease;
}

.my-chat__attach:hover,
.my-chat__send:hover {
  background: #f9fafb;
  transform: translateY(-1px);
}

.my-chat__send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.my-chat__input {
  flex: 1 1 auto;
  min-height: 48px;
  max-height: 120px;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  line-height: 1.55;
  resize: none;
  outline: none;
  overflow-y: auto;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.my-chat__input::placeholder {
  color: #9ca3af;
}

.my-chat__input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}


.my-chats-vk {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #ffffff;
}

.my-chats-vk__label {
  margin-bottom: 7px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.my-chats-vk__title {
  color: #111827;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 900;
}

.my-chats-vk__qr-link {
  width: 168px;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px auto 0;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #f9fafb;
  text-decoration: none;
}

.my-chats-vk__qr {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.my-chats-vk__hint {
  margin: 12px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 960px) {
  .my-chats-layout {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .my-chats-sidebar {
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
    max-height: none;
  }

  .my-chat {
    height: calc(100vh - 220px);
    min-height: 620px;
  }
}

@media (max-width: 640px) {
  .my-chats-section {
    padding: 14px 0 28px;
  }

  .my-chats-layout {
    border-radius: 22px;
  }

  .my-chats-sidebar {
    padding: 16px 14px;
  }

  .my-chats-sidebar__head h2 {
    font-size: 20px;
  }

  .my-chats-tabs {
    gap: 8px;
  }

  .my-chats-tab {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .my-chats-info {
    margin-top: 16px;
    padding: 15px;
    border-radius: 18px;
  }

  .my-chats-title {
    font-size: 28px;
  }

  .my-chats-subtitle {
    font-size: 13px;
  }

  .my-chat {
    height: calc(100vh - 250px);
    min-height: 560px;
  }

  .my-chat__head {
    flex-direction: column;
    gap: 12px;
    padding: 16px 14px 14px;
  }

  .my-chat__head h2 {
    font-size: 20px;
  }

  .my-chat__vk {
    width: 100%;
  }

  .my-chat__messages {
    padding: 14px;
  }

  .my-chat__msg {
    max-width: 88%;
    padding: 11px 12px;
    font-size: 13px;
  }

  .my-chat__footer {
    gap: 8px;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .my-chat__attach,
  .my-chat__send {
    width: 42px;
    height: 42px;
  }

  .my-chat__input {
    min-height: 44px;
    max-height: 96px;
    padding: 11px 12px;
    font-size: 13px;
  }
}

.my-chat__msg--reply{margin-left:2cm}.my-chat__reply-btn{margin-top:8px;border:0;background:transparent;color:#2563eb;font-weight:800;cursor:pointer;padding:0}.my-chat__reply-box{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px;border-top:1px solid #bfdbfe;background:#eff6ff;color:#1e3a8a;font-weight:800}.my-chat__reply-box button{border:0;background:transparent;color:#1e3a8a;font-size:22px;font-weight:900;cursor:pointer}.my-chat__attachment{display:inline-flex;align-items:center;margin-top:8px;padding:8px 10px;border-radius:12px;background:#fff;border:1px solid #dbe3ef;color:#2563eb;text-decoration:none;font-weight:800}.my-chat__attachment--image{display:block;max-width:260px;padding:0;overflow:hidden}.my-chat__attachment--image img{display:block;max-width:100%;height:auto}

.my-chat__reply-context{margin:0 0 8px;padding:8px 10px;border-left:4px solid #2563eb;border-radius:12px;background:rgba(37,99,235,.08);color:#1e3a8a}.my-chat__reply-context b{display:block;font-size:12px;margin-bottom:3px}.my-chat__reply-context span{display:block;font-size:12px;line-height:1.35;color:#334155}

.my-chat__author{font-size:13px;font-weight:950}.my-chat__msg--alias-admin .my-chat__author{color:#ff7a00}.my-chat__msg--alias-support .my-chat__author{color:#39d000}

.my-chat__actions{display:flex;align-items:center;gap:8px;margin-top:8px;flex-wrap:wrap}.my-chat__reply-btn,.my-chat__report-btn{border:0;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:800;cursor:pointer}.my-chat__reply-btn{background:#eef2ff;color:#3730a3}.my-chat__report-btn{background:#fee2e2;color:#991b1b}.my-chat__reply-btn:hover,.my-chat__report-btn:hover{filter:brightness(.97)}

/* Pinned message in user chat */
.my-chat__pin {
  margin: 12px 18px 0;
  padding: 12px 14px;
  border: 1px solid #ffe1a6;
  border-radius: 16px;
  background: #fff8e8;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}
.my-chat__pin-label {
  color: #b26a00;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.my-chat__pin-body {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}
.my-chat__pin-body b {
  flex: 0 0 auto;
  font-size: 13px;
  color: #101827;
}
.my-chat__pin-body span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #52627a;
  font-size: 13px;
}
@media (max-width: 720px) {
  .my-chat__pin-body {
    display: block;
  }
  .my-chat__pin-body span {
    display: block;
    white-space: normal;
    margin-top: 4px;
  }
}

/* Pinned message v11: full text toggle */
.my-chat__pin-body span[data-pin-text] {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.45;
}
.my-chat__pin.is-expanded .my-chat__pin-body span[data-pin-text] {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.my-chat__pin-more {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  color: #92400e;
  background: #ffedd5;
  cursor: pointer;
}
.my-chat__pin-more:hover {
  background: #fed7aa;
}

/* Pinned message v12: session-only close button */
.my-chat__pin {
  position: relative;
  padding-right: 42px;
}
.my-chat__pin-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  color: #b91c1c;
  background: #fee2e2;
  cursor: pointer;
}
.my-chat__pin-close:hover {
  background: #fecaca;
}
