/*
 * FantaCapital — Team Detail (campo + sidebar rosa)
 * File: fantacapital-team-detail.css
 *
 * Le variabili --fc-* NON sono piu' dichiarate qui (erano in
 * conflitto con altri file): vengono da style.css, caricato prima.
 * Vedi la nota in cima a style.css per i dettagli.
 */

/* =====================================================================
   VARIABILI AGGIUNTIVE
   ===================================================================== */
/* =====================================================================
   ANIMAZIONI
   ===================================================================== */
@keyframes fc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

@keyframes fc-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* =====================================================================
   LAYOUT PRINCIPALE — campo + sidebar
   ===================================================================== */
.td-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  min-height: 600px;
  background: var(--fc-navy-deep);
  border-radius: 16px;
  padding: 14px;
  color: var(--fc-fg);
  font-family: 'Barlow', sans-serif;
}


/* =====================================================================
   PITCH CARD — contenitore campo
   ===================================================================== */
.pitch-card {
  background: var(--fc-navy-card);
  border: 1px solid var(--fc-border-md);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* ── Header pitch ── */
.pitch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--fc-border);
  gap: 8px;
  flex-wrap: wrap;
}

.pitch-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pitch-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-fg);
}

.pitch-subtitle {
  font-size: 11px;
  color: var(--fc-fg-55);
}

/* Dropdown modulo */
.module-select {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--fc-border-md);
  color: var(--fc-fg);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.module-select:hover {
  border-color: var(--fc-gold-border);
}

.module-select option {
  background: #112036;
}

/* Badge LIVE */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--fc-gold);
  color: var(--fc-gold-text);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.badge-live-dot {
  width: 5px;
  height: 5px;
  background: var(--fc-gold-text);
  border-radius: 50%;
  animation: fc-pulse 1.5s ease-in-out infinite;
}


/* ── Campo da calcio ── */
.pitch-field {
  flex: 1;
  position: relative;
  padding: 14px 10px 10px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  background-color: var(--fc-navy-card);
}

/* Linea centrocampo */
.pitch-field::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* Righe di slot */
.pitch-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.pitch-row:last-child {
  margin-bottom: 0;
}


/* ── Slot — tessera singola ── */
.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  background: rgba(15, 31, 61, 0.75);
  border: 1px solid var(--fc-border-md);
  border-radius: 10px;
  padding: 8px 4px 7px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-height: 95px;
}

.slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Slot vuoto */
.slot.empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.slot.empty:hover {
  border-color: var(--fc-gold);
  background: rgba(240, 165, 0, 0.06);
}

/* Slot selezionato */
.slot.selected {
  border-color: var(--fc-gold);
  box-shadow: 0 0 0 2px rgba(240, 165, 0, 0.3);
}

/* Varianti per ruolo */
.slot.fwd { background: var(--fc-fwd-bg); border-color: var(--fc-fwd-border); }
.slot.fwd:hover { border-color: rgba(200, 60, 40, 0.65); }

.slot.mid { background: var(--fc-mid-bg); border-color: var(--fc-mid-border); }
.slot.mid:hover { border-color: rgba(16, 185, 129, 0.55); }

.slot.def { background: var(--fc-def-bg); border-color: var(--fc-def-border); }
.slot.def:hover { border-color: rgba(59, 130, 246, 0.55); }

.slot.gk {
  background: var(--fc-gk-bg);
  border-color: var(--fc-gk-border);
  box-shadow: 0 0 12px rgba(240, 165, 0, 0.10);
}
.slot.gk:hover {
  border-color: var(--fc-gold);
  box-shadow: 0 0 18px rgba(240, 165, 0, 0.20);
}

/* Badge posizione */
.pos-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--fc-navy-deep);
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.fwd .pos-badge { color: var(--fc-fwd-text); border: 1px solid rgba(200, 60, 40, 0.40); }
.mid .pos-badge { color: var(--fc-mid-text); border: 1px solid var(--fc-mid-border); }
.def .pos-badge { color: var(--fc-def-text); border: 1px solid rgba(59, 130, 246, 0.40); }
.gk  .pos-badge { color: var(--fc-gk-text);  border: 1px solid var(--fc-gk-border); }

/* Logo slot */
.slot-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 7px;
  font-weight: 900;
  color: #111;
  margin-bottom: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.slot-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

/* Icona slot vuoto */
.slot-empty-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 4px;
}

/* Testi slot */
.slot-ticker {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 900;
  color: var(--fc-fg);
  line-height: 1;
  letter-spacing: 0.02em;
}

