/* ============================================================
   AlbumBuilder PRO — profilo.css
   ============================================================ */

.profilo-main { padding-top: 72px; min-height: 100vh; }

/* Loading spinner */
.profilo-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 72px);
}
.profilo-spinner {
  width: 40px; height: 40px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── HERO ── */
.profilo-hero {
  position: relative;
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}
.profilo-hero-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 80% at 30% 50%, rgba(174,135,68,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.profilo-hero-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

/* Avatar */
.profilo-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.profilo-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--gradient-gold);
  color: #000;
  font-size: 2.2rem;
  font-weight: var(--font-weight-bold);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 40px rgba(174,135,68,0.3);
  position: relative; z-index: 1;
}
.profilo-avatar-ring {
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1.5px solid rgba(174,135,68,0.35);
  animation: ring-pulse 3s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 0.9; transform: scale(1.05); }
}

/* Info hero */
.profilo-hero-info { flex: 1; min-width: 200px; }
.profilo-plan-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  background: rgba(174,135,68,0.1);
  border: 1px solid rgba(174,135,68,0.25);
  color: var(--color-gold-light);
}
.profilo-nome {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: var(--font-weight-bold);
  margin-bottom: 4px;
  background: var(--gradient-gold-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.profilo-email-display {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.profilo-membro {
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

/* Stats hero */
.profilo-hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px 28px;
  flex-shrink: 0;
}
.profilo-stat {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 0 24px;
}
.profilo-stat:first-child { padding-left: 0; }
.profilo-stat:last-child  { padding-right: 0; }
.profilo-stat-val {
  font-size: 1.6rem;
  font-weight: var(--font-weight-bold);
  background: var(--gradient-gold-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.profilo-stat-label {
  font-size: 0.72rem;
  color: var(--color-text-dim);
  white-space: nowrap;
}
.profilo-stat-divider {
  width: 1px; height: 40px;
  background: var(--color-border);
}

/* ── BODY GRID ── */
.profilo-body { padding: 48px 0 80px; }
.profilo-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}

/* ── CARD ── */
.profilo-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
}
.profilo-card-full { margin-bottom: 0; }
.profilo-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.profilo-card-header svg { color: var(--color-gold); }
.profilo-card-header h2 {
  font-size: 1rem;
  font-weight: var(--font-weight-semi);
  color: var(--color-text);
}
.profilo-card-header-row {
  justify-content: space-between;
}
.profilo-card-title-wrap {
  display: flex; align-items: center; gap: 10px;
}
.profilo-count-badge {
  font-size: 0.76rem;
  color: var(--color-text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ── FORM PROFILO ── */
.profilo-form { display: flex; flex-direction: column; gap: 16px; }
.profilo-field { display: flex; flex-direction: column; gap: 6px; }
.profilo-label {
  font-size: 0.8rem;
  font-weight: var(--font-weight-semi);
  color: var(--color-text-muted);
}
.profilo-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.profilo-input::placeholder { color: var(--color-text-dim); }
.profilo-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(174,135,68,0.1);
  background: rgba(174,135,68,0.03);
}
.profilo-email-lock {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  font-size: 0.88rem;
  color: var(--color-text-dim);
  cursor: not-allowed;
}
.profilo-email-lock svg { color: var(--color-text-dim); flex-shrink: 0; }
.profilo-error {
  font-size: 0.78rem;
  color: #f87171;
  min-height: 16px;
}
.profilo-card .btn { width: 100%; justify-content: center; }

/* ── CRONOLOGIA ── */
.cronologia-filters {
  display: flex; gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cf-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: none;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}
.cf-btn:hover { border-color: var(--color-gold-dark); color: var(--color-text); }
.cf-btn.active {
  background: rgba(174,135,68,0.1);
  border-color: rgba(174,135,68,0.35);
  color: var(--color-gold-light);
}

/* Stato vuoto */
.cronologia-empty {
  text-align: center;
  padding: 60px 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.cronologia-empty p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.cronologia-empty-sub {
  font-size: 0.82rem !important;
  color: var(--color-text-dim) !important;
  max-width: 340px;
}

/* Tabella */
.cronologia-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.cronologia-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: var(--font-weight-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.cronologia-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}
.cronologia-table tbody tr:hover { background: rgba(174,135,68,0.03); }
.cronologia-table tbody tr:last-child { border-bottom: none; }
.cronologia-table td {
  padding: 14px 14px;
  color: var(--color-text-muted);
  vertical-align: middle;
}
.cronologia-table .td-sposi {
  font-weight: var(--font-weight-semi);
  color: var(--color-text);
}
.cronologia-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: var(--font-weight-semi);
}
.badge-PSD       { background: rgba(99,102,241,0.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
.badge-JPG       { background: rgba(59,130,246,0.1);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }
.badge-AlbumLive { background: rgba(174,135,68,0.1);  color: var(--color-gold-light); border: 1px solid rgba(174,135,68,0.2); }
.td-crediti { color: var(--color-gold-dark); font-weight: var(--font-weight-medium); }
.td-date { font-size: 0.82rem; white-space: nowrap; }

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
  .profilo-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .profilo-hero-inner { flex-direction: column; text-align: center; }
  .profilo-hero-stats { width: 100%; justify-content: center; }
  .profilo-hero-info .profilo-plan-badge { margin: 0 auto 10px; display: block; width: fit-content; }
}
@media (max-width: 500px) {
  .profilo-hero-stats { padding: 14px 16px; }
  .profilo-stat { padding: 0 12px; }
  .cronologia-table thead { display: none; }
  .cronologia-table tbody tr { display: block; padding: 12px 0; }
  .cronologia-table td { display: block; padding: 4px 0; border: none; }
}
