/* aspaz.az — "Dostlar" modulu stilləri (user/friends.php, cv-detail.php dostluq düyməsi) */

/* ---------- Başlıq + bildiriş zəngi ---------- */
.friends-shell { padding: 26px 26px 8px; }
.friends-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.friends-head h1 {
  font-size: 22px; margin: 0; display: flex; align-items: center; gap: 10px;
}
.friends-head h1::before {
  content: '🤝'; font-size: 20px; width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--color-primary-tint); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.friends-notif-bell { position: relative; flex-shrink: 0; }
.friends-notif-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--color-border);
  background: var(--color-surface); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.friends-notif-btn:hover { background: var(--color-primary-tint); border-color: var(--color-primary-light); transform: translateY(-1px); }
.friends-notif-dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--color-primary); border: 2px solid var(--color-surface); }
.friends-notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); width: 350px; max-width: 90vw;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease; z-index: 60; overflow: hidden;
  display: flex; flex-direction: column;
}
.friends-notif-dropdown[hidden] { display: none !important; pointer-events: none; }
.friends-notif-bell.is-open .friends-notif-dropdown { opacity: 1; transform: translateY(0); }

.friends-notif-dropdown-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px; font-weight: 800; font-size: 13.5px; border-bottom: 1px solid var(--color-border);
  color: var(--color-ink); flex-shrink: 0; background: var(--color-bg-soft);
}
.friends-notif-clear-all {
  background: none; border: none; color: var(--color-primary-dark); font-size: 12px; font-weight: 700;
  cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); transition: background .12s ease;
}
.friends-notif-clear-all:hover { background: var(--color-primary-tint); }
.friends-notif-clear-all:disabled { opacity: .5; cursor: default; }

.friends-notif-body { max-height: 340px; overflow-y: auto; }
.friends-notif-empty { padding: 30px 16px; text-align: center; font-size: 13px; color: var(--color-ink-faint); }

.friends-notif-item {
  position: relative; display: flex; align-items: stretch; gap: 10px; padding: 12px 40px 12px 14px;
  border-bottom: 1px solid var(--color-border); overflow: hidden;
}
.friends-notif-item:last-child { border-bottom: none; }
.friends-notif-item.is-unread { background: var(--color-primary-tint); }
.friends-notif-item.is-unread::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--color-primary);
}
.friends-notif-item-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: inherit; cursor: pointer; }
.friends-notif-icon { font-size: 17px; line-height: 1; flex-shrink: 0; }
.friends-notif-content { min-width: 0; }
.friends-notif-text { font-size: 13.5px; color: var(--color-ink); line-height: 1.4; }
.friends-notif-time { font-size: 11px; color: var(--color-ink-faint); margin-top: 3px; }

.friends-notif-delete {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 24px; height: 24px;
  border-radius: 50%; border: none; background: transparent; color: var(--color-ink-faint); font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.friends-notif-item:hover .friends-notif-delete { opacity: 1; }
.friends-notif-delete:hover { background: var(--color-danger-bg); color: var(--color-danger); }
.friends-notif-delete:disabled { opacity: .3 !important; cursor: default; }

/* ---------- Tablar (seqmentli pill naviqasiya) ---------- */
.friends-tabs {
  display: flex; gap: 4px; padding: 5px; margin: 0 0 24px; background: var(--color-bg-soft);
  border-radius: var(--radius-full); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.friends-tabs::-webkit-scrollbar { display: none; }
.friends-tabs a {
  position: relative; padding: 10px 18px; font-size: 13.5px; font-weight: 700; color: var(--color-ink-soft);
  white-space: nowrap; text-decoration: none; display: flex; align-items: center; gap: 7px; flex: 1;
  justify-content: center; border-radius: var(--radius-full); transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.friends-tabs a:hover { color: var(--color-primary-dark); }
.friends-tabs a.active { color: #fff; background: var(--color-primary); box-shadow: var(--shadow-md); }
.friends-tab-badge {
  background: #fff; color: var(--color-primary-dark); font-size: 11px; font-weight: 800; line-height: 1;
  padding: 3px 6px; border-radius: var(--radius-full); min-width: 18px; text-align: center;
}
.friends-tabs a:not(.active) .friends-tab-badge { background: var(--color-primary); color: #fff; }


/* ---------- Dostlarım: kart grid ---------- */
.friends-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px;
}
.friend-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 22px 16px; text-align: center;
  background: var(--color-bg-soft); transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.friend-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--color-primary-light); background: var(--color-surface); }
.friend-card-avatar-wrap { position: relative; width: 72px; height: 72px; margin: 0 auto 12px; }
.friend-card-avatar-wrap img, .friend-card-avatar-wrap .avatar-fallback {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-tint); color: var(--color-primary-dark); font-family: var(--font-display); font-weight: 700; font-size: 25px;
  box-shadow: 0 0 0 3px var(--color-surface);
}
.friend-status-dot {
  position: absolute; bottom: 2px; right: 2px; width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--color-surface);
}
.friend-status-dot.is-online { background: var(--color-success); }
.friend-status-dot.is-offline { background: var(--color-ink-faint); }
.friend-card h3 { font-size: 15px; margin: 0 0 2px; }
.friend-card-role { font-size: 12px; color: var(--color-primary-dark); font-weight: 700; }
.friend-card-activity { font-size: 11.5px; color: var(--color-ink-faint); margin: 6px 0 16px; }
.friend-card-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.friend-card-inline-form { display: inline-block; }

