/* ===================================================
   🌙 Fishcaos Dark Premium Theme — Design System v2.0
   Melhoria sobre o tema dark original com:
   - Paleta semântica completa (esteira Fishcaos)
   - Glassmorphism refinado
   - Tipografia premium (Outfit + Inter + JetBrains Mono)
   - Sombras neoclássicas e glow effects
   =================================================== */

:root {
  /* === BACKGROUNDS === */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2233;
  --bg-glass: rgba(17, 24, 39, 0.7);
  --bg-elevated: rgba(26, 34, 51, 0.9);

  /* === TEXTOS === */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-disabled: #475569;

  /* === ACENTOS SEMÂNTICOS (Esteira Fishcaos) === */
  --accent-tr: #3b82f6;
  --accent-qt: #8b5cf6;
  --accent-qm: #ec4899;
  --accent-qg: #10b981;
  --accent-ls: #f59e0b;

  /* === STATUS PEDAGÓGICOS === */
  --status-maduro: #10b981;
  --status-fragil: #ef4444;
  --status-sem-medicao: #f59e0b;
  --status-parcial: #3b82f6;

  /* === SETORES DA META === */
  --setor-a: #3b82f6;
  --setor-b: #8b5cf6;
  --setor-c: #10b981;
  --setor-d: #ef4444;
  --setor-e: #f59e0b;

  /* === GLASSMORPHISM === */
  --glass-bg: rgba(17, 24, 39, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(16px);

  /* === GRADIENTES === */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

  /* === SOMBRAS === */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.24);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.32);

  /* === GLOW EFFECTS === */
  --glow-tr: 0 0 20px rgba(59, 130, 246, 0.4);
  --glow-qm: 0 0 20px rgba(236, 72, 153, 0.4);
  --glow-success: 0 0 20px rgba(16, 185, 129, 0.4);
  --glow-danger: 0 0 20px rgba(239, 68, 68, 0.4);

  /* === TIPOGRAFIA === */
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* === BORDAS === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* === GLASS CARD COMPONENT === */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(255, 255, 255, 0.12);
}

/* === GLASS CARD COM GLOW === */
.glass-card-glow {
  position: relative;
  overflow: hidden;
}

.glass-card-glow::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(102, 126, 234, 0.08) 0%,
    transparent 70%
  );
  animation: glow-rotate 12s linear infinite;
  pointer-events: none;
}

@keyframes glow-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === BOTÕES PREMIUM === */
.btn-premium {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--glass-border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-premium:hover {
  background: var(--bg-secondary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-premium:active {
  transform: translateY(0);
}

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

.btn-premium-primary {
  background: var(--gradient-primary);
  border: none;
  color: white;
}

.btn-premium-primary:hover {
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-premium-success {
  background: var(--gradient-success);
  border: none;
  color: white;
}

.btn-premium-danger {
  background: var(--gradient-danger);
  border: none;
  color: white;
}

/* === BADGES DE SETOR === */
.badge-setor {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.03em;
}

.badge-setor-a {
  background: rgba(59, 130, 246, 0.15);
  color: var(--setor-a);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-setor-b {
  background: rgba(139, 92, 246, 0.15);
  color: var(--setor-b);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-setor-c {
  background: rgba(16, 185, 129, 0.15);
  color: var(--setor-c);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-setor-d {
  background: rgba(239, 68, 68, 0.15);
  color: var(--setor-d);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-setor-e {
  background: rgba(245, 158, 11, 0.15);
  color: var(--setor-e);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* === STATUS BADGES === */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

.status-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--status-maduro);
}

.status-pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-sem-medicao);
}

.status-error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-fragil);
}

/* === TIPOGRAFIA === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === TABELA RESPONSIVA === */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.responsive-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.responsive-table thead {
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.responsive-table th {
  padding: 1rem;
  text-align: left;
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.responsive-table td {
  padding: 1rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.responsive-table tbody tr {
  transition: background 0.2s ease;
}

.responsive-table tbody tr:hover {
  background: var(--bg-tertiary);
}

@media (max-width: 768px) {
  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
  }

  .responsive-table td {
    display: block;
    border: none;
    padding: 0.5rem 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-weight: var(--font-semibold);
    color: var(--text-tertiary);
    display: block;
    font-size: var(--text-xs);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
  }
}

/* === TEXT TRUNCATE === */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-balance {
  text-wrap: balance;
}

/* === ANIMAÇÕES GLOBAIS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease;
}

.animate-slide-down {
  animation: slideDown 0.3s ease;
}

/* === SCROLLBAR PERSONALIZADA === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-disabled);
}

/* === FOCUS VISIBLE (acessibilidade) === */
*:focus-visible {
  outline: 2px solid var(--accent-tr);
  outline-offset: 2px;
}
