
/* friends-form.css - futuriste "Mes amis" */

/* Modified to match conv-form positioning (floating bottom-right) */
#friends-box-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  display: none; /* affiché par JS */
  width: 360px;
  max-height: 520px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  border-radius: 12px;
  overflow: hidden;
}

#friends-box-root[aria-hidden="false"] {
  display: block;
}
#friends-box-root .conv-box {
  /* réutilise la grille conv-box existante */
}
.friends-header-badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #22c55e, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #020617;
}
.friends-preview-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #38bdf8, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b1120;
  font-weight: 700;
}
.friends-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}



/* === ICON-ATTACHED FORM shared styles === */
.icon-attached-form {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 360px;
  height: 540px;
  max-height: calc(100vh - 40px);
  background: rgba(14,18,22,0.94);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1200;
  transition: transform .18s ease, opacity .18s ease;
  transform: translateY(6px);
  opacity: 1;
}
.icon-attached-form.hidden { transform: translateY(10px) scale(.995); opacity: 0; pointer-events: none; }
.icon-attached-form .faf-header {
  flex: 0 0 auto;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #e8f7ff;
  font-weight: 600;
}
.icon-attached-form .faf-content {
  flex: 1 1 auto;
  padding: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.icon-attached-form .friend-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.icon-attached-form .friend-block img.avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}
.icon-attached-form .friend-block .name {
  font-size: 14px;
  line-height: 1.1;
  color: #e8f7ff;
}
.icon-attached-form .friend-block.anonymous {
  background: rgba(255,255,255,0.01);
  opacity: 0.9;
  font-style: italic;
}



/* ADJUSTED: ensure anchored right-bottom, transparent background, space for min 8 blocks */
.icon-attached-form {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  width: 360px !important;
  height: 540px !important;
  max-height: calc(100vh - 40px) !important;
  background: rgba(14,18,22,0.70) !important; /* slightly transparent */
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1200;
}

/* ensure content area always reserves space for 8 blocks (min) */
.icon-attached-form .faf-content {
  flex: 1 1 auto;
  padding: 10px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-height: 8 * 64px; /* for clarity - browsers ignore expression but keep for note */
}

/* visible placeholder for empty slots to keep UI space */
.icon-attached-form .friend-block.placeholder {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.04);
  min-height: 64px;
  opacity: 0.6;
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
}

/* anonymous dev block styling */
.icon-attached-form .friend-block.anonymous {
  background: rgba(255,255,255,0.015);
  font-style: italic;
  color: #cfeff9;
}

/* ensure scrollbar visible when needed */
.icon-attached-form .faf-content::-webkit-scrollbar {
  width: 10px;
}
.icon-attached-form .faf-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
}


/* === CONVERSATION HEADER STRUCTURE (INJECTED – DO NOT REMOVE) === */
.conversation-header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.conversation-header-center {
  display: flex;
  justify-content: center;
}

.conversation-count {
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(0, 180, 255, 0.18);
  color: #00eaff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.35);
}

.conversation-header {
  overflow: visible;
  z-index: 2;
}


/* === SIDEBAR PANELS CORE (PHASE 2) === */
.sidebar-panel {
  position: fixed;
  top: 0;
  left: 72px;
  width: calc(100% - 72px);
  height: 100vh;
  z-index: 200;
}
.sidebar-panel-active { display: block !important; }

/* UNIPAY FRIENDS MODAL POLISH */
#friends-box-root[aria-hidden="false"]{
  display:block !important;
}
#friends-box-root{
  width:min(420px,94vw) !important;
  max-height:min(82dvh,620px) !important;
  border:1px solid rgba(0,234,255,.28) !important;
  border-radius:20px !important;
  background:linear-gradient(145deg, rgba(3,12,28,.96), rgba(0,35,45,.90)) !important;
  box-shadow:
    0 24px 74px rgba(0,0,0,.64),
    0 0 28px rgba(0,234,255,.18) !important;
  overflow:hidden !important;
}
#friends-box-root .conv-box{
  width:100% !important;
  height:100% !important;
  max-height:inherit !important;
  border:0 !important;
  background:transparent !important;
}
#friends-box-root .conv-header{
  border-bottom:1px solid rgba(0,234,255,.18) !important;
  background:linear-gradient(90deg, rgba(0,234,255,.13), rgba(120,80,255,.08), transparent) !important;
}
.friends-header-badge,
.friends-preview-avatar,
.friends-line-avatar{
  box-shadow:0 0 18px rgba(0,234,255,.18) !important;
}
#friends-box-root .conv-list{
  scrollbar-width:thin;
  scrollbar-color:rgba(0,234,255,.55) rgba(255,255,255,.04);
}
#friends-box-root .conv-search{
  border-top:1px solid rgba(255,255,255,.08) !important;
  padding-top:10px !important;
}
#friends-box-root .conv-search input{
  border:1px solid rgba(0,234,255,.26) !important;
  background:rgba(0,0,0,.24) !important;
  color:#eaffff !important;
}
#friends-box-root .conv-search-btn,
#friends-box-root .conv-action,
#friends-box-root .friends-mode-btn{
  border-radius:12px !important;
  border:1px solid rgba(0,234,255,.30) !important;
  background:rgba(0,234,255,.10) !important;
  color:#eaffff !important;
}
#friends-box-root .friends-mode-btn.active{
  background:linear-gradient(135deg, rgba(0,234,255,.22), rgba(54,255,157,.12)) !important;
}
@media(max-width:760px){
  #friends-box-root{
    right:10px !important;
    bottom:calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    width:min(94vw,430px) !important;
    max-height:72dvh !important;
  }
}
