/* ============================================================
   SocialCraft — interface façon réseau social (capture)
   ============================================================ */

:root {
  --bg: #e9ebed;
  --card: #ffffff;
  --border: #d3d8dc;
  --dark: #1c1c1c;
  --text: #2f2f2f;
  --muted: #8a8f94;
  --blue: #3b82f6;
  --blue-dark: #2f6fd0;
  --red: #e74c3c;
  --green: #7cb342;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* Anciennes icônes vintage (assets/icons/) pour quelques elements */
.ico {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  display: inline-block;
  flex: none;
}
.plus-btn .ico { width: 14px; height: 14px; vertical-align: -3px; }
.app-box {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e8eaed;
  flex: none;
}
.app-box .ico { width: 18px; height: 18px; vertical-align: 0; object-fit: contain; }
.overlap-icons {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 20px;
  flex: none;
  vertical-align: -5px;
}
.overlap-icons img {
  position: absolute;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 2px solid #fff;
}
.overlap-icons img:first-child { left: 0; z-index: 1; }
.overlap-icons img:last-child { left: 10px; z-index: 2; }


/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: #2a2a2a;
  color: #e8e8e8;
  border-radius: 0 0 8px 8px;
}
.site-name {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: .2px;
  white-space: nowrap;
}
.site-name:hover { color: #fff; text-decoration: none; }

.search-bar {
  position: relative;
  display: flex;
  height: 30px;
  width: min(560px, 42vw);
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
}
.search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0 10px;
  font-size: 12px;
  color: #333;
  outline: none;
}
.search-go, .search-menu {
  border: none;
  background: #fff;
  color: #444;
  cursor: pointer;
  font-size: 12px;
}
.search-go {
  border-left: 1px solid #e3e3e3;
  padding: 0 8px;
  font-size: 14px;
}
.search-menu {
  border-left: 1px solid #e3e3e3;
  padding: 0 10px;
  white-space: nowrap;
  border-radius: 0;
}
.search-go:hover, .search-menu:hover { background: #f2f2f2; }

.search-results {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
  z-index: 60;
  max-height: 320px;
  overflow: auto;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  color: #333;
}
.search-result:hover { background: #f4f8ff; text-decoration: none; }
.search-result .res-emoji {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: #eef2f7;
  border-radius: 4px;
}
.search-result small { color: var(--muted); margin-left: auto; }
.search-empty { padding: 10px; color: var(--muted); }

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.top-btn {
  height: 30px;
  min-width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid #3a3a3a;
  background: #2b2b2b;
  color: #e8e8e8;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
}
.top-btn:hover { background: #3a3a3a; }
.top-btn.primary {
  background: #2b2b2b;
  border-color: #3a3a3a;
  color: #e8e8e8;
}
.top-btn.primary:hover { background: #3a3a3a; }
.top-btn.profile-btn {
  background: #2b2b2b;
  border-color: #3a3a3a;
  color: #e8e8e8;
  height: 30px;
  font-size: 12px;
}
.btn-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  flex: none;
  align-self: center;
  background: rgba(255, 255, 255, .7);
  margin: 0 4px;
}

/* profil connecté dans la barre */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 6px;
  background: #2b2b2b;
  border: 1px solid #3a3a3a;
  border-radius: 3px;
  color: #e8e8e8;
  font-size: 12px;
}
.user-chip img { width: 22px; height: 22px; border-radius: 3px; }
.user-chip button {
  background: none; border: none; color: #aaa;
  cursor: pointer; font-size: 13px; padding: 0 2px;
}
.user-chip button:hover { color: #ff8080; }

/* ---------- Panneau de connexion ---------- */
.login-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 6px;
  padding: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
}
.login-card h3 { font-size: 18px; margin-bottom: 8px; }
.login-card p { color: #666; font-size: 13px; }
.login-card input {
  width: 100%;
  margin-top: 12px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 13px;
}
.login-card input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.login-actions { display: flex; gap: 8px; margin-top: 10px; }
.login-card small { display: block; margin-top: 12px; color: #999; font-size: 11px; }
.error { color: #d63031 !important; margin-top: 8px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: #f6f6f6;
  color: #333;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #ededed; }
.btn-blue { background: var(--blue); border-color: var(--blue-dark); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; }
.btn.mini { padding: 3px 9px; font-size: 11px; }

/* ---------- Mise en page ---------- */
.layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 248px;
  gap: 12px;
  max-width: 1200px;
  margin: 14px auto;
  padding: 0 12px;
  align-items: start;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 12px;
}

/* ---------- Colonne gauche ---------- */
.side-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
}
/* Plus de fond blanc nulle part : juste les barres grises */
.leftbar .side-section {
  background: transparent;
  border: none;
}

.side-title {
  border-radius: 4px 4px 0 0;
  background: #f0f1f2;
  color: #8b9095;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}
.side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  color: #4a4f54;
  font-size: 12px;
  border-left: 3px solid transparent;
}
.side-item:hover { background: #f6f8fa; text-decoration: none; }
.side-item.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--blue-dark);
}
.side-item.plain { color: var(--blue); font-weight: 600; }
.friends { padding: 4px 10px; font-size: 12px; color: #555; }
.friends-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0;
}
.friends-head .muted { color: #9a9a9a; font-weight: normal; }
.friends-notice {
  background: #fff8dc;
  border: 1px solid #e8dca0;
  border-radius: 4px;
  padding: 9px 10px;
  margin: 8px 10px 0;
  font-size: 11px;
  color: #5a5230;
}
.see-friends {
  display: inline-block;
  margin: 8px 10px 10px;
  font-size: 11px;
}
.online-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3ac47d;
  margin-right: 5px;
}

/* ---------- Composeur ---------- */
.composer { padding: 8px; }
.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}
.composer-link {
  border: none;
  background: none;
  color: #2f6fd0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.composer-link .ico {
  filter: grayscale(1);
  opacity: .75;
}
.composer-link .bulb-ico {
  filter: none;
  opacity: 1;
}
.composer-link:hover { text-decoration: underline; }
.composer-link.right {
  margin-left: auto;
  color: #2f6fd0;
}
.composer-link.right .ico {
  filter: grayscale(1);
  opacity: .75;
}
.settings-wrap { position: relative; margin-left: auto; }
.settings-wrap .composer-link.right { margin-left: 0; }
.settings-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  padding: 10px 12px;
  z-index: 40;
}
.settings-arrow {
  position: absolute;
  top: -7px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  transform: rotate(45deg);
}
.settings-title {
  font-weight: 700;
  font-size: 12px;
  color: #444;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #444;
  white-space: nowrap;
  cursor: pointer;
  padding: 4px 2px;
}
.settings-row:hover { background: #f4f7fb; }
.settings-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  flex: none;
  margin: 0;
  border: 1px solid #999;
  background: #fff;
  border-radius: 0;
  position: relative;
  cursor: pointer;
}
.settings-row input[type="checkbox"]:checked {
  background: var(--blue);
  border-color: var(--blue-dark);
}
.settings-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.icon-only {
  border: none; background: none; cursor: pointer;
  font-size: 16px; line-height: 1;
}
.composer textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-top: 8px;
  padding: 8px;
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
}
.composer textarea:focus { outline: 2px solid rgba(59,130,246,.35); outline-offset: 0; }

