/**
 * KAINOW DA SORTE - DESIGN SYSTEM v1.0
 * Sistema de design padronizado para toda a aplicação
 */

/* ===================================
   1. CSS VARIABLES (Variáveis de Design)
   =================================== */
:root {
  /* Cores Primárias */
  --color-primary: #8b5cf6;        /* Roxo principal */
  --color-primary-dark: #7c3aed;   /* Roxo escuro */
  --color-primary-light: #a78bfa;  /* Roxo claro */
  
  /* Cores Secundárias */
  --color-secondary: #f59e0b;      /* Laranja/Amarelo */
  --color-secondary-dark: #d97706;
  --color-secondary-light: #fbbf24;
  
  /* Cores de Sucesso/Erro/Aviso */
  --color-success: #10b981;        /* Verde */
  --color-error: #ef4444;          /* Vermelho */
  --color-warning: #f59e0b;        /* Laranja */
  --color-info: #3b82f6;           /* Azul */
  
  /* Cores Neutras */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  
  /* Tipografia */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Tamanhos de Fonte (Mobile First) */
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Espaçamentos */
  --spacing-xs: 0.25rem;        /* 4px */
  --spacing-sm: 0.5rem;         /* 8px */
  --spacing-md: 1rem;           /* 16px */
  --spacing-lg: 1.5rem;         /* 24px */
  --spacing-xl: 2rem;           /* 32px */
  --spacing-2xl: 3rem;          /* 48px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;        /* 6px */
  --radius-md: 0.5rem;          /* 8px */
  --radius-lg: 0.75rem;         /* 12px */
  --radius-xl: 1rem;            /* 16px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===================================
   2. TÍTULOS PADRONIZADOS
   =================================== */

/* Título Principal de Seção (ex: "Suas Estatísticas") */
.section-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-gray-800);
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-tight);
}

@media (min-width: 768px) {
  .section-title {
    font-size: var(--font-size-2xl);
  }
}

/* Subtítulo de Seção */
.section-subtitle {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: var(--spacing-sm);
  line-height: var(--line-height-normal);
}

@media (min-width: 768px) {
  .section-subtitle {
    font-size: var(--font-size-lg);
  }
}

/* Título de Card */
.card-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-gray-800);
  margin-bottom: var(--spacing-xs);
  line-height: var(--line-height-tight);
}

@media (min-width: 768px) {
  .card-title {
    font-size: var(--font-size-base);
  }
}

/* Label de Card */
.card-label {
  font-size: 0.625rem;    /* 10px - ainda menor para compactar */
  font-weight: 500;
  color: var(--color-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: var(--line-height-tight);
  margin-bottom: 0.125rem;
}

/* ===================================
   3. CARDS PADRONIZADOS
   =================================== */

/* Card de Estatística */
.stat-card {
  /* background removido para permitir gradientes personalizados do HTML */
  border-radius: var(--radius-lg);
  padding: var(--spacing-sm) var(--spacing-md);  /* Reduzido padding vertical */
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  min-height: 70px;  /* Reduzido de 110px para 70px */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .stat-card {
    min-height: 85px;  /* Reduzido de 130px para 85px */
    padding: var(--spacing-md);
  }
}

/* Card de Estatística com fundo branco (para uso específico) */
.stat-card-white {
  background: white;
}

/* Valor da Estatística */
.stat-value {
  font-size: 1.25rem;     /* 20px - reduzido de 24px */
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: var(--line-height-tight);
  margin: 0.125rem 0;     /* Reduzido margem */
}

@media (min-width: 768px) {
  .stat-value {
    font-size: 1.5rem;    /* 24px - reduzido de 30px */
  }
}

/* ===================================
   4. BOTÕES PADRONIZADOS
   =================================== */

/* Botão Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 0.625rem 1.25rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: var(--line-height-tight);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

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

/* Tamanhos de Botão */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-base);
}

/* Variantes de Botão */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);  /* Azul */
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--color-primary);
  color: white;
}

/* ===================================
   5. INPUTS PADRONIZADOS
   =================================== */

.form-input {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--color-gray-900);
  background-color: white;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-input::placeholder {
  color: var(--color-gray-400);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: var(--spacing-xs);
}

/* ===================================
   6. BADGES E TAGS
   =================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: var(--line-height-tight);
}

.badge-primary {
  background-color: #ede9fe;
  color: var(--color-primary-dark);
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-error {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ===================================
   7. SISTEMA DE CARDS PADRONIZADO
   =================================== */

/* Card Pequeno (Padrão para todo site - baseado em "Indique e Ganhe") */
.card-sm {
  background: white;
  border-radius: var(--radius-lg);      /* 12px */
  padding: var(--spacing-sm);           /* 8px */
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card-sm:hover {
  box-shadow: var(--shadow-md);
}

/* Card Médio (para seções com mais conteúdo) */
.card-md {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0.75rem;                     /* 12px */
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.card-md:hover {
  box-shadow: var(--shadow-lg);
}

/* Card Grande (apenas para destaque especial) */
.card-lg {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-md);           /* 16px */
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.card-lg:hover {
  box-shadow: var(--shadow-lg);
}

/* Seção Container Padrão */
.section-container {
  border-radius: var(--radius-xl);
  padding: var(--spacing-sm);           /* 8px mobile */
  margin-bottom: var(--spacing-sm);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .section-container {
    padding: 0.75rem;                   /* 12px desktop */
  }
}

/* ===================================
   8. CONTAINERS E LAYOUT
   =================================== */

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  margin-bottom: var(--spacing-xl);
}

.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-sm);           /* Reduzido para padrão pequeno */
  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .card {
    padding: 0.75rem;                   /* 12px no desktop */
  }
}

/* Grid responsivo */
.grid-responsive {
  display: grid;
  gap: var(--spacing-md);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ===================================
   9. UTILITÁRIOS
   =================================== */

/* Gaps Padronizados (para grids) */
.gap-standard { gap: var(--spacing-sm); }      /* 8px - padrão recomendado */
.gap-compact { gap: 0.375rem; }                /* 6px - mais compacto */
.gap-loose { gap: 0.75rem; }                   /* 12px - mais espaçado */

/* Espaçamentos */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

/* Cores de texto */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-700 { color: var(--color-gray-700); }
.text-gray-800 { color: var(--color-gray-800); }
.text-gray-900 { color: var(--color-gray-900); }

/* Pesos de fonte */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Alinhamento de texto */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
