/* ============================================================
   DjibContact - Fiche publique (Design Premium)
   ============================================================ */

.profile { 
  padding-bottom: 100px; 
  background: var(--c-bg);
}

/* ---------- Bannière (Hero) avec effet de profondeur ---------- */
.profile__cover {
  height: 320px;
  background-size: cover;
  background-position: center;
  position: relative;
}
/* Ajout d'un dégradé superposé pour adoucir la transition avec le fond */
.profile__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--c-bg) 100%);
  pointer-events: none;
}

.profile__cover--fallback {
  background:
    radial-gradient(circle at 10% 20%, rgba(34,211,238,0.4), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(124,58,237,0.4), transparent 40%),
    linear-gradient(135deg, #0f172a, #1e293b);
}
.profile__cover--fallback::after {
  background: linear-gradient(to bottom, transparent 20%, var(--c-bg) 100%);
}

/* ---------- Conteneur (Chevauchement fort) ---------- */
.profile__container {
  max-width: 900px;
  position: relative;
  margin-top: -120px; /* Remonte beaucoup plus sur la bannière */
  padding: 0 20px;
  z-index: 10;
}

/* ---------- Barre "Propriétaire" (Effet Glassmorphism) ---------- */
.profile__owner-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  margin: 0 auto 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text);
  max-width: fit-content;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}
@media (prefers-color-scheme: dark) {
  .profile__owner-bar {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* ---------- Carte Principale (Head) ---------- */
.profile__head {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 32px; /* Coins beaucoup plus arrondis */
  padding: 60px 40px 40px;
  text-align: center;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.02);
  position: relative;
}
@media (prefers-color-scheme: dark) {
  .profile__head {
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
  }
}

/* ---------- Avatar (Effet "Floating") ---------- */
.profile__avatar {
  position: relative;
  width: 150px; 
  height: 150px;
  margin: -115px auto 20px; /* Remonte pour flotter au-dessus de la carte */
  border-radius: 50%;
  padding: 4px; /* Espace pour l'anneau */
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); /* Anneau dégradé */
  box-shadow: 0 10px 25px rgba(8, 145, 178, 0.3);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.profile__avatar:hover {
  transform: scale(1.05) translateY(-5px);
}
.profile__avatar img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  border-radius: 50%;
  border: 4px solid var(--c-bg-alt); /* Bordure blanche/fond pour séparer du dégradé */
  background: var(--c-bg-alt);
}

.profile__verified {
  position: absolute; bottom: 4px; right: 4px;
  width: 36px; height: 36px; border-radius: 50%;
  background: #10b981; /* Vert émeraude pour le badge vérifié */
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800;
  border: 4px solid var(--c-bg-alt);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

/* ---------- Typographie ---------- */
.profile__name {
  font-size: 2.2rem; 
  margin: 0 0 12px;
  display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap;
  justify-content: center;
  letter-spacing: -0.03em; /* Resserre un peu les lettres pour un look moderne */
}

.profile__type {
  font-size: 0.75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(8,145,178,0.15), rgba(124,58,237,0.15));
  color: var(--c-primary);
  border: 1px solid rgba(8,145,178,0.2);
}

.profile__sector {
  color: var(--c-text-soft); 
  margin: 0 0 16px;
  font-weight: 600; 
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.profile__cats {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  list-style: none; padding: 0; margin: 20px 0;
}
.badge--cat {
  background: var(--c-bg-soft);
  color: var(--c-text-soft);
  border: 1px solid var(--c-border);
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}
.badge--cat:hover {
  background: var(--c-bg-alt);
  border-color: var(--c-primary-light);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm);
}

.profile__bio {
  color: var(--c-text-soft);
  max-width: 650px; 
  margin: 16px auto 24px;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-line;
}

/* ---------- Meta (Téléphone, Ville) ---------- */
.profile__meta {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  justify-content: center;
  font-size: 0.95rem; color: var(--c-text-soft);
}
.profile__meta li { 
  display: inline-flex; align-items: center; gap: 8px; 
  background: var(--c-bg-soft);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
}
.profile__meta a { color: var(--c-text-soft); font-weight: 500; }
.profile__meta a:hover { color: var(--c-primary); }

.profile__quick-actions {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--c-border); /* Séparation claire avec le reste */
}

/* ============================================================
   BODY LAYOUT (Grille)
   ============================================================ */
.profile__body {
  display: grid; grid-template-columns: 1fr 340px; /* Un peu plus large à droite */
  gap: 32px; margin-top: 32px;
  align-items: start;
}
.profile__links { min-width: 0; }
.profile__aside { display: flex; flex-direction: column; gap: 24px; }

@media (max-width: 850px) {
  .profile__body { grid-template-columns: 1fr; }
}

/* ============================================================
   BOUTONS DE LIENS (Style "App" Moderne)
   ============================================================ */
.link-list {
  display: flex; flex-direction: column; gap: 14px;
}

.link-btn {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px;
  background: var(--brand-bg, var(--c-bg-alt));
  border: 2px solid transparent; /* On prépare la bordure pour le hover */
  border-radius: 20px; /* Coins très arrondis */
  color: var(--c-text);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

/* Effet de barre latérale colorée au survol */
.link-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--brand-color, var(--c-primary));
  opacity: 0.5;
  transition: opacity 0.3s ease, width 0.3s ease;
}

