/* ==========================================================================
   VORTIQ DASHBOARD STYLESHEET
   Estilização central do painel de controle do bot (Discord Style)
   ========================================================================== */

/* Fontes & Variáveis Globais */
:root {
  --bg-primary: #0b1119;
  --bg-card: #111113;
  --bg-card-hover: #161619;
  --bg-input: #18181b;
  --border-color: #2a2a2f;
  --border-color-hover: #5865f2;

  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  --accent-discord: #5865f2;
  --accent-discord-hover: #4752c4;
  --accent-green: #22c55e;
  --accent-green-hover: #16a34a;
  --accent-red: #ef4444;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Body & Reset Preventivo */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   FERRAMENTAS DE BUSCA E FILTROS (HEADER DO PAINEL)
   -------------------------------------------------------------------------- */
.dashboard-header-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* Campo de Busca */
.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 38px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--accent-discord);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25);
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Filtros por Tab */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-btn:hover {
  background: #202024;
  color: var(--text-main);
  border-color: #3f3f46;
}

.filter-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-discord);
}

.filter-btn.active {
  background: var(--accent-discord);
  color: #ffffff;
  border-color: var(--accent-discord);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

/* --------------------------------------------------------------------------
   GRID E CARDS DOS SERVIDORES
   -------------------------------------------------------------------------- */
.guilds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.guild-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.guild-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
}

/* Badges de Status (Ativo / Ausente) */
.guild-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-inactive {
  background: rgba(113, 113, 122, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(113, 113, 122, 0.25);
}

/* Ícone do Servidor */
.guild-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--bg-input);
  object-fit: cover;
  margin-bottom: 12px;
  background: var(--bg-input);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.guild-card:hover .guild-avatar {
  transform: scale(1.04);
}

/* Informações do Servidor */
.guild-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 18px 0;
}

/* Botões de Ação do Card */
.btn-guild-action {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-guild-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Estilo do Botão Configurar */
.btn-config {
  background: var(--accent-discord);
  color: #ffffff;
}

.btn-config:hover {
  background: var(--accent-discord-hover);
  box-shadow: 0 0 14px rgba(88, 101, 242, 0.4);
}

/* Estilo do Botão Convidar Bot */
.btn-inv {
  background: var(--accent-green);
  color: #ffffff;
}

.btn-inv:hover {
  background: var(--accent-green-hover);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.4);
}

/* Estado de Carregamento / Mensagem de Resultado Vazio */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 48px 20px;
  font-size: 0.95rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Skeleton Loading Animation */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.skeleton-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-text {
  height: 14px;
  width: 60%;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   RESPONSIVIDADE (MOBILE & TABLETS)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .dashboard-header-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    min-width: 100%;
  }

  .filter-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .guilds-grid {
    grid-template-columns: 1fr;
  }
}