/* ---------- Sorğu / blok siyahıları (sətir görünüşü) ---------- */
.friends-list { display: flex; flex-direction: column; gap: 8px; }
.friend-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--color-bg-soft); flex-wrap: wrap; transition: background .15s ease;
}
.friend-row:hover { background: var(--color-primary-tint); }
.friend-row img, .friend-row .avatar-fallback {
  width: 50px; height: 50px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--color-surface);
  color: var(--color-primary-dark); font-family: var(--font-display); font-weight: 700; font-size: 17px;
  box-shadow: 0 0 0 3px var(--color-surface);
}
.friend-row-body { flex: 1; min-width: 140px; }
.friend-row-body h4 { font-size: 14.5px; margin: 0 0 2px; }
.friend-row-meta { font-size: 12.5px; color: var(--color-ink-faint); }
.friend-row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.friends-shell .empty-state { padding: 50px 20px; }

/* ---------- CV səhifəsindəki dostluq düyməsi ---------- */
.fc-friend-btn[disabled] { opacity: .65; cursor: not-allowed; }
.fc-friend-btn[data-state="friends"] { border-color: var(--color-success); color: var(--color-success); }

/* ---------- Söhbət pəncərəsi (animasiyalı modal) ---------- */
.fc-overlay {
  position: fixed; inset: 0; background: rgba(36, 20, 23, .38); z-index: 300; opacity: 0; transition: opacity .2s ease;
}
.fc-overlay[hidden] { display: none !important; pointer-events: none; }
.fc-overlay.fc-visible { opacity: 1; }

.fc-window {
  position: fixed; z-index: 301; background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.94); opacity: 0;
  width: 400px; max-width: 92vw; height: 560px; max-height: 84vh;
  transition: opacity .2s ease, transform .2s ease;
}
.fc-window[hidden] { display: none !important; pointer-events: none; }
.fc-window.fc-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.fc-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--color-primary);
  color: #fff; flex-shrink: 0;
}
.fc-header-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background-color: rgba(255,255,255,.25); background-size: cover; background-position: center;
  color: #fff; font-weight: 700; font-size: 14px; user-select: none;
}
.fc-header-avatar.has-photo { color: transparent; }
.fc-header-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fc-header-name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-header-status { font-size: 11.5px; opacity: .85; }
.fc-header-status.is-online::before { content: '● '; color: #baffcd; }
.fc-close { background: transparent; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 4px 6px; opacity: .9; }
.fc-close:hover { opacity: 1; }

.fc-thread {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--color-bg-soft);
}
.fc-bubble { max-width: 78%; display: flex; flex-direction: column; }
.fc-bubble-mine { align-self: flex-end; align-items: flex-end; }
.fc-bubble-theirs { align-self: flex-start; align-items: flex-start; }
.fc-bubble-content {
  padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; word-break: break-word; white-space: pre-wrap;
}
.fc-bubble-mine .fc-bubble-content { background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }
.fc-bubble-theirs .fc-bubble-content { background: var(--color-surface); border: 1px solid var(--color-border); border-bottom-left-radius: 4px; }
.fc-bubble-time { font-size: 10.5px; color: var(--color-ink-faint); margin-top: 3px; padding: 0 4px; }

