/* ====================================
   Theme Variables System
   Sistema de Variáveis de Tema
   ==================================== */

/* Tema Claro (Padrão) - Light Theme (Default) */
:root {
  /* Cores Principais - Main Colors */
  --primary-color: #3b82f6;        /* blue-500 */
  --secondary-color: #6366f1;      /* indigo-500 */
  --accent-color: #8b5cf6;         /* violet-500 */
  
  /* Backgrounds */
  --bg-primary: #ffffff;           /* white */
  --bg-secondary: #f9fafb;         /* gray-50 */
  --bg-tertiary: #f3f4f6;          /* gray-100 */
  
  /* Textos - Text Colors */
  --text-primary: #111827;         /* gray-900 */
  --text-secondary: #4b5563;       /* gray-600 */
  --text-muted: #6b7280;           /* gray-500 */
  
  /* Bordas e Divisores - Borders and Dividers */
  --border-color: #e5e7eb;         /* gray-200 */
  --divider-color: #d1d5db;        /* gray-300 */
  
  /* Status Colors */
  --success-color: #10b981;        /* green-500 */
  --warning-color: #f59e0b;        /* amber-500 */
  --error-color: #ef4444;          /* red-500 */
  --info-color: #3b82f6;           /* blue-500 */
  
  /* Interação - Interaction */
  --hover-bg: #f3f4f6;             /* gray-100 */
  --active-bg: #e5e7eb;            /* gray-200 */
  --disabled-color: #9ca3af;       /* gray-400 */
  
  /* Sombras - 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);
}

/* Tema Escuro - Dark Theme */
[data-theme="dark"] {
  /* Cores Principais - Main Colors (mais brilhantes no escuro) */
  --primary-color: #60a5fa;        /* blue-400 */
  --secondary-color: #818cf8;      /* indigo-400 */
  --accent-color: #a78bfa;         /* violet-400 */
  
  /* Backgrounds */
  --bg-primary: #111827;           /* gray-900 */
  --bg-secondary: #1f2937;         /* gray-800 */
  --bg-tertiary: #374151;          /* gray-700 */
  
  /* Textos - Text Colors */
  --text-primary: #f9fafb;         /* gray-50 */
  --text-secondary: #d1d5db;       /* gray-300 */
  --text-muted: #9ca3af;           /* gray-400 */
  
  /* Bordas e Divisores - Borders and Dividers */
  --border-color: #374151;         /* gray-700 */
  --divider-color: #4b5563;        /* gray-600 */
  
  /* Status Colors */
  --success-color: #34d399;        /* green-400 */
  --warning-color: #fbbf24;        /* amber-400 */
  --error-color: #f87171;          /* red-400 */
  --info-color: #60a5fa;           /* blue-400 */
  
  /* Interação - Interaction */
  --hover-bg: #374151;             /* gray-700 */
  --active-bg: #4b5563;            /* gray-600 */
  --disabled-color: #6b7280;       /* gray-500 */
  
  /* Sombras - Shadows (mais intensas no escuro) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

/* Tema Personalizado - Custom Theme */
/* Valores de fallback - serão sobrescritos via JavaScript */
[data-theme="custom"] {
  /* Cores Principais - Main Colors */
  --primary-color: #3b82f6;
  --secondary-color: #6366f1;
  --accent-color: #8b5cf6;
  
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  
  /* Textos - Text Colors */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  
  /* Bordas e Divisores - Borders and Dividers */
  --border-color: #e5e7eb;
  --divider-color: #d1d5db;
  
  /* Status Colors */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
  
  /* Interação - Interaction */
  --hover-bg: #f3f4f6;
  --active-bg: #e5e7eb;
  --disabled-color: #9ca3af;
  
  /* Sombras - 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);
}

/* ====================================
   Transições Suaves - Smooth Transitions
   ==================================== */

* {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease;
}

/* Exceções - elementos que não devem ter transição */
*:focus,
*:active,
input,
textarea,
select {
  transition: none;
}

/* Re-aplicar transições suaves apenas para mudanças de tema */
body,
.theme-transition {
  transition: background-color 0.3s ease, 
              color 0.3s ease;
}

/* ====================================
   Utility Classes - Classes Utilitárias
   Classes que usam variáveis CSS do tema
   ==================================== */

/* Background Colors */
.bg-primary {
  background-color: var(--bg-primary) !important;
}

.bg-secondary {
  background-color: var(--bg-secondary) !important;
}

.bg-tertiary {
  background-color: var(--bg-tertiary) !important;
}

/* Text Colors */
.text-primary {
  color: var(--text-primary) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Border Colors */
.border-default {
  border-color: var(--border-color) !important;
}

.divide-default > * + * {
  border-color: var(--divider-color) !important;
}

/* Hover States - Estados de Hover */
.hover-bg-tertiary:hover {
  background-color: var(--bg-tertiary) !important;
}

.hover-bg-hover:hover {
  background-color: var(--hover-bg) !important;
}

.hover-text-secondary:hover {
  color: var(--text-secondary) !important;
}

/* ====================================
   Accent & Highlight Colors
   Cores de Destaque e Realce
   ==================================== */

/* Accent backgrounds for special nav items */
.bg-accent-subtle {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
}

.bg-accent-subtle:hover {
  background-color: var(--hover-bg) !important;
}

/* Accent text color */
.text-accent {
  color: var(--accent-color) !important;
}

.text-brand {
  color: var(--primary-color) !important;
}

/* ====================================
   Button Variants
   Variantes de Botões
   ==================================== */

/* Success Button */
.btn-success {
  background-color: var(--success-color) !important;
  color: white !important;
}

.btn-success:hover {
  filter: brightness(0.9);
}

/* Error/Danger Button */
.btn-error {
  background-color: var(--error-color) !important;
  color: white !important;
}

.btn-error:hover {
  filter: brightness(0.9);
}

/* Warning Button */
.btn-warning {
  background-color: var(--warning-color) !important;
  color: white !important;
}

.btn-warning:hover {
  filter: brightness(0.9);
}

/* Info/Primary Button */
.btn-info {
  background-color: var(--info-color) !important;
  color: white !important;
}

.btn-info:hover {
  filter: brightness(0.9);
}

/* Secondary/Gray Button */
.btn-secondary {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

.btn-secondary:hover {
  background-color: var(--active-bg) !important;
}

/* ====================================
   Status & Indicator Colors
   Cores de Status e Indicadores
   ==================================== */

/* Status dot colors */
.status-success {
  background-color: var(--success-color) !important;
}

.status-error {
  background-color: var(--error-color) !important;
}

.status-warning {
  background-color: var(--warning-color) !important;
}

.status-info {
  background-color: var(--info-color) !important;
}

/* Text status colors */
.text-success {
  color: var(--success-color) !important;
}

.text-error {
  color: var(--error-color) !important;
}

.text-warning {
  color: var(--warning-color) !important;
}

.text-info {
  color: var(--info-color) !important;
}

/* ====================================
   Gradient Backgrounds
   Fundos com Gradiente
   ==================================== */

/* Dashboard card gradients - usando cores do tema */
.bg-gradient-primary {
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color)) !important;
  color: white !important;
}

.bg-gradient-success {
  background: linear-gradient(to right, var(--success-color), var(--success-color)) !important;
  color: white !important;
  filter: brightness(1.0) saturate(1.1);
}

.bg-gradient-accent {
  background: linear-gradient(to right, var(--accent-color), var(--secondary-color)) !important;
  color: white !important;
}

.bg-gradient-warning {
  background: linear-gradient(to right, var(--warning-color), var(--warning-color)) !important;
  color: white !important;
  filter: brightness(1.0) saturate(1.1);
}

.bg-gradient-info {
  background: linear-gradient(to right, var(--info-color), var(--info-color)) !important;
  color: white !important;
  filter: brightness(1.0) saturate(1.1);
}

/* ====================================
   Special Backgrounds
   Fundos Especiais
   ==================================== */

/* Light tinted backgrounds for alerts/notices */
.bg-success-subtle {
  background-color: var(--bg-secondary) !important;
  border-left: 4px solid var(--success-color) !important;
}

.bg-error-subtle {
  background-color: var(--bg-secondary) !important;
  border-left: 4px solid var(--error-color) !important;
}

.bg-warning-subtle {
  background-color: var(--bg-secondary) !important;
  border-left: 4px solid var(--warning-color) !important;
}

.bg-info-subtle {
  background-color: var(--bg-secondary) !important;
  border-left: 4px solid var(--info-color) !important;
}

/* ====================================
   Focus & Ring States
   Estados de Foco
   ==================================== */

.focus-ring-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  border-color: var(--primary-color);
}

/* Dark theme adjustments for focus rings */
[data-theme="dark"] .focus-ring-primary:focus {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.4);
}

/* ====================================
   Info, Warning, Error Boxes & Borders
   Caixas e Bordas de Info, Aviso, Erro
   ==================================== */

/* Info Boxes */
.bg-info-box {
  background-color: var(--bg-secondary) !important;
}

.border-info-box {
  border-color: var(--info-color) !important;
}

.text-info-dark {
  color: var(--info-color) !important;
}

.border-l-info-accent {
  border-left: 4px solid var(--info-color) !important;
}

/* Warning Boxes */
.bg-warning-box {
  background-color: var(--bg-secondary) !important;
}

.border-warning-box {
  border-color: var(--warning-color) !important;
}

.text-warning-dark {
  color: var(--warning-color) !important;
}

.border-l-warning-accent {
  border-left: 4px solid var(--warning-color) !important;
}

/* Error Boxes */
.bg-error-box {
  background-color: var(--bg-secondary) !important;
}

.border-error-box {
  border-color: var(--error-color) !important;
}

.text-error-dark {
  color: var(--error-color) !important;
}

.border-l-error-accent {
  border-left: 4px solid var(--error-color) !important;
}

/* Required Field Asterisk */
.text-required {
  color: var(--error-color) !important;
}
