/* css/gerador-times.css */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: #0a1628;
  font-family: 'DM Sans', sans-serif;
  position: relative;
  overflow-x: hidden;
}

.sp-bg-field {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, #1a4a2e 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 20% -10%, #1e3a5f 0%, transparent 60%),
    #0a1628;
  z-index: 0;
}

.sp-lines {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 420px; height: 220px; opacity: 0.05; z-index: 0;
}

/* Header */
.sp-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  background: rgba(10,22,40,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.sp-back {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.07);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 6px 14px;
  font-size: 12px; color: rgba(255,255,255,0.7);
  cursor: pointer; transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.sp-back:hover { background: rgba(255,255,255,0.12); }

.sp-logo { display: flex; align-items: center; gap: 8px; }
.sp-logo-icon {
  width: 28px; height: 28px; background: #22c55e;
  border-radius: 6px; display: flex; align-items: center;
  justify-content: center; font-size: 14px;
}
.sp-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 2px; color: #fff;
}
.sp-logo-text span { color: #22c55e; }

.sp-logout-btn {
  background: rgba(220,53,69,0.15);
  border: 0.5px solid rgba(220,53,69,0.3);
  border-radius: 20px; padding: 6px 14px;
  font-size: 12px; color: #f87171;
  cursor: pointer; transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.sp-logout-btn:hover { background: rgba(220,53,69,0.25); }

/* Hero */
.sp-hero {
  position: relative; z-index: 2;
  text-align: center; padding: 24px 20px 20px;
}

.sp-page-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(96,165,250,0.15);
  border: 0.5px solid rgba(96,165,250,0.3);
  border-radius: 20px; padding: 4px 12px;
  font-size: 11px; color: #93c5fd;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px;
}

.sp-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px; letter-spacing: 3px; color: #fff; line-height: 1;
  margin: 0 0 6px;
}
.sp-title span { color: #4ade80; }
.sp-subtitle { font-size: 13px; color: rgba(255,255,255,0.4); }

/* Content */
.sp-content {
  position: relative; z-index: 2;
  max-width: 680px; margin: 0 auto;
  padding: 0 16px 40px;
  display: flex; flex-direction: column; gap: 14px;
}

/* Cards */
.sp-card {
  background: rgba(255,255,255,0.05);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 16px; overflow: hidden;
}

.sp-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid rgba(255,255,255,0.07);
  flex-wrap: wrap; gap: 8px;
}

.sp-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: #fff;
}

.sp-card-title-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(34,197,94,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  flex-shrink: 0;
}

.sp-selected-count { font-size: 12px; color: #4ade80; font-weight: 500; }

/* Busca */
.sp-search {
  margin: 10px 16px 6px;
  position: relative;
}
.sp-search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); font-size: 13px;
  color: rgba(255,255,255,0.3); pointer-events: none;
}
.sp-search input {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 8px 12px 8px 32px;
  font-size: 13px; color: #fff; font-family: 'DM Sans', sans-serif;
  outline: none; transition: border-color 0.2s;
}
.sp-search input::placeholder { color: rgba(255,255,255,0.25); }
.sp-search input:focus { border-color: rgba(34,197,94,0.4); }

/* Lista de jogadores */
.sp-player-list {
  max-height: 280px; overflow-y: auto;
  padding: 4px 0 10px;
}
.sp-player-list::-webkit-scrollbar { width: 4px; }
.sp-player-list::-webkit-scrollbar-track { background: transparent; }
.sp-player-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sp-loading-text {
  text-align: center; color: rgba(255,255,255,0.3);
  font-size: 13px; padding: 20px;
}

/* Itens de jogador na lista */
.jogador-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; cursor: pointer;
  transition: background 0.15s;
  border-bottom: 0.5px solid rgba(255,255,255,0.04);
}
.jogador-item:hover { background: rgba(255,255,255,0.04); }
.jogador-item.selecionado { background: rgba(34,197,94,0.07); }

.jogador-checkbox {
  width: 16px; height: 16px; border-radius: 4px;
  border: 0.5px solid rgba(255,255,255,0.2);
  accent-color: #22c55e; flex-shrink: 0; cursor: pointer;
}

