/* ============================================================
   PAINEL JD — Design Tokens & Theme
   Design System baseado em Shoelace (Web Awesome)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

/* ---------- Reset Global ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- Design Tokens ---------- */
:root {
  /* Cores primárias — azul profundo institucional */
  --jd-primary-50: #eef2ff;
  --jd-primary-100: #dfe6ff;
  --jd-primary-200: #c5cfff;
  --jd-primary-300: #a2b0ff;
  --jd-primary-400: #7a86fc;
  --jd-primary-500: #5a5ef5;
  --jd-primary-600: #4940ea;
  --jd-primary-700: #3d32ce;
  --jd-primary-800: #332ba6;
  --jd-primary-900: #2e2a83;
  --jd-primary-950: #1c194d;

  /* Cores de destaque — dourado sóbrio */
  --jd-accent-50: #fefce8;
  --jd-accent-100: #fef9c3;
  --jd-accent-200: #fef08a;
  --jd-accent-300: #fde047;
  --jd-accent-400: #facc15;
  --jd-accent-500: #eab308;
  --jd-accent-600: #ca8a04;
  --jd-accent-700: #a16207;

  /* Neutros */
  --jd-gray-50: #f8fafc;
  --jd-gray-100: #f1f5f9;
  --jd-gray-200: #e2e8f0;
  --jd-gray-300: #cbd5e1;
  --jd-gray-400: #94a3b8;
  --jd-gray-500: #64748b;
  --jd-gray-600: #475569;
  --jd-gray-700: #334155;
  --jd-gray-800: #1e293b;
  --jd-gray-900: #0f172a;
  --jd-gray-950: #020617;

  /* Semânticas */
  --jd-success: #22c55e;
  --jd-warning: #f59e0b;
  --jd-danger: #ef4444;
  --jd-info: #3b82f6;

  /* Tipografia */
  --jd-font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --jd-heading-font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  --jd-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --jd-font-size-xs: 0.75rem;
  --jd-font-size-sm: 0.875rem;
  --jd-font-size-md: 1rem;
  --jd-font-size-lg: 1.125rem;
  --jd-font-size-xl: 1.25rem;
  --jd-font-size-2xl: 1.5rem;
  --jd-font-size-3xl: 1.875rem;
  --jd-font-size-4xl: 2.25rem;
  --jd-line-height: 1.6;
  --jd-heading-line-height: 1.2;

  /* Espaçamento */
  --jd-space-xs: 0.25rem;
  --jd-space-sm: 0.5rem;
  --jd-space-md: 1rem;
  --jd-space-lg: 1.5rem;
  --jd-space-xl: 2rem;
  --jd-space-2xl: 3rem;
  --jd-space-3xl: 4rem;

  /* Bordas e Sombras */
  --jd-radius-sm: 0.375rem;
  --jd-radius-md: 0.5rem;
  --jd-radius-lg: 0.75rem;
  --jd-radius-xl: 1rem;
  --jd-radius-full: 9999px;

  --jd-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --jd-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --jd-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --jd-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transições */
  --jd-transition-fast: 150ms ease;
  --jd-transition-normal: 250ms ease;
  --jd-transition-slow: 350ms ease;

  /* Layout */
  --jd-sidebar-width: 260px;
  --jd-header-height: 64px;
  --jd-max-content-width: 1200px;
}

/* ---------- Tema Claro (padrão) ---------- */
:root,
[data-theme="light"] {
  --jd-bg: var(--jd-gray-50);
  --jd-bg-surface: #ffffff;
  --jd-bg-hover: var(--jd-gray-100);
  --jd-text: var(--jd-gray-900);
  --jd-text-secondary: var(--jd-gray-500);
  --jd-border: var(--jd-gray-200);
}

/* ---------- Tema Escuro ---------- */
[data-theme="dark"] {
  --jd-bg: var(--jd-gray-900);
  --jd-bg-surface: var(--jd-gray-800);
  --jd-bg-hover: var(--jd-gray-700);
  --jd-text: var(--jd-gray-100);
  --jd-text-secondary: var(--jd-gray-400);
  --jd-border: var(--jd-gray-700);
}

/* ---------- Estilos Base ---------- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--jd-font-family);
  font-size: var(--jd-font-size-md);
  line-height: var(--jd-line-height);
  color: var(--jd-text);
  background-color: var(--jd-bg);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--jd-heading-font-family);
  line-height: var(--jd-heading-line-height);
  font-weight: 600;
  color: var(--jd-text);
  letter-spacing: -0.02em;
}

a {
  color: var(--jd-primary-600);
  text-decoration: none;
  transition: color var(--jd-transition-fast);
}

a:hover {
  color: var(--jd-primary-700);
  text-decoration: underline;
}

/* ---------- Utilitários ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--jd-max-content-width);
  margin: 0 auto;
  padding: 0 var(--jd-space-lg);
}

/* ---------- Animações ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in {
  animation: fadeIn var(--jd-transition-normal) ease forwards;
}

.animate-slide-in {
  animation: slideIn var(--jd-transition-normal) ease forwards;
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--jd-gray-200) 25%, var(--jd-gray-100) 50%, var(--jd-gray-200) 75%);
  background-size: 200% 100%;
  animation: pulse 1.5s ease-in-out infinite;
  border-radius: var(--jd-radius-sm);
}

/* ---------- Glassmorphism Card ---------- */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--jd-radius-xl);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
}

[data-theme="dark"] .glass-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ---------- Overrides Shoelace ---------- */
sl-button::part(base) {
  font-family: var(--jd-font-family);
  border-radius: var(--jd-radius-md);
  transition: all var(--jd-transition-fast);
}

sl-input::part(base),
sl-textarea::part(base),
sl-select::part(combobox) {
  font-family: var(--jd-font-family);
  border-radius: var(--jd-radius-md);
}

sl-card::part(base) {
  border-radius: var(--jd-radius-lg);
  box-shadow: var(--jd-shadow-md);
}
