/* ============================================================
   sports-news – profil.css (mobile-first)
   ============================================================ */

/* ─── Profile card ───────────────────────────────────────────── */
.profil-main {
  padding-bottom: 80px;
}

.profil-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 4px;
}

/* ─── Banner ─────────────────────────────────────────────────── */
.profil-banner {
  width: 100%;
  height: 160px;
  background: linear-gradient(180deg, #1C1C1C 0%, #111111 100%);
  position: relative;
  overflow: hidden;
}

@media (min-width: 600px) {
  .profil-banner { height: 200px; }
}

.profil-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profil-banner-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.15;
}

/* ─── Avatar row ─────────────────────────────────────────────── */
.profil-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 16px 0;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.profil-avatar-wrap {
  position: relative;
}

.profil-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  flex-shrink: 0;
}

.profil-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

@media (min-width: 600px) {
  .profil-header { margin-top: -50px; }
  .profil-avatar { width: 100px; height: 100px; font-size: 36px; }
}

/* ─── Action buttons ─────────────────────────────────────────── */
.profil-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profil-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.profil-btn-edit {
  background: transparent;
  border: 1.5px solid var(--border-focus);
  color: var(--primary);
}
.profil-btn-edit:hover {
  background: var(--primary-glow);
}

.profil-btn-follow {
  background: var(--primary);
  border: 1.5px solid var(--primary);
  color: white;
}
.profil-btn-follow:hover {
  background: var(--primary-dark);
}

.profil-btn-follow.following {
  background: transparent;
  border-color: var(--border-focus);
  color: var(--primary);
}
.profil-btn-follow.following:hover {
  border-color: var(--error);
  color: var(--error);
}

.profil-btn-share {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.profil-btn-share:hover {
  border-color: var(--border-focus);
  color: var(--primary);
}

/* ─── Profile info ───────────────────────────────────────────── */
.profil-info {
  padding: 10px 16px 14px;
}

.profil-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profil-name {
  font-size: 20px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  color: var(--text-1);
  margin: 0;
}

/* Subscription badge */
.profil-subscription {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.profil-subscription.gratuit {
  background: rgba(107,114,128,0.2);
  color: var(--text-3);
}
.profil-subscription.premium {
  background: rgba(245,158,11,0.18);
  color: #F59E0B;
}
.profil-subscription.vip {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
}

.profil-pseudo {
  font-size: 14px;
  color: var(--text-4);
  margin-top: 2px;
}

.profil-bio {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.profil-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.profil-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-4);
}

.profil-meta-item a {
  color: var(--primary);
  text-decoration: none;
}
.profil-meta-item a:hover {
  text-decoration: underline;
}

/* ─── Sport tags ─────────────────────────────────────────────── */
.profil-sports {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.profil-sport-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ─── Stats row ──────────────────────────────────────────────── */
.profil-stats {
  display: flex;
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px;
  gap: 0;
}

.profil-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.profil-stat:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
}

.profil-stat-num {
  font-size: 18px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  color: var(--text-1);
}

.profil-stat-label {
  font-size: 11px;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ─── Content tabs ───────────────────────────────────────────── */
.profil-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: 8px;
}
.profil-tabs::-webkit-scrollbar { display: none; }

.profil-tab {
  flex: none;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--text-4);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.profil-tab:hover {
  color: var(--text-2);
}

.profil-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profil-subtabs {
  display: flex;
  gap: 8px;
  padding: 0 0 12px;
  margin-top: -4px;
  margin-bottom: -15px;
  position: relative;
}

.profil-subtab {
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-3);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.profil-subtab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Tab feed ───────────────────────────────────────────────── */
#profil-feed {
  touch-action: pan-y;
  min-height: 200px;
  padding-top: 12px;
}

.profil-feed-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-4);
}

.profil-feed-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.profil-feed-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-3);
}

/* ─── Stat modal (abonnés / abonnements) ────────────────────── */
.stat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}
.stat-modal-overlay.open {
  display: flex;
}
.stat-modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.stat-modal-title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--text-1);
  margin: 0;
}
.stat-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-2);
  border: none;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-modal-close:hover { background: var(--bg-3); }
.stat-modal-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.stat-modal-loading,
.stat-modal-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-4);
  font-size: 14px;
}
.stat-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.stat-user-item:hover { background: var(--bg-2); }
.stat-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  flex-shrink: 0;
}
.stat-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stat-user-info { flex: 1; min-width: 0; }
.stat-user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-user-handle {
  font-size: 12px;
  color: var(--text-4);
}

/* ─── Edit modal ─────────────────────────────────────────────── */
.edit-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 0;
}

.edit-modal-overlay.open {
  display: flex;
}

.edit-modal {
  background: var(--bg-1);
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  position: relative;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Mobile : le body scrolle avec l'overlay */
.edit-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .edit-modal-overlay {
    padding: 40px 16px;
    align-items: flex-start;
    overflow: hidden;
  }
  .edit-modal {
    min-height: unset;
    max-height: calc(100vh - 80px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    overflow: hidden;
  }
  /* Desktop : seul le body scrolle, le header reste en haut */
  .edit-modal-body {
    overflow-y: auto;
    flex: 1;
  }
}

.edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  flex-shrink: 0;
}

