/* ============================================================================
 * page-amis.css — TripCooking · Page « Mes amis »
 * ----------------------------------------------------------------------------
 * Gabarit calé sur les bords :
 *   • NAV  : position:fixed, collée au bord GAUCHE, pleine hauteur.
 *   • DROITE : colonne collée au bord DROIT (Ajouter / Suggestions / Invitations).
 *   • CENTRE : liste des amis, défile avec la page.
 * L'entête réelle (haut/entete.php) reste en place et est stylée globalement
 * (indexPage.css) ; ici on aligne juste le contenu dessous.
 * Tout est scopé sous .tca -> aucune interférence avec le reste du site.
 * Largeur de la nav = 250px pour rester alignée avec le padding de l'entête.
 * ========================================================================== */

.tca {
  --nav: 250px;
  --head: 72px;
  --right: 340px;
  --gap: 18px;
  --edge: 20px;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f2f3f7;
  --line: #e9eaf0;
  --text: #14141b;
  --text-2: #5b5c6b;
  --text-3: #8a8b99;
  --purple: #6d4aff;
  --purple-d: #5a37e8;
  --purple-soft: #efeaff;
  --gold: #f6b500;
  --green: #17b26a;
  --heart: #f2385a;
  --blue: #1d9bf0;
  --r: 16px;

  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.tca *, .tca *::before, .tca *::after { box-sizing: border-box; }
.tca a { color: inherit; text-decoration: none; }
.tca h1, .tca h2, .tca h3 { margin: 0; }
.tca img { display: block; max-width: 100%; }
.tca button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.tca input, .tca select { font-family: inherit; }

body { margin: 0; background: var(--bg); }

/* ── GABARIT ──────────────────────────────────────────────────────────── */
.tca-shell {
  margin-left: var(--nav);
  padding: calc(var(--head) + 20px) var(--edge) 48px var(--gap);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--right);
  gap: var(--gap);
  align-items: start;
}

/* ══ NAV (collée au bord gauche) ═════════════════════════════════════════ */
.tca-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav);
  height: 100vh;
  overflow-y: auto;
  z-index: 1001;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}
.tca-nav::-webkit-scrollbar { width: 8px; }
.tca-nav::-webkit-scrollbar-thumb { background: #e2e3ea; border-radius: 8px; }

.tca-brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 18px; }
.tca-brand__logo {
  width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 13px; display: grid; place-items: center; font-size: 24px;
  background: var(--gold); box-shadow: 0 8px 18px -8px rgba(246, 181, 0, .8);
}
.tca-brand__tx b { display: block; font-size: 16px; font-weight: 800; line-height: 1.02; letter-spacing: -.01em; }
.tca-brand__tx i { display: block; margin-top: 4px; font-style: normal; font-size: 11px; font-weight: 500; color: var(--text-3); }

