/* ==========================================================================
   GhostSpy Panel Theme - High-End Red & Clean White
   Dedicated to Painel (Login, Dashboard, Obrigado, Admin)
   ========================================================================== */

:root, .dark {
  --background: 210 40% 98% !important;
  --foreground: 222 47% 11% !important;
  --card: 0 0% 100% !important;
  --card-foreground: 222 47% 11% !important;
  --popover: 0 0% 100% !important;
  --popover-foreground: 222 47% 11% !important;
  --primary: 211 95% 51% !important;
  --primary-foreground: 0 0% 100% !important;
  --secondary: 210 40% 96% !important;
  --secondary-foreground: 222 47% 11% !important;
  --muted: 210 40% 96% !important;
  --muted-foreground: 215 16% 47% !important;
  --accent: 214 100% 97% !important;
  --accent-foreground: 211 85% 35% !important;
  --destructive: 0 84.2% 60.2% !important;
  --destructive-foreground: 0 0% 98% !important;
  --border: 214 32% 91% !important;
  --input: 214 32% 91% !important;
  --ring: 211 95% 51% !important;
  --sidebar-background: 0 0% 100% !important;
  --sidebar-foreground: 222 47% 11% !important;
  --sidebar-primary: 211 95% 51% !important;
  --sidebar-primary-foreground: 0 0% 100% !important;
  --sidebar-accent: 214 100% 97% !important;
  --sidebar-accent-foreground: 211 85% 35% !important;
  --sidebar-border: 214 32% 91% !important;
  --sidebar-ring: 211 95% 51% !important;
}

html, body {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
}

/* Background Canvas Matrix */
#matrix-canvas, .matrix-canvas {
  opacity: 0.45 !important;
}

/* Cards & Surfaces */
.gradient-card,
.neo-card,
[class*="rounded-"][class*="border"],
.bg-card,
div[style*="background: rgb(255, 255, 255)"],
div[style*="background: #FFFFFF"] {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
}

/* High-contrast Typography */
h1, h2, h3, h4, h5, h6 {
  color: #0F172A !important;
  letter-spacing: -0.02em !important;
}

.text-muted-foreground, p, span.text-muted-foreground {
  color: #64748B !important;
}

.text-gradient {
  background: linear-gradient(135deg, #0E82F8 0%, #0D54A3 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Inputs & Form Elements */
input, textarea, select {
  background-color: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
  border-radius: 10px !important;
}

input:focus, textarea:focus, select:focus {
  border-color: #0E82F8 !important;
  box-shadow: 0 0 0 3px rgba(14, 130, 248, 0.15) !important;
  outline: none !important;
}

input::placeholder, textarea::placeholder {
  color: #94A3B8 !important;
}

/* Primary Action Buttons */
button[class*="bg-primary"],
.btn-primary,
button[type="submit"] {
  background: linear-gradient(135deg, #0E82F8 0%, #0D54A3 100%) !important;
  border: none !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 24px -4px rgba(14, 130, 248, 0.35) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

button[class*="bg-primary"]:active,
.btn-primary:active,
button[type="submit"]:active {
  transform: scale(0.98) !important;
}

/* Sidebar Styling */
aside, nav, [class*="sidebar"] {
  background-color: #FFFFFF !important;
  border-right: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

[class*="sidebar"] a[class*="active"],
[class*="sidebar"] button[class*="active"],
nav a[class*="active"] {
  background: #EFF6FF !important;
  color: #0E82F8 !important;
  font-weight: 700 !important;
}

/* Badges & Pills */
[class*="badge"] {
  background: #EFF6FF !important;
  color: #0E82F8 !important;
  border: 1px solid #BFDBFE !important;
}

/* Correções de Alto Contraste de Texto no Painel */
.text-purple-400,
.text-purple-500,
.text-violet-700,
svg.text-purple-400,
svg.text-purple-500 {
  color: #0E82F8 !important;
}

.border-purple-500,
.border-violet-200 {
  border-color: #BFDBFE !important;
}

.bg-violet-50 {
  background-color: #EFF6FF !important;
}

/* Botões primários sempre com texto branco */
button.gradient-primary,
button.gradient-primary *,
button.btn-primary,
button.btn-primary *,
button[type="submit"],
button[type="submit"] *,
.gradient-primary,
.gradient-primary * {
  color: #FFFFFF !important;
}

/* Evitar texto branco em cartões brancos para elementos soltos */
div.text-white:not(button *):not(.gradient-primary *),
span.text-white:not(button *):not(.gradient-primary *),
p.text-white:not(button *):not(.gradient-primary *),
h1.text-white:not(button *):not(.gradient-primary *),
h2.text-white:not(button *):not(.gradient-primary *),
h3.text-white:not(button *):not(.gradient-primary *) {
  color: #0F172A !important;
}

/* Links e botões de texto sublinhado */
button.underline,
button[class*="underline"],
.text-\[\#0E82F8\] {
  color: #0E82F8 !important;
}

.text-gray-100:not(button *),
.text-gray-200:not(button *),
.text-gray-300:not(button *) {
  color: #334155 !important;
}

.text-gray-400:not(button *),
.text-gray-500:not(button *) {
  color: #64748B !important;
}

/* Forçar inputs do painel sempre com fundo branco e texto legível */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1 !important;
  opacity: 1 !important;
}

input::placeholder {
  color: #94A3B8 !important;
}

/* Modais e Diálogos do Painel */
[role="dialog"],
div[data-state="open"] {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
}

/* Tabelas e Listas no Dashboard */
table {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
}

th {
  background-color: #F8FAFC !important;
  color: #475569 !important;
  border-bottom: 1px solid #E2E8F0 !important;
  font-weight: 600 !important;
}

td {
  color: #0F172A !important;
  border-bottom: 1px solid #F1F5F9 !important;
}

tr:hover td {
  background-color: #F8FAFC !important;
}

/* Links do painel */
a.text-purple-400,
button.text-purple-400 {
  color: #0E82F8 !important;
}

a.text-purple-400:hover,
button.text-purple-400:hover {
  color: #0D54A3 !important;
}

/* Cards e containers no Dashboard */
.bg-card,
.bg-background,
.gradient-card,
.neo-card {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
}

/* Separadores */
hr, .border-border, [role="separator"] {
  border-color: #E2E8F0 !important;
}