.fc-typing { padding: 0 16px 8px; font-size: 12px; color: var(--color-ink-faint); display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fc-typing-dots { display: inline-flex; gap: 2px; }
.fc-typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--color-ink-faint); animation: fcTypingBlink 1.2s infinite ease-in-out; display: inline-block; }
.fc-typing-dots i:nth-child(2) { animation-delay: .15s; }
.fc-typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes fcTypingBlink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.fc-composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--color-border); flex-shrink: 0; background: var(--color-surface); }
.fc-composer textarea {
  flex: 1; resize: none; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 9px 12px;
  font-family: var(--font-body); font-size: 13.5px; max-height: 110px; min-height: 40px; line-height: 1.4;
}
.fc-composer textarea:focus { outline: none; border-color: var(--color-primary-light); }
.fc-send-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: background .15s ease;
}
.fc-send-btn:hover { background: var(--color-primary-dark); }

/* ---------- Toast bildirişləri ---------- */
.fc-toast-host { position: fixed; top: 18px; right: 18px; z-index: 400; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.fc-toast {
  background: var(--color-ink); color: #fff; padding: 12px 18px; border-radius: var(--radius-md); font-size: 13.5px;
  font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateX(16px); transition: opacity .22s ease, transform .22s ease;
  max-width: 320px;
}
.fc-toast-show { opacity: 1; transform: translateX(0); }
.fc-toast-success { background: var(--color-success); }
.fc-toast-error { background: var(--color-danger); }
.fc-toast-info { background: var(--color-ink); }

/* ============================================================
   Responsiv (planşet / mobil)
   ============================================================ */
@media (max-width: 860px) {
  .friends-shell { padding: 20px 18px 6px; }
  .friends-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}

@media (max-width: 560px) {
  .friends-shell { padding: 16px 14px 6px; }
  .friends-head { margin-bottom: 16px; }
  .friends-head h1 { font-size: 18px; }
  .friends-head h1::before { width: 34px; height: 34px; font-size: 17px; }

  .friends-notif-dropdown { position: fixed; left: 12px; right: 12px; top: 68px; width: auto; max-width: none; }
  .friends-notif-body { max-height: 60vh; }
  .friends-notif-delete { opacity: 1; }
  .friends-notif-item { padding: 11px 38px 11px 12px; }

  .friends-tabs { border-radius: var(--radius-md); justify-content: flex-start; }
  .friends-tabs a { padding: 9px 12px; font-size: 12.5px; gap: 5px; flex: 0 0 auto; }

  .friends-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .friend-card { padding: 16px 10px; }
  .friend-card-actions { flex-direction: column; align-items: stretch; }
  .friend-card-actions .btn { width: 100%; }

  .friend-row { padding: 12px; gap: 10px; }
  .friend-row img, .friend-row .avatar-fallback { width: 42px; height: 42px; font-size: 15px; }
  .friend-row-body { min-width: 100px; }
  .friend-row-actions { width: 100%; justify-content: flex-start; margin-top: 2px; }

  .fc-window {
    left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; max-width: none;
    height: 72vh; max-height: 620px;
    border-radius: var(--radius-lg); transform: translateY(24px) scale(.97); opacity: 0;
  }
  .fc-window.fc-visible { transform: translateY(0) scale(1); opacity: 1; }
  .fc-header { padding: 12px 14px; }
  .fc-thread { padding: 12px; }
  .fc-composer { padding: 10px; }
  .fc-toast-host { left: 12px; right: 12px; top: 12px; align-items: stretch; }
  .fc-toast { max-width: 100%; }
}

@media (max-width: 360px) {
  .fc-window { left: 8px; right: 8px; bottom: 8px; height: 70vh; }
}

@media (max-width: 380px) {
  .friends-tabs a { padding: 8px 9px; font-size: 11.5px; }
}
