/* REWEAR DZ — Profile Page */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  background: radial-gradient(ellipse at top right, #EADBC8, #3E2A1F);
  color: #f5e6d3;
}

/* ── HEADER ── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(61, 40, 23, 0.95);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo.gradient-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #d4a574, #f4e5c2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.nav-right { display: flex; gap: 0.5rem; align-items: center; }
.nav-right a.nav-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: #f5e6d3;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(212, 165, 116, 0.4);
  background: rgba(212, 165, 116, 0.1);
}
.nav-right a.nav-btn:hover { background: rgba(212, 165, 116, 0.25); }

/* ── PAGE LAYOUT ── */
.page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── PROFILE CARD ── */
.profile-card {
  background: rgba(61, 40, 23, 0.75);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  backdrop-filter: blur(8px);
}
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a574, #f4e5c2);
  color: #3d2817;
  font-size: 2.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(212, 165, 116, 0.5);
  user-select: none;
}
.avatar-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  background: #5cb85c;
  border-radius: 50%;
  border: 2px solid #3d2817;
}
.profile-info { flex: 1; }
.profile-info h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f4e5c2;
  margin-bottom: 0.25rem;
}
.profile-info .email {
  font-size: 0.875rem;
  color: #c89b5f;
  margin-bottom: 0.75rem;
}
.profile-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.meta-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #d4a574;
  background: rgba(212, 165, 116, 0.12);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}
.meta-chip .icon { font-size: 0.9rem; }
.profile-actions { display: flex; flex-direction: column; gap: 0.5rem; flex-shrink: 0; }
.btn-edit {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  background: rgba(212, 165, 116, 0.15);
  border: 1px solid rgba(212, 165, 116, 0.4);
  color: #f4e5c2;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-edit:hover { background: rgba(212, 165, 116, 0.28); }
.btn-logout {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  background: rgba(220, 80, 80, 0.15);
  border: 1px solid rgba(220, 80, 80, 0.35);
  color: #e07070;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-logout:hover { background: rgba(220, 80, 80, 0.28); }

/* ── STATS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.stat-card {
  background: rgba(61, 40, 23, 0.75);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  backdrop-filter: blur(6px);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #d4a574, #f4e5c2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.stat-label { font-size: 0.8rem; color: #c89b5f; }

/* ── SECTION ── */
.section {
  background: rgba(61, 40, 23, 0.75);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(212, 165, 116, 0.15);
}
.section-header h2 { font-size: 1rem; font-weight: 700; color: #f4e5c2; }
.btn-publish-sm {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #d4a574, #f4e5c2);
  color: #3d2817;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

/* ── ARTICLES GRID ── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}
.article-card {
  background: rgba(81, 54, 32, 0.8);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(212, 165, 116, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.3); }
.article-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.article-card-img-placeholder {
  width: 100%;
  height: 140px;
  background: rgba(212, 165, 116, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.article-card-body { padding: 0.75rem; }
.article-card-body h4 {
  font-size: 0.85rem;
  color: #f4e5c2;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-card-body .price { font-weight: 700; font-size: 0.95rem; color: #d4a574; }
.article-card-body .etat { font-size: 0.72rem; color: #c89b5f; margin-top: 0.2rem; }
.article-card-actions { display: flex; gap: 0.4rem; padding: 0 0.75rem 0.75rem; }
.btn-card-sm {
  flex: 1;
  padding: 0.35rem 0;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}
.btn-card-sm:hover { opacity: 0.85; }
.btn-card-edit {
  background: rgba(212, 165, 116, 0.2);
  color: #f4e5c2;
  border: 1px solid rgba(212, 165, 116, 0.3) !important;
}
.btn-card-delete {
  background: rgba(220, 80, 80, 0.2);
  color: #e07070;
  border: 1px solid rgba(220, 80, 80, 0.3) !important;
}

/* ── EMPTY / LOADING ── */
.empty-state { padding: 3rem 1rem; text-align: center; color: #c89b5f; }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; margin-bottom: 1rem; }
.loading-state { padding: 2rem; text-align: center; color: #c89b5f; font-size: 0.9rem; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: rgba(61, 40, 23, 0.98);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  transform: translateY(-12px);
  transition: 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { font-size: 1.1rem; color: #f4e5c2; margin-bottom: 1.25rem; font-weight: 700; }
.modal-field { margin-bottom: 1rem; }
.modal-field label { display: block; font-size: 0.8rem; color: #c89b5f; margin-bottom: 0.4rem; }
.modal-field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 165, 116, 0.3);
  background: rgba(255,255,255,0.06);
  color: #f4e5c2;
  font-size: 0.9rem;
  outline: none;
}
.modal-field input:focus { border-color: rgba(212, 165, 116, 0.7); }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.btn-modal-cancel {
  flex: 1; padding: 0.6rem; border-radius: 8px;
  background: rgba(212, 165, 116, 0.1);
  border: 1px solid rgba(212, 165, 116, 0.3);
  color: #f4e5c2; font-weight: 600; cursor: pointer;
}
.btn-modal-save {
  flex: 1; padding: 0.6rem; border-radius: 8px;
  background: linear-gradient(135deg, #d4a574, #f4e5c2);
  border: none; color: #3d2817; font-weight: 700; cursor: pointer;
}
.modal-error { font-size: 0.8rem; color: #e07070; margin-top: 0.5rem; display: none; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: rgba(61, 40, 23, 0.97);
  border: 1px solid rgba(212, 165, 116, 0.4);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  color: #f4e5c2;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: 0.3s;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(92, 184, 92, 0.5); }
.toast.error { border-color: rgba(220, 80, 80, 0.5); color: #e07070; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .profile-card { flex-direction: column; gap: 1rem; }
  .profile-actions { flex-direction: row; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .stat-num { font-size: 1.4rem; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .stats-row { grid-template-columns: 1fr; }
}/* chips cliquables */
a.meta-chip {
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
a.meta-chip:hover { background: rgba(212, 165, 116, 0.25); color: #f4e5c2; }
.meta-chip--insta { border-color: rgba(225, 100, 150, 0.35); color: #e19abf; }
/* ── Social chips ── */
.social-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(212, 165, 116, 0.12);
  border: 1px solid rgba(212, 165, 116, 0.3);
  color: #d4a574;
  text-decoration: none;
  transition: 0.2s;
  white-space: nowrap;
}
.meta-chip:hover { background: rgba(212,165,116,0.22); color: #f4e5c2; }
.meta-chip--insta { border-color: rgba(225,100,150,0.35); color: #e19abf; background: rgba(225,100,150,0.08); }
.meta-chip--insta:hover { background: rgba(225,100,150,0.18); }
.meta-chip--fb { border-color: rgba(66,103,200,0.4); color: #8aabf0; background: rgba(66,103,200,0.08); }
.meta-chip--fb:hover { background: rgba(66,103,200,0.18); }
.meta-chip--empty { color: #a07850; border-style: dashed; cursor: default; }

/* ── Favoris grid ── */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.fav-card {
  background: rgba(61, 40, 23, 0.75);
  border: 1px solid rgba(212, 165, 116, 0.18);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.fav-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.fav-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.fav-card-body {
  padding: 0.6rem 0.75rem;
}
.fav-card-body h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f4e5c2;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-card-body .fav-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: #d4a574;
}
.btn-unfav {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(61,40,23,0.85);
  border: 1px solid rgba(220,80,80,0.4);
  color: #e07070;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.btn-unfav:hover { background: rgba(220,80,80,0.2); }
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #a07850;
  font-size: 0.88rem;
}