.link-btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 20px -8px var(--brand-color, rgba(0,0,0,0.15));
  border-color: var(--brand-color, var(--c-border));
  background: var(--c-bg-alt); /* Le fond s'éclaircit au survol */
}
.link-btn:hover::before {
  opacity: 1;
  width: 100%; /* Remplit tout le bouton d'un coup */
  z-index: 0;
}

/* On s'assure que le texte reste au-dessus de l'effet de fond */
.link-btn > * { position: relative; z-index: 1; }

.link-btn__icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand-color, var(--c-primary));
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
}
.link-btn:hover .link-btn__icon {
  transform: scale(1.1) rotate(5deg);
  background: #fff;
}

.link-btn__label {
  flex: 1; font-size: 1.05rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--c-text);
  transition: color 0.3s ease;
}
.link-btn:hover .link-btn__label {
  color: var(--brand-color, var(--c-primary));
}

.link-btn__arrow {
  font-size: 1.2rem; color: var(--c-text-muted);
  transition: all 0.3s ease;
}
.link-btn:hover .link-btn__arrow { 
  color: var(--brand-color, var(--c-primary)); 
  transform: translateX(4px); 
}

/* --- APPLICATION DES COULEURS PAR RÉSEAU --- */
.link-btn[data-type^="whatsapp"] { --brand-color: #25D366; --brand-bg: rgba(37, 211, 102, 0.05); }
.link-btn[data-type^="facebook"] { --brand-color: #1877F2; --brand-bg: rgba(24, 119, 242, 0.05); }
.link-btn[data-type="instagram"] { --brand-color: #E4405F; --brand-bg: rgba(228, 64, 95, 0.05); }
.link-btn[data-type="tiktok"] { --brand-color: #000; --brand-bg: rgba(0, 0, 0, 0.04); }
.link-btn[data-type^="telegram"] { --brand-color: #26A5E4; --brand-bg: rgba(38, 165, 228, 0.05); }
.link-btn[data-type="youtube"] { --brand-color: #FF0000; --brand-bg: rgba(255, 0, 0, 0.05); }
.link-btn[data-type="linkedin"] { --brand-color: #0A66C2; --brand-bg: rgba(10, 102, 194, 0.05); }
.link-btn[data-type="x_twitter"] { --brand-color: #000; --brand-bg: rgba(0, 0, 0, 0.04); }

/* Fallback mode sombre pour TikTok/X */
@media (prefers-color-scheme: dark) {
  .link-btn[data-type="tiktok"], .link-btn[data-type="x_twitter"] { 
    --brand-color: #fff; --brand-bg: rgba(255, 255, 255, 0.05); 
  }
}

/* Cas particulier Instagram (dégradé) */
.link-btn[data-type="instagram"] .link-btn__icon {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-color: #fff;
}

/* ============================================================
   CARTES LATÉRALES (QR, Info)
   ============================================================ */
.qr-card, .info-card {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.03);
}
.qr-card h3, .info-card h3 { 
  font-size: 0.9rem; margin: 0 0 16px; 
  text-transform: uppercase; letter-spacing: 0.08em; 
  color: var(--c-text-muted);
  font-weight: 700;
}

.qr-card img {
  display: block; margin: 0 auto 16px;
  border-radius: 16px; 
  background: #fff; 
  padding: 12px;
  width: 100%; max-width: 200px; height: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.qr-card__url {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  word-break: break-all;
  margin: 0 0 16px;
  font-family: ui-monospace, monospace;
  background: var(--c-bg-soft);
  padding: 8px 12px;
  border-radius: 8px;
}

.info-card dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.info-card dt { font-size: 0.85rem; color: var(--c-text-muted); }
.info-card dd { margin: 0; font-weight: 700; font-size: 0.95rem; text-align: right; }

/* ============================================================
   GALERIE PUBLIQUE
   ============================================================ */
.profile__gallery {
  margin-top: 40px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.03);
}
.profile__gallery h2 {
  font-size: 1.05rem; margin: 0 0 20px;
  text-transform: uppercase; letter-spacing: 0.08em; 
  color: var(--c-text-muted);
  font-weight: 700;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.gallery__item {
  border: none; padding: 0; background: var(--c-bg-soft);
  cursor: zoom-in; overflow: hidden;
  border-radius: 16px;
  position: relative;
  aspect-ratio: 1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.1);
}
.gallery__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery__item:hover img { transform: scale(1.08); }

/* ============================================================
   FOOTER
   ============================================================ */
.profile__footer {
  text-align: center;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--c-border);
  color: var(--c-text-muted);
  font-size: 0.9rem;
}

/* ============================================================
   RESPONSIVE (Mobile)
   ============================================================ */
@media (max-width: 768px) {
  .profile__cover { height: 220px; }
  .profile__container { margin-top: -90px; padding: 0 16px; }
  .profile__head { padding: 50px 20px 30px; border-radius: 24px; }
  
  .profile__avatar { 
    width: 120px; height: 120px; 
    margin-top: -85px; 
  }
  .profile__name { font-size: 1.8rem; }
  .profile__bio { font-size: 0.95rem; }
  
  .link-btn { padding: 16px; border-radius: 16px; }
  .link-btn__label { font-size: 0.95rem; }
  
  .qr-card, .info-card, .profile__gallery { padding: 20px; border-radius: 20px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}