/* conv-form.css - Boîte de conversations futuriste réutilisable */
:root{
  --conv-text: #eaf6ff;
  --conv-muted: #9fb8c9;
  --conv-accent: #36d6ff;
  --conv-accent-2: #6a3cff;
}

#conv-box-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  display: none; /* affiché par JS */
}

.conv-box {
  width: 360px;
  max-width: calc(100% - 40px);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 30px rgba(4,14,40,0.7);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--conv-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.conv-header{
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02));
}
.conv-header-badge{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--conv-accent), var(--conv-accent-2));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #001322;
  flex-shrink: 0;
}
.conv-title{
  font-size: 14px;
  font-weight: 700;
}
.conv-sub{
  font-size: 12px;
  color: var(--conv-muted);
}
.conv-header-actions{
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.conv-btn-ghost{
  background: transparent;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--conv-text);
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12px;
}
.conv-btn-ghost:hover{
  background: rgba(0,0,0,0.35);
}

.conv-list{
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  background: radial-gradient(circle at top left, rgba(54,214,255,0.12), transparent 60%);
}
.conv-empty{
  min-height:112px;
  display:grid;
  place-items:center;
  padding:18px 12px;
  border:1px dashed rgba(54,214,255,.28);
  border-radius:10px;
  color:var(--conv-muted);
  text-align:center;
  line-height:1.35;
}
.conv-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s ease;
}
.conv-item:hover{
  transform: translateX(5px);
  background: linear-gradient(90deg, rgba(54,214,255,0.22), rgba(106,60,255,0.16));
}
.conv-item.selected{
  outline: 1px solid rgba(54,214,255,0.6);
  background: linear-gradient(90deg, rgba(54,214,255,0.26), rgba(106,60,255,0.20));
}
.conv-avatar{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.22);
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 0%, rgba(255,255,255,0.4), transparent 60%);
  font-size: 16px;
  font-weight: 700;
}
.conv-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.conv-meta{
  display: flex;
  flex-direction: column;
}
.conv-meta-name{
  font-size: 14px;
  font-weight: 600;
}
.conv-meta-status{
  font-size: 12px;
  color: var(--conv-muted);
}

.conv-footer{
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.8));
  display: flex;
  gap: 8px;
  align-items: center;
}
.conv-search{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.conv-search input{
  flex: 1;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.4);
  padding: 8px 10px;
  color: var(--conv-text);
  font-size: 13px;
  outline: none;
}
.conv-search input::placeholder{
  color: rgba(255,255,255,0.4);
}
.conv-search-btn{
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(0,0,0,0.8);
  color: var(--conv-text);
  cursor: pointer;
  padding: 7px 9px;
  font-size: 13px;
}
.conv-action{
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, var(--conv-accent), var(--conv-accent-2));
  color: #021026;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
}

.conv-list::-webkit-scrollbar{
  width: 7px;
}
.conv-list::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(54,214,255,0.6), rgba(106,60,255,0.6));
  border-radius: 10px;
}

@media (max-width: 480px){
  #conv-box-root{
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .conv-box{
    width: 100%;
    max-width: none;
  }
}



/* === 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; }
