/*
  Minimal custom layer on top of Bootstrap (Bootswatch Darkly).
  Цель: единый стиль, аккуратная типографика, без «ИИ‑маркетинга» и лишнего визуального шума.
*/

:root {
  --cp-radius: 1rem;

  /* slightly brighter secondary text for dark surfaces */
  --cp-text-secondary: rgba(255, 255, 255, 0.72);
  --cp-text-muted: rgba(255, 255, 255, 0.56);
  --cp-border-soft: rgba(255, 255, 255, 0.16);
}
/* ---------------------------------------------
   Contrast / readability tweaks (Darkly)
   --------------------------------------------- */

/* Bootstrap utility classes can be too dim in Darkly for small captions */
.text-secondary,
.text-body-secondary {
  color: var(--cp-text-secondary) !important;
}

.text-muted,
.muted,
.form-text {
  color: var(--cp-text-muted) !important;
}

/* Outline secondary buttons should read as actionable, not disabled */
.btn-outline-secondary {
  color: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.40);
}

/* Fix “weird” rounded corners on header blocks by clipping background */
.card.overflow-hidden,
.chat-card {
  overflow: hidden;
}

/* Chat: make list subtitles readable */
.chat-tile .text-body-secondary,
.chat-tile .text-secondary {
  color: rgba(255, 255, 255, 0.68) !important;
}
body {
  /* subtle depth, keeps the UI clean */
  background: radial-gradient(1200px 700px at 15% 0%, rgba(13,110,253,.18), transparent 55%),
              radial-gradient(900px 500px at 85% 10%, rgba(32,201,151,.12), transparent 55%),
              var(--bs-body-bg);
}

.min-w-0 {
  min-width: 0;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.card,
.hero-card {
  border-radius: calc(var(--cp-radius) + 0.25rem);
}

.stat-tile {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: calc(var(--cp-radius) + 0.25rem);
  padding: 1rem;
  background: rgba(0,0,0,0.12);
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.btn-wide {
  min-width: 125px;
}

/* Hover affordance for clickable cards */
.hover-card {
  transition: transform 120ms ease, border-color 120ms ease;
}

.hover-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18) !important;
  text-decoration: none;
}

/* Chat (WhatsApp-ish) */
.chat-shell {
  height: calc(100vh - 240px);
  min-height: 560px;
}

@media (max-width: 767.98px) {
  .chat-shell { height: auto; min-height: 520px; }
}

.chat-list {
  max-height: inherit;
  overflow: auto;
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  background: rgba(0,0,0,0.12);
}

.chat-selection-bar {
  background: rgba(220,53,69,0.08);
}

.chat-msg {
  display: flex;
  gap: 0.75rem;
  max-width: 88%;
  margin-bottom: 0.75rem;
}

.chat-msg--selectable .chat-bubble {
  cursor: pointer;
}

.chat-msg--selected .chat-bubble {
  border-color: rgba(220,53,69,0.8);
  box-shadow: 0 0 0 1px rgba(220,53,69,0.35) inset;
}

.chat-msg--highlight .chat-bubble {
  animation: chatHighlight 2.2s ease;
}

@keyframes chatHighlight {
  0% { box-shadow: 0 0 0 0 rgba(13,110,253,0.0); }
  20% { box-shadow: 0 0 0 2px rgba(13,110,253,0.6); }
  100% { box-shadow: 0 0 0 0 rgba(13,110,253,0.0); }
}

.chat-msg--me {
  margin-left: auto;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
}

.chat-avatar-link:hover {
  text-decoration: none;
}

.chat-bubble {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
}

.chat-msg--me .chat-bubble {
  background: rgba(13,110,253,0.22);
  border-color: rgba(13,110,253,0.35);
}

.chat-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  opacity: 0.85;
}

.chat-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  white-space: nowrap;
  opacity: 0.8;
}

.chat-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-voice {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-voice-audio {
  width: min(300px, 72vw);
  max-width: 100%;
}

.chat-voice-duration {
  font-size: 0.74rem;
  color: var(--cp-text-muted);
}

.chat-tile.active {
  background: rgba(13,110,253,0.20) !important;
}

.chat-thread-head {
  background: rgba(255,255,255,0.03);
}

.chat-members-panel {
  background: rgba(255,255,255,0.02);
}

.chat-members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
}

.chat-members-empty {
  padding: 0.65rem 0.75rem;
  color: var(--cp-text-muted);
  font-size: 0.86rem;
}

.chat-member-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 210px;
  max-width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.7rem;
  background: rgba(255,255,255,0.04);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.chat-member-item:hover {
  text-decoration: none;
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
}

.chat-member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
}

.chat-member-content {
  min-width: 0;
}

.chat-member-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-member-role {
  font-size: 0.73rem;
  color: var(--cp-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-menu {
  position: fixed;
  z-index: 1085;
  min-width: 220px;
  padding: 0.35rem;
  border-radius: 0.75rem;
  background: #1f2937;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 16px 36px rgba(0,0,0,0.45);
}

.chat-user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
}

.chat-user-menu-item:hover,
.chat-user-menu-item:focus {
  background: rgba(255,255,255,0.12);
  outline: none;
}

.chat-user-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.notification-menu {
  min-width: 320px;
  max-width: 420px;
  padding: 0;
}

.notification-head .btn-link {
  text-decoration: none;
  color: var(--cp-text-secondary);
}

.notification-head .btn-link:hover {
  color: #fff;
  text-decoration: underline;
}

.notification-list {
  max-height: 360px;
  overflow: auto;
}

.notification-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: inherit;
  text-decoration: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border: 0;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item.unread {
  background: rgba(13,110,253,0.12);
}

.notification-item:hover,
.notification-item:focus {
  background: rgba(255,255,255,0.08);
  outline: none;
}

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.notification-body {
  font-size: 0.82rem;
  color: var(--cp-text-secondary);
  line-height: 1.2rem;
}

.notification-time {
  font-size: 0.74rem;
  color: var(--cp-text-muted);
  white-space: nowrap;
  margin-left: auto;
}

.notification-empty {
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  color: var(--cp-text-muted);
}

.chat-emoji-panel {
  margin-top: 0.55rem;
  padding: 0.45rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-height: 150px;
  overflow: auto;
}

.chat-emoji-item {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-emoji-item:hover,
.chat-emoji-item:focus {
  background: rgba(255,255,255,0.14);
  outline: none;
}

#chat-voice-btn.is-recording {
  color: #fff;
  border-color: rgba(220,53,69,0.9);
  background: rgba(220,53,69,0.35);
}

.chat-voice-status {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--cp-text-secondary);
}

/* Portfolio comments (social feed style) */
.portfolio-comments {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portfolio-comment {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.portfolio-comment-avatar-link:hover {
  text-decoration: none;
}

.portfolio-comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
}

.portfolio-comment-body {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}

.portfolio-comment-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.18rem;
}

.portfolio-comment-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-comment-time {
  font-size: 0.74rem;
  color: var(--cp-text-muted);
  white-space: nowrap;
}

.portfolio-comment-text {
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
}
