/* ==========================================
   Avatar & Menu utilisateur
   ========================================== */

.logo-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  position: relative;
  z-index: 100;
}

.avatar-container {
  position: relative;
}

.avatar-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 0;
}

.avatar-btn:hover {
  transform: scale(1.05);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.avatar-initials {
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.avatar-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: #1a1d24;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  min-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  overflow: hidden;
  z-index: 1000;
}

.avatar-menu-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #667eea22 0%, #764ba222 100%);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.avatar-menu-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.avatar-menu-email {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

.avatar-menu hr {
  margin: 0;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.avatar-menu-item {
  display: block;
  padding: 0.875rem 1.25rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background 0.2s ease;
  font-size: 0.95rem;
}

.avatar-menu-item:hover {
  background: rgba(255,255,255,0.05);
  color: #ffffff;
}

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 3rem auto;
  max-width: 900px;
}

.service-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.service-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.service-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.service-desc {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Loading state */
[data-identity-loading="true"] .avatar-container {
  opacity: 0;
}

/* === LOADER ÉLÉGANT === */

/* Masquer tout le contenu pendant le chargement */
[data-identity-loading="true"] #content-visitor,
[data-identity-loading="true"] #content-member {
    opacity: 0;
    pointer-events: none;
}

/* Loader simple et discret */
[data-identity-loading="true"]::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 9999;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Transitions fluides après chargement */
#content-visitor,
#content-member {
    transition: opacity 0.3s ease-in-out;
}

/* Avatar apparaît en douceur */
.avatar-container {
    transition: opacity 0.3s ease-in-out;
}