.edit-modal-title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--text-1);
}

.edit-modal-back {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.edit-modal-back:hover { background: var(--bg-2); }

.edit-modal-save {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}
.edit-modal-save:hover { background: var(--primary-dark); }
.edit-modal-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* Banner + avatar edit */
.edit-banner-preview {
  width: 100%;
  height: 130px;
  background: linear-gradient(180deg, #1C1C1C 0%, #111111 100%);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.edit-banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-banner-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  opacity: 0.2;
}

.edit-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(0,0,0,0.4);
  cursor: pointer;
  transition: opacity var(--transition);
  opacity: 0;
}
.edit-banner-preview:hover .edit-image-overlay { opacity: 1; }

.edit-avatar-preview-wrap {
  position: relative;
  width: 72px;
  margin: -36px 0 0 16px;
  z-index: 2;
}

.edit-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--bg-1);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  cursor: pointer;
}

.edit-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.edit-avatar-camera {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(0,0,0,0.45);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}
.edit-avatar-preview-wrap:hover .edit-avatar-camera { opacity: 1; }

/* Form fields */
.edit-form {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edit-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.edit-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-size: 14px;
  transition: border-color var(--transition);
}
.edit-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
}

.edit-pseudo-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
}
.edit-pseudo-wrap:focus-within { border-color: var(--border-focus); }

.edit-pseudo-at {
  padding: 0 0 0 14px;
  font-size: 14px;
  color: var(--text-4);
  user-select: none;
}

.edit-pseudo-input {
  background: transparent;
  border: none;
  flex: 1;
}
.edit-pseudo-input:focus { border: none; background: transparent; }

.edit-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-size: 14px;
  resize: none;
  line-height: 1.5;
  transition: border-color var(--transition);
}
.edit-textarea:focus { border-color: var(--border-focus); }

.edit-char-count {
  font-size: 11px;
  color: var(--text-4);
  text-align: right;
}

.edit-hint {
  font-size: 11px;
  color: var(--text-4);
}

.edit-error {
  margin: 0 16px 16px;
  padding: 10px 14px;
  background: var(--error-glow);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  color: var(--error);
  font-size: 13px;
}

/* ─── Post card (shared in profile tabs) ────────────────────── */
.profil-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 8px;
  transition: background var(--transition);
  cursor: pointer;
}

.profil-post-card:hover {
  background: var(--bg-card-hover);
}

.profil-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.profil-post-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  flex-shrink: 0;
}

.profil-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profil-post-author {
  flex: 1;
  min-width: 0;
}

.profil-post-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profil-post-handle {
  font-size: 12px;
  color: var(--text-4);
}

.profil-post-date {
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
}

.profil-post-content {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.profil-post-image {
  width: 100%;
  border-radius: var(--radius-md);
  max-height: 300px;
  object-fit: cover;
  margin-bottom: 10px;
}

.profil-post-footer {
  display: flex;
  gap: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.profil-post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-4);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--transition);
  font-family: inherit;
}
.profil-post-action:hover { color: var(--primary); }
.profil-post-action.liked { color: #EF4444; }


/* ─── Reply highlighted comment ─────────────────────────────── */
.profil-reply-highlight {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
}

/* ─── Responsive adjustments ─────────────────────────────────── */
@media (max-width: 480px) {
  .profil-name { font-size: 17px; }
  .profil-tab { padding: 12px 14px; font-size: 12px; }
}

/* ─── Private badge ─────────────────────────────────── */
.profil-private-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: 8px;
}

/* ─── Follow request button ─────────────────────────── */
.profil-btn-pending {
  background: var(--bg-2) !important;
  color: var(--text-3) !important;
  border: 1px solid var(--border) !important;
  cursor: pointer;
}
.profil-btn-pending:hover {
  background: var(--bg-3) !important;
  color: var(--error) !important;
  border-color: var(--error) !important;
}

/* ─── Follow requests section ──────────────────────── */
.follow-requests-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.follow-requests-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.follow-requests-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}

.follow-requests-count {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 8px;
  min-width: 20px;
  text-align: center;
}

.follow-request-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.follow-request-item:last-child { border-bottom: none; }

.follow-request-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.follow-request-avatar img { width: 100%; height: 100%; object-fit: cover; }

.follow-request-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.follow-request-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.follow-request-handle {
  font-size: 12px;
  color: var(--text-4);
}

.follow-request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.follow-request-accept {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.follow-request-accept:hover { opacity: 0.85; }

.follow-request-reject {
  background: var(--bg-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.follow-request-reject:hover { background: var(--error-glow); color: var(--error); border-color: var(--error); }

/* ─── Toggle switch ──────────────────────────────────── */
.edit-field-toggle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.edit-field-toggle .edit-label { margin-bottom: 0; min-width: 120px; }
.edit-field-toggle .edit-hint { width: 100%; margin-top: 0; }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid var(--border);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-3);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

/* ─── Private locked content ─────────────────────────── */
.profil-locked {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-4);
}
.profil-locked-icon { font-size: 48px; margin-bottom: 12px; }
.profil-locked-title { font-size: 18px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.profil-locked-text { font-size: 14px; line-height: 1.5; }