/* ---------- Post ---------- */
.post-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 10px 6px;
}
.avatar {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 3px;
  display: grid; place-items: center;
  font-size: 18px;
  flex: none;
}
.avatar-small { width: 30px; height: 30px; font-size: 14px; }
.avatar-brown { background: #c9a227; }
.avatar-orange { background: #f39c12; }
.avatar-green { background: #27ae60; }
.post-author { flex: 1; }
.author-name { font-size: 14px; font-weight: 600; color: var(--blue); }
.star { color: #f1c40f; }
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-left: 3px;
}
.dot.blue { background: #3498db; }
.dot.red { background: #e74c3c; }
.date { color: var(--muted); font-size: 11px; margin-top: 2px; }
.post-menu {
  border: none; background: none; cursor: pointer;
  color: #888; font-size: 14px; padding: 2px 6px;
}
.post-body { padding: 4px 10px 8px; }
.post-body p { margin-bottom: 6px; }
.cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  background: #cfe3ee;
}
.hashtag { color: var(--blue); font-weight: 600; margin-top: 8px !important; }
.album {
  background: #2b2b2b;
  color: #fff;
  padding: 6px 9px;
  font-size: 12px;
  margin-top: 6px;
}
.album a { color: #6fb1ff; }

.post-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-top: 1px solid #eee;
  color: #777;
  font-size: 11px;
}
.post-stats-right { display: flex; gap: 14px; }
.post-stats a { color: #666; }
.dislike { color: #999 !important; }

/* ---------- Commentaires ---------- */
.comments { padding: 0 10px 8px; }
.comment { display: flex; gap: 8px; }
.bubble {
  background: none;
  border: none;
  padding: 0;
  display: inline;
  max-width: 100%;
}
.bubble b { color: var(--blue); }
.comment-meta {
  display: flex;
  gap: 14px;
  padding: 5px 4px 0;
  color: var(--muted);
  font-size: 11px;
}
.like-comment {
  color: var(--blue);
  margin-left: 6px;
  white-space: nowrap;
}
.like-comment .ico { margin-left: 4px; }

.comment-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}
.comment-box input,
.comment-input {
  flex: 1;
  min-width: 140px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 5px !important;
  font-size: 12px;
  background: #fff;
  line-height: 18px;
  outline: none;
  overflow-y: auto;
}
.comment-input:empty::before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}
.comment-input .msn-emoji { width: 16px; height: 16px; vertical-align: -3px; }
#composer-text { min-height: 72px; }
.composer-emoji-row { justify-content: flex-end; margin-top: 6px; }
.emoji-row { display: flex; align-items: center; gap: 3px; font-size: 15px; }
.emoji-pick { cursor: pointer; }
.emoji-pick:hover { transform: scale(1.18); }
.plus-btn {
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: var(--red); color: #fff;
  cursor: pointer; font-size: 11px;
}
.reply-btn { margin-left: auto; }
.new-post { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Cartes de la colonne droite : leger arrondi */
.rightbar .card {
  border-radius: 6px !important;
}

/* Carte Bienvenue (colonle droite) */
.quick-links { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.quick-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  background: none;
  border: none;
  border-radius: 0;
  font-weight: 600;
  font-size: 12px;
  color: #3d4a55;
}
.quick-links a:hover { text-decoration: underline; }
.welcome .card-body p { margin-bottom: 8px; color: #555; }

/* ---------- Colonne droite ---------- */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  background: #f0f1f2;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 12px;
}
.card-head.blue { background: #dff0f5; color: #266b80; border-bottom-color: #bfe0e8; }
.mini-link {
  border: none; background: #5bc0de; color: #fff;
  padding: 2px 6px; border-radius: 3px;
  font-size: 10px; cursor: pointer;
}
.card-body { padding: 10px; font-size: 12px; }
.annonce-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.annonce-head > div:nth-child(2) { flex: 1; }
.annonce-title { font-weight: 700; font-size: 13px; }
.annonce-text p { margin-bottom: 8px; color: #444; }

/* ---------- Elements listes : arrondi discret ---------- */
.card,
.btn,
.top-btn,
.avatar,
.album,
.cover,
.bubble {
  border-radius: 4px !important;
}

/* ---------- Zones de saisie : carrees, sans style ---------- */
input,
textarea {
  border-radius: 0 !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}
.composer textarea {
  border-radius: 4px !important;
}
.composer textarea:focus,
.comment-input:focus,
.comment-box input:focus {
  outline: none;
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .18);
}
.login-card input:focus,
#global-search:focus {
  outline: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 160px minmax(0, 1fr); }
  .rightbar { grid-column: 1 / -1; }
  .search-bar { width: 40vw; }
}
@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; }
  .leftbar { display: none; }
  .top-actions .top-btn span { display: none; }
  .site-name { font-size: 16px; }
  .search-bar { width: 45vw; }
  .search-menu { display: none; }
}