.slot-name {
  font-size: 7px;
  color: var(--fc-fg-55);
  margin-top: 2px;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-quot {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: var(--fc-gold);
  margin-top: 3px;
}

.slot-empty-label {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 4px;
}


/* ── Score bar ── */
.score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--fc-border);
  font-size: 10px;
  color: var(--fc-fg-55);
  gap: 8px;
  flex-wrap: wrap;
}

.score-bar strong {
  color: var(--fc-fg-75);
  font-weight: 700;
}

.score-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--fc-up);
}

.score-val.neg {
  color: var(--fc-down);
}


/* ── Footer bottoni azione ── */
.pitch-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.20);
  border-top: 1px solid var(--fc-border);
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: filter 0.15s, transform 0.15s;
}

.action-btn:active { transform: scale(0.96); }

.action-btn.save {
  background: var(--fc-gold);
  color: var(--fc-gold-text);
}
.action-btn.save:hover { filter: brightness(1.1); }

.action-btn.reset {
  background: var(--fc-down-dim);
  border: 1px solid var(--fc-down-border);
  color: var(--fc-down);
}
.action-btn.reset:hover { background: rgba(239, 68, 68, 0.20); }

.action-btn.info {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}
.action-btn.info:hover { background: rgba(59, 130, 246, 0.22); }


/* =====================================================================
   SIDEBAR — lista rosa
   ===================================================================== */
.td-sidebar {
  background: var(--fc-navy-card);
  border: 1px solid var(--fc-border-md);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fc-slide-in 0.3s ease both;
}

/* Header sidebar */
.sidebar-header {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--fc-border);
}

.sidebar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--fc-fg);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-subtitle {
  font-size: 10px;
  color: var(--fc-fg-55);
  margin-top: 2px;
}

/* Pill filtri ruolo */
.sidebar-filters {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--fc-border);
  flex-wrap: wrap;
}

.filter-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--fc-border-md);
  background: transparent;
  color: var(--fc-fg-55);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  letter-spacing: 0.04em;
}

.filter-pill:hover {
  color: var(--fc-fg);
  background: rgba(255, 255, 255, 0.06);
}

.filter-pill.active {
  background: var(--fc-gold-dim);
  border-color: var(--fc-gold-border);
  color: var(--fc-gold);
}

/* Lista azioni */
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
}

.sidebar-list::-webkit-scrollbar { width: 4px; }
.sidebar-list::-webkit-scrollbar-track { background: transparent; }
.sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.10);
  border-radius: 2px;
}

/* Singola azione in lista */
.stock-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--fc-border);
  cursor: pointer;
  transition: background 0.15s;
}

.stock-item:last-child { border-bottom: none; }
.stock-item:hover { background: rgba(240, 165, 0, 0.05); }

/* Già schierata */
.stock-item.in-use {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* Compatibile con lo slot selezionato */
.stock-item.highlighted {
  background: rgba(240, 165, 0, 0.08);
  border-left: 2px solid var(--fc-gold);
}

/* Badge ruolo nella lista */
.si-role {
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}

.si-role.fwd { color: var(--fc-fwd-text); border-color: rgba(200, 60, 40, 0.40); background: var(--fc-fwd-bg); }
.si-role.mid { color: var(--fc-mid-text); border-color: var(--fc-mid-border);      background: var(--fc-mid-bg); }
.si-role.def { color: var(--fc-def-text); border-color: rgba(59, 130, 246, 0.40);  background: var(--fc-def-bg); }
.si-role.gk  { color: var(--fc-gk-text);  border-color: var(--fc-gk-border);       background: var(--fc-gk-bg); }

/* Info azione */
.si-info { flex: 1; min-width: 0; }

.si-ticker {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--fc-fg);
  line-height: 1;
}

.si-name {
  font-size: 9px;
  color: var(--fc-fg-55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.si-quot {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--fc-gold);
  flex-shrink: 0;
}

/* Hint in fondo */
.sidebar-hint {
  padding: 10px 12px;
  font-size: 10px;
  color: var(--fc-fg-35);
  border-top: 1px solid var(--fc-border);
  text-align: center;
  line-height: 1.4;
}


/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .td-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .td-sidebar {
    animation: none;
  }

  .sidebar-list {
    max-height: 260px;
  }

  .slot {
    width: 62px;
    min-height: 85px;
  }
}

@media (max-width: 576px) {
  .td-wrap {
    padding: 8px;
    gap: 8px;
  }

  .slot {
    width: 54px;
    min-height: 78px;
    padding: 7px 3px 6px;
  }

  .slot-ticker { font-size: 10px; }
  .slot-quot   { font-size: 8px; }

  .pitch-footer {
    grid-template-columns: 1fr 1fr;
  }

  .action-btn.info { display: none; }
}