.tca-menu { display: flex; flex-direction: column; gap: 3px; }
.tca-menu__i {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 15px; border-radius: 12px;
  color: var(--text); font-size: 15px; font-weight: 600;
}
.tca-menu__i .ic { font-size: 18px; width: 24px; text-align: center; line-height: 1; }
.tca-menu__i:hover { background: var(--surface-2); }
.tca-menu__i.is-active { background: var(--gold); color: #1a1400; box-shadow: 0 8px 18px -10px rgba(246, 181, 0, .9); }
.tca-menu__b {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--purple); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.tca-menu__i.is-active .tca-menu__b { background: #1a1400; color: #fff; }

.tca-publish {
  margin: 16px 6px 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border-radius: 13px; background: var(--gold); color: #1a1400;
  font-size: 15px; font-weight: 700; box-shadow: 0 10px 22px -10px rgba(246, 181, 0, .85);
}
.tca-publish span { font-size: 18px; line-height: 1; }
.tca-publish:hover { filter: brightness(1.04); }

.tca-nav__deco { margin: 22px 10px 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.tca-nav__words { font-size: 14px; font-weight: 700; font-style: italic; line-height: 1.5; color: var(--text-2); }
.tca-nav__globe { margin-top: 10px; font-size: 40px; line-height: 1; }

/* ══ CENTRE : liste des amis ═════════════════════════════════════════════ */
.tca-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.tca-head { display: flex; align-items: center; gap: 14px; }
.tca-head__icon {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px;
  background: #fff3d6;
}
.tca-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.tca-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }

/* Onglets */
.tca-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
  border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.tca-tabs::-webkit-scrollbar { display: none; }
.tca-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 6px; margin-right: 10px; color: var(--text-3);
  font-size: 14px; font-weight: 600; border-bottom: 2px solid transparent;
}
.tca-tab b {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center;
}
.tca-tab:hover { color: var(--text); }
.tca-tab.is-active { color: var(--text); border-bottom-color: var(--gold); }
.tca-tab.is-active b { background: var(--gold); color: #1a1400; }
.tca-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

/* Barre d'outils */
.tca-toolbar { display: flex; gap: 12px; align-items: center; }
/* Recherche : on FORCE le fond clair (certaines feuilles globales du site
   mettent les input[type=search] en sombre -> d'où la barre noire). */
.tca-search {
  flex: 1; display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px; background: #ffffff !important;
  border: 1px solid var(--line); border-radius: 999px;
}
.tca-search__icon { opacity: .5; font-size: 15px; }
.tca .tca-search input,
.tca .tca-search input[type="search"],
.tca .tca-search input[type="text"] {
  flex: 1; min-width: 0; height: 100%;
  border: 0 !important; outline: none !important; box-shadow: none !important;
  background: transparent !important; color: var(--text) !important;
  font-size: 14px; font-family: inherit;
}
.tca .tca-search input::placeholder { color: var(--text-3) !important; opacity: 1; }
.tca-sort select {
  height: 46px; padding: 0 38px 0 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8b99' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* Carte liste */
.tca-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 2px rgba(20, 22, 40, .04); }
.tca-friends { display: flex; flex-direction: column; }
.tca-friend {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); transition: background .14s ease;
}
.tca-friend:last-child { border-bottom: 0; }
.tca-friend:hover { background: #fafbfc; }
.tca-friend__id { display: flex; align-items: center; gap: 14px; min-width: 0; }

/* Avatars (photo ou initiales) */
.tca-avatar {
  position: relative; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  background: var(--surface-2) center/cover no-repeat; display: block;
}
.tca-avatar__img {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%;
  background-size: cover; background-position: center;
}
.tca-avatar__img.is-ini { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; }
.tca-avatar--sm { width: 44px; height: 44px; }
.tca-avatar--sm .tca-avatar__img.is-ini { font-size: 14px; }
.tca-avatar--online::after {
  content: ""; position: absolute; right: 1px; bottom: 1px;
  width: 13px; height: 13px; border-radius: 50%; background: var(--green);
  border: 2.5px solid #fff; z-index: 2;
}

.tca-friend__meta { min-width: 0; }
.tca-friend__name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.tca-verif {
  width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 9px; font-weight: 900;
  display: grid; place-items: center;
}
/* @pseudo : gris, sur la même ligne que le nom (façon maquette). */
.tca-friend__handle { font-size: 13px; color: var(--text-3); font-weight: 500; }
.tca-friend__sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.tca-friend__status { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-right: 4px; white-space: nowrap; }

.tca-friend__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tca-btn {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 13.5px; font-weight: 700;
}
.tca-btn:hover { background: var(--surface-2); }
.tca-more {
  width: 38px; height: 38px; border-radius: 50%; color: var(--text-3);
  font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.tca-more:hover { background: var(--surface-2); color: var(--text); }

.tca-empty { padding: 26px 20px; text-align: center; color: var(--text-2); font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.tca-nomatch { margin-top: -4px; }

.tca-showmore { display: flex; justify-content: center; }
.tca-showmore button {
  padding: 10px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 13.5px; font-weight: 700;
}
.tca-showmore button:hover { background: var(--surface-2); color: var(--text); }

/* ══ DROITE (collée au bord droit) ═══════════════════════════════════════ */
.tca-right { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.tca-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: 0 1px 2px rgba(20, 22, 40, .04); }
.tca-box h3 { font-size: 16px; font-weight: 800; }
.tca-box__text { margin: 6px 0 14px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.tca-box__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tca-box__link { font-size: 12.5px; font-weight: 700; color: var(--purple); }
.tca-box__link:hover { text-decoration: underline; }
.tca-count { color: var(--text-3); font-weight: 700; }

.tca-addform { display: flex; flex-direction: column; gap: 12px; }
.tca-search--box { background: var(--surface-2) !important; height: 44px; }
.tca-btn-primary {
  padding: 12px 16px; border-radius: 12px; background: var(--purple); color: #fff;
  font-size: 14px; font-weight: 700; box-shadow: 0 10px 22px -12px rgba(109, 74, 255, .9);
}
.tca-btn-primary:hover { background: var(--purple-d); }

.tca-people { display: flex; flex-direction: column; }
.tca-person { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); }
.tca-person:first-child { border-top: 0; }
.tca-person__meta { min-width: 0; flex: 1; }
.tca-person__name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tca-person__handle { font-size: 12px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tca-person__form { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.tcFriendRequest__error { color: var(--heart); font-size: 11px; }
.tca-btn-outline {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--purple);
  background: #fff; color: var(--purple); font-size: 13px; font-weight: 700;
}
.tca-btn-outline:hover { background: var(--purple-soft); }

.tca-invite__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tca-invite__actions form { display: inline; }
.tca-ibtn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.tca-ibtn--ok { background: var(--green); color: #fff; }
.tca-ibtn--ok:hover { filter: brightness(.94); }
.tca-ibtn--no { background: var(--surface-2); color: var(--text-2); }
.tca-ibtn--no:hover { background: #e6e7ee; }

.tca-box__footer { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  text-align: center; font-size: 12.5px; font-weight: 700; color: var(--purple); }
.tca-box__footer:hover { text-decoration: underline; }
.tca-empty-mini { padding: 14px 4px; color: var(--text-3); font-size: 13px; text-align: center; }

/* ══ RESPONSIVE ══════════════════════════════════════════════════════════ */

/* Écrans moyens : la colonne droite passe SOUS le centre (plus de place au centre). */
@media (max-width: 1180px) {
  .tca-shell { grid-template-columns: minmax(0, 1fr); padding-right: var(--gap); }
  .tca-right { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
}

/* Tablette : nav masquée (accessible via un bouton), contenu pleine largeur. */
@media (max-width: 900px) {
  .tca-shell { margin-left: 0; padding-left: 14px; padding-right: 14px; }
  .tca-nav {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
  }
  .tca-nav.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
}

/* Mobile : tout empilé sur une colonne. */
@media (max-width: 640px) {
  .tca-right { grid-template-columns: 1fr; }
  .tca-head h1 { font-size: 22px; }
  .tca-toolbar { flex-wrap: wrap; }
  .tca-sort select { width: 100%; }
  .tca-friend { flex-wrap: wrap; }
  .tca-friend__actions { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .tca * { transition: none !important; }
}

/* ============================================================================
 * OVERRIDE ULTRA-PRIORITAIRE — recherches toujours en CLAIR
 * ----------------------------------------------------------------------------
 * Placé en toute fin de feuille (priorité d'ordre) + haute spécificité + !important
 * pour battre une éventuelle feuille globale qui met les « moteurs de recherche »
 * (input[type=search]) en fond noir sur le reste du site.
 * ========================================================================== */
.tca .tca-toolbar .tca-search,
.tca .tca-right .tca-search { background: #ffffff !important; border: 1px solid var(--line) !important; }
.tca .tca-right .tca-search--box { background: #f2f3f7 !important; }

.tca .tca-search input,
.tca .tca-search input[type="search"],
.tca .tca-search input[type="text"],
.tca .tca-search input[type="email"],
.tca .tca-toolbar .tca-search input,
.tca .tca-right .tca-search input {
  background: transparent !important;
  background-color: transparent !important;
  color: #14141b !important;
  -webkit-text-fill-color: #14141b !important;
  caret-color: #14141b !important;
  box-shadow: none !important;
  border: 0 !important;
}
.tca .tca-search input::placeholder {
  color: #8a8b99 !important;
  -webkit-text-fill-color: #8a8b99 !important;
  opacity: 1 !important;
}
.tca .tca-search__icon { color: #8a8b99 !important; -webkit-text-fill-color: initial !important; }

/* Bouton « Trouver des amis » : violet plein (un style global .btn/submit le
   repassait en blanc -> on force). */
.tca .tca-btn-primary,
.tca .tca-addform .tca-btn-primary,
.tca button.tca-btn-primary,
.tca input.tca-btn-primary {
  background: var(--purple) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 0 !important;
  box-shadow: 0 10px 22px -12px rgba(109, 74, 255, .9) !important;
}
.tca .tca-btn-primary:hover { background: var(--purple-d) !important; }

/* ── ONGLETS : panneaux basculables ─────────────────────────────────────── */
.tca-panels { display: block; }
.tca-panel { display: none; }
.tca-panel.is-active { display: block; }
.tca-tab { background: none; }               /* les onglets sont des <button> */

/* Pastille « En attente » (invitations envoyées) */
.tca-status-pending {
  padding: 6px 14px; border-radius: 999px;
  background: #fff7e6; color: #9a6b00;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.tca-panel code {
  background: var(--surface-2); padding: 1px 6px; border-radius: 6px;
  font-size: 12px; font-family: ui-monospace, Menlo, monospace;
}