/* ============================================================
   components.css — Componentes reutilizáveis de UI
   ============================================================ */

/* ---------- BOTÕES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #6a5dd4; }

.btn-danger {
  background: var(--accent2);
  color: #fff;
}
.btn-danger:hover { background: #c85a62; }

.btn-success {
  background: var(--accent3);
  color: #0f2a22;
}
.btn-success:hover { background: #3dbc97; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-gold {
  background: var(--gold);
  color: #2a1f00;
}
.btn-gold:hover { background: #d9a830; }

.btn-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---------- FORMULÁRIOS ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.warning-text {
  font-size: 12px;
  color: var(--accent2);
  margin-top: var(--space-xs);
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-pago    { background: rgba(86,217,176,0.15); color: var(--accent3); }
.badge-nao     { background: rgba(224,108,117,0.15); color: var(--accent2); }
.badge-sorteado { background: rgba(240,192,96,0.15); color: var(--gold); }
.badge-vendido { background: rgba(224,108,117,0.15); color: var(--accent2); }

/* ---------- NÚMERO BADGE ---------- */
.number-badge {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin: 1px;
}

/* ---------- TABELA ---------- */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(46,46,62,0.5);
  color: var(--text);
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td     { background: rgba(255,255,255,0.02); }

/* ---------- ESTADO VAZIO ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 14px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
  display: block;
}

/* ---------- TOAST ---------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  max-width: 280px;
  animation: slide-in 0.2s ease;
}

.toast.success { border-left: 3px solid var(--accent3); }
.toast.error   { border-left: 3px solid var(--accent2); }
.toast.info    { border-left: 3px solid var(--accent);  }

@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ---------- MODAL ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  margin-bottom: 1.25rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s;
}
.close-btn:hover { color: var(--text); }

/* ---------- LEGENDA ---------- */
.legend {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dot-livre    { background: var(--surface2); border: 1px solid var(--border); }
.dot-vendido  { background: rgba(224,108,117,0.15); border: 1px solid rgba(224,108,117,0.4); }
.dot-sorteado { background: var(--gold); }

/* ---------- SEARCH ---------- */
.search-wrap {
  position: relative;
}

.search-wrap .input {
  padding-left: 36px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

/* ---------- CONFIG ROWS ---------- */
.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.config-row:last-child { border-bottom: none; }

.config-label { font-size: 14px; color: var(--text); }
.config-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