.jogador-estrelas {
  font-size: 11px; color: #fbbf24; letter-spacing: 1px;
  cursor: pointer; flex-shrink: 0; min-width: 60px;
}
.jogador-estrelas:hover { opacity: 0.75; }

.jogador-nome {
  flex: 1; font-size: 13px; color: rgba(255,255,255,0.8);
}
.jogador-item.selecionado .jogador-nome { color: #fff; }

/* Edição inline de nível */
.nivel-select-inline {
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(34,197,94,0.4);
  border-radius: 6px; padding: 2px 6px;
  font-size: 11px; color: #fff;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
}

/* Botão goleiro */
.btn-goleiro {
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 12px; padding: 2px 8px;
  font-size: 11px; color: rgba(255,255,255,0.4);
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.btn-goleiro.ativo {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.4);
  color: #fcd34d;
}

/* Config body */
.sp-config-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.sp-config-row { display: flex; gap: 10px; flex-wrap: wrap; }

.sp-config-field { flex: 1; min-width: 120px; }
.sp-config-label {
  font-size: 10px; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 5px;
}

.sp-select {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 8px 10px;
  font-size: 13px; color: #fff; font-family: 'DM Sans', sans-serif;
  outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.3)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.sp-select:focus { border-color: rgba(34,197,94,0.4); }
.sp-select option { background: #1e2d3d; color: #fff; }

.sp-total-box {
  background: rgba(34,197,94,0.08);
  border: 0.5px solid rgba(34,197,94,0.2);
  border-radius: 10px; padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between;
  min-width: 90px;
}
.sp-total-label { font-size: 10px; color: rgba(255,255,255,0.35); margin-bottom: 2px; }
.sp-total-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; color: #4ade80; line-height: 1;
}
.sp-total-unit { font-size: 10px; color: rgba(255,255,255,0.25); }

/* Alertas */
.sp-alert {
  border-radius: 10px; padding: 10px 14px;
  font-size: 12px; line-height: 1.5;
}
.sp-alert-warn {
  background: rgba(251,191,36,0.08);
  border: 0.5px solid rgba(251,191,36,0.25);
  color: #fcd34d;
}
.sp-alert-ok {
  background: rgba(34,197,94,0.08);
  border: 0.5px solid rgba(34,197,94,0.25);
  color: #4ade80;
}

/* Toggle */
.sp-toggle-row { display: flex; align-items: center; gap: 10px; }
.sp-toggle {
  width: 36px; height: 20px; border-radius: 10px;
  background: rgba(255,255,255,0.1); cursor: pointer;
  position: relative; transition: background 0.2s; flex-shrink: 0;
}
.sp-toggle.on { background: #22c55e; }
.sp-toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.sp-toggle.on .sp-toggle-thumb { transform: translateX(16px); }
.sp-toggle-info { flex: 1; }
.sp-toggle-title { font-size: 13px; color: rgba(255,255,255,0.8); font-weight: 500; }
.sp-toggle-desc { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 2px; }

/* Botões */
.sp-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.sp-btn {
  padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 0.5px solid; transition: all 0.2s;
  font-family: 'DM Sans', sans-serif; white-space: nowrap;
}
.sp-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.sp-btn-ghost {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
}

.sp-btn-primary {
  background: rgba(34,197,94,0.25);
  border-color: rgba(34,197,94,0.6);
  color: #4ade80;
}

.sp-btn-danger {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.5);
  color: #fca5a5;
}

.sp-btn-amber {
  background: rgba(251,191,36,0.2);
  border-color: rgba(251,191,36,0.5);
  color: #fcd34d;
}

.sp-btn-blue {
  background: rgba(96,165,250,0.2);
  border-color: rgba(96,165,250,0.5);
  color: #93c5fd;
}

.sp-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.sp-gerar-row { display: flex; justify-content: center; padding-top: 4px; }

.sp-btn-gerar {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none; border-radius: 12px;
  padding: 12px 32px; font-size: 14px; font-weight: 600;
  color: #fff; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: opacity 0.2s, transform 0.15s;
}
.sp-btn-gerar:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.sp-btn-gerar:disabled { opacity: 0.4; cursor: not-allowed; }

/* Resultado */
.sp-resumo {
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 10px 14px;
  display: flex; gap: 16px; flex-wrap: wrap;
  align-items: center; justify-content: center;
  margin-bottom: 4px;
}

.resumo-item { text-align: center; }
.resumo-label { font-size: 10px; color: rgba(255,255,255,0.35); display: block; margin-bottom: 2px; }
.resumo-valor { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: #4ade80; }
.resumo-valor.aviso { color: #f87171; }

/* Painel de troca */
.sp-troca-painel {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 10px 14px;
  flex-wrap: wrap;
}
.sp-troca-info { flex: 1; font-size: 12px; color: rgba(255,255,255,0.5); min-width: 160px; }

/* Grid de times */
.sp-times-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}

/* Card de time */
.time-card {
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 12px;
  transition: border-color 0.2s;
}
.time-card:hover { border-color: rgba(255,255,255,0.2); }

.time-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}

.time-nome {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; color: #4ade80; letter-spacing: 1px;
}

.time-forca {
  font-size: 10px; color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
  border-radius: 10px; padding: 2px 8px;
}

.time-jogadores-lista { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.time-jogador-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; background: rgba(255,255,255,0.03);
  border-radius: 8px; font-size: 12px;
  cursor: pointer; transition: all 0.15s;
  border: 1px solid transparent; user-select: none;
}
.time-jogador-item:hover { background: rgba(255,255,255,0.07); }
.time-jogador-item.selecionado-troca {
  border-color: #fbbf24;
  background: rgba(251,191,36,0.1);
}
.time-jogador-item.generico { color: #fb923c; font-style: italic; }
.time-jogador-item.goleiro { background: rgba(251,191,36,0.06); }

.jogador-nivel-mini { font-size: 10px; color: #fbbf24; flex-shrink: 0; }
.jogador-nome-time { flex: 1; color: rgba(255,255,255,0.8); }
.time-jogador-item.selecionado-troca .jogador-nome-time { color: #fff; font-weight: 600; }

/* Nota genéricos */
.sp-nota-genericos {
  background: rgba(251,146,60,0.08);
  border: 0.5px solid rgba(251,146,60,0.25);
  border-radius: 10px; padding: 10px 14px;
  font-size: 12px; color: #fb923c; text-align: center;
}

.sp-resultado-botoes { justify-content: center; margin-top: 4px; }

/* Modais */
.sp-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: none; justify-content: center; align-items: center;
  z-index: 1000; backdrop-filter: blur(4px);
}

.sp-modal {
  background: #0f1f35;
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 16px; max-width: 420px; width: 90%;
  max-height: 85vh; overflow-y: auto;
}

.sp-modal-header {
  padding: 14px 18px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
  font-size: 14px; font-weight: 600; color: #fff;
}

.sp-modal-body {
  padding: 18px;
  font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.6;
}

.sp-form-field { display: flex; flex-direction: column; gap: 5px; }

.sp-input {
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 9px 12px;
  font-size: 13px; color: #fff; font-family: 'DM Sans', sans-serif;
  outline: none; width: 100%;
}
.sp-input:focus { border-color: rgba(34,197,94,0.4); }

.sp-textarea {
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 9px 12px;
  font-size: 13px; color: #fff; font-family: 'DM Sans', sans-serif;
  outline: none; width: 100%; resize: vertical; min-height: 80px;
}
.sp-textarea:focus { border-color: rgba(34,197,94,0.4); }

.sp-presencas-info { font-size: 12px; color: #4ade80; margin-top: 8px; }

/* Responsivo */
@media (max-width: 600px) {
  .sp-header { padding: 12px 14px; }
  .sp-content { padding: 0 12px 32px; }
  .sp-times-grid { grid-template-columns: 1fr; }
  .sp-title { font-size: 28px; }
  .sp-config-row { flex-direction: column; }
  .sp-resultado-botoes { justify-content: flex-start; }
}
