/* ============================================================
   Sportiva Profile — Frontend Styles
   ============================================================ */

/* ---- Contenitore principale ---- */
.spv-profile {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: inherit;
  color: #333;
}

/* ---- Header ---- */
.spv-profile__header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.spv-profile__avatar img {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e5e7eb;
}

.spv-profile__header-info {
  flex: 1;
}

.spv-profile__name {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #111;
}

.spv-profile__role,
.spv-profile__sport {
  margin: 2px 0;
  color: #555;
  font-size: 0.95rem;
}

.spv-profile__type-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spv-profile__type-badge--subscriber {
  background: #f3f4f6;
  color: #374151;
}
.spv-profile__type-badge--team_member {
  background: #eff6ff;
  color: #1d4ed8;
}
.spv-profile__type-badge--athlete {
  background: #ecfdf5;
  color: #065f46;
}
.spv-profile__type-badge--teacher {
  background: #fef3c7;
  color: #92400e;
}
.spv-profile__type-badge--president {
  background: #fdf4ff;
  color: #7e22ce;
}
.spv-profile__type-badge--captain {
  background: #fff7ed;
  color: #c2410c;
}

/* ---- Sottotitolo profilo ---- */
.spv-profile__subtitle {
  margin: 4px 0 8px;
  color: #4b5563;
  font-size: 1rem;
  font-style: italic;
}

/* ---- Sezioni dinamiche per tipo ---- */
.spv-profile__section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.spv-profile__section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: #111;
}

.spv-profile__teacher-info,
.spv-profile__president-info,
.spv-profile__captain-info,
.spv-profile__athlete-matches,
.spv-profile__athlete-rankings {
  margin-top: 16px;
}

/* ---- Sezioni ---- */
.spv-profile__data,
.spv-profile__bio,
.spv-profile__social,
.spv-profile__athlete-data,
.spv-profile__team,
.spv-profile__matches,
.spv-profile__rankings {
  margin-bottom: 32px;
}

.spv-profile__data h2,
.spv-profile__bio h2,
.spv-profile__matches h3,
.spv-profile__rankings h3,
.spv-profile__team h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #24244d;
  padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb;
}

/* ---- Definition list dati ---- */
.spv-profile__dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 0;
}

.spv-profile__dl dt {
  font-weight: 600;
  color: #555;
  font-size: 0.88rem;
  white-space: nowrap;
}

.spv-profile__dl dd {
  margin: 0;
  color: #333;
  font-size: 0.93rem;
}

/* ---- Biografia ---- */
.spv-profile__bio-text {
  line-height: 1.7;
  color: #444;
}

/* ---- Social links ---- */
.spv-profile__social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.spv-profile__social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.spv-profile__social-link:hover {
  opacity: 0.8;
}
.spv-profile__social-link--facebook {
  background: #1877f2;
  color: #fff;
}
.spv-profile__social-link--instagram {
  background: #e1306c;
  color: #fff;
}
.spv-profile__social-link--tiktok {
  background: #000;
  color: #fff;
}
.spv-profile__social-link--website {
  background: #e5e7eb;
  color: #24244d;
}

/* ---- Team link ---- */
.spv-profile__team-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}
.spv-profile__team-link img {
  border-radius: 4px;
}

/* ---- Tabelle ---- */
.spv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.spv-table th,
.spv-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.spv-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #24244d;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.spv-table tbody tr:hover td {
  background: #f0f4ff;
}

/* ---- Risultato incontro ---- */
.spv-result {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.88rem;
}
.spv-result--win {
  background: #d4edda;
  color: #155724;
}
.spv-result--loss {
  background: #f8d7da;
  color: #721c24;
}
.spv-result--draw {
  background: #fff3cd;
  color: #856404;
}

/* ---- Classifiche ---- */
.spv-rankings-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.spv-rankings-list li {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.93rem;
}
.spv-rankings-list li:last-child {
  border-bottom: none;
}

/* ---- Team members grid ---- */
.spv-team-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.spv-team-member {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.spv-team-member:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.spv-team-member__link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 16px;
  text-align: center;
}

.spv-team-member__avatar {
  display: block;
  margin: 0 auto 10px;
  border-radius: 50%;
  object-fit: cover;
}

.spv-team-member__name {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
}

.spv-team-member__role {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 4px;
}

.spv-team-member__excerpt {
  display: block;
  font-size: 0.78rem;
  color: #888;
}

/* ---- Dashboard ---- */
.spv-dashboard__tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.spv-tab {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.spv-tab:hover {
  color: #24244d;
}
.spv-tab--active {
  color: #24244d;
  border-bottom-color: #24244d;
}

/* ---- Form modifica profilo ---- */
.spv-edit-form__avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.spv-edit-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.spv-edit-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.spv-edit-form__field--full {
  grid-column: 1 / -1;
}

.spv-edit-form__field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}

.spv-edit-form__fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.spv-edit-form__fieldset legend {
  font-weight: 600;
  color: #24244d;
  padding: 0 8px;
}

.spv-input,
.spv-textarea,
.spv-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.spv-input:focus,
.spv-textarea:focus,
.spv-select:focus {
  outline: none;
  border-color: #24244d;
  box-shadow: 0 0 0 3px rgba(36, 36, 77, 0.08);
}

.spv-textarea {
  resize: vertical;
  min-height: 90px;
}

/* ---- Pulsanti ---- */
.spv-btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition:
    background 0.15s,
    opacity 0.15s;
}
.spv-btn--primary {
  background: #24244d;
  color: #fff;
}
.spv-btn--primary:hover {
  background: #1a1a3a;
}
.spv-btn--secondary {
  background: #e5e7eb;
  color: #333;
}
.spv-btn--secondary:hover {
  background: #d1d5db;
}

/* ---- Notifiche ---- */
.spv-notice {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
}
.spv-notice--success {
  background: #d4edda;
  color: #155724;
}
.spv-notice--error {
  background: #f8d7da;
  color: #721c24;
}
.spv-notice--warning {
  background: #fff3cd;
  color: #856404;
}

/* ---- Empty state ---- */
.spv-empty {
  text-align: center;
  color: #888;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* ---- Form visibilità campi ---- */
.spv-profile-form__visible-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.spv-profile-form__visible-fields label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
}

/* ---- Griglia card tipo profilo (form edit) ---- */
.spv-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.spv-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.spv-type-card:hover { border-color: #6366f1; }

.spv-type-card--active {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

.spv-type-card__radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.spv-type-card__icon  { font-size: 1.75rem; line-height: 1; }
.spv-type-card__label { font-size: 0.875rem; color: #111827; font-weight: 700; margin-top: 4px; }
.spv-type-card__desc  { font-size: 0.75rem;  color: #6b7280; line-height: 1.3; }

/* ---- Card contenitore form edit ---- */
.spv-edit-form__card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

.spv-edit-form__card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f3f4f6;
  color: #111827;
}

.spv-edit-form__hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0 0 10px;
}

.spv-edit-form__avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.spv-edit-form__avatar-img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e5e7eb;
  flex-shrink: 0;
}

.spv-edit-form__avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spv-edit-form__actions { margin-top: 8px; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .spv-profile__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .spv-profile__dl {
    grid-template-columns: 1fr;
  }

  .spv-profile__dl dt {
    margin-bottom: -2px;
    font-size: 0.8rem;
  }

  .spv-team-members {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .spv-edit-form__row {
    grid-template-columns: 1fr;
  }

  .spv-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .spv-edit-form__avatar-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .spv-type-grid {
    grid-template-columns: 1fr;
  }
}
