@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ========================================
   PALETA OFICIAL - PeepConnect AutoDeploy
   ========================================
   Azul Neon:       #1F74FF - Botões principais, logos, títulos
   Azul Royal:      #0c192c - Base escura / Texto em cards brancos
   Cyan Elétrico:   #00E0FF - Links, ícones secundários, brilhos
   Vermelho:        #E51E2A - Alertas, erros, CTAs de urgência
   Verde Neon:      #00FF80 - Sucesso, checks, badges positivos
   Branco:          #FFFFFF - Cards, superfícies claras
   ======================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* ===== DARK MODE (Default) ===== */
  /* Fundo preto brilhante com texto claro */
  --color-bg: #000000;
  --color-surface: #0c192c;
  --color-card: #0c192c;

  /* Brand Colors */
  --color-primary: #1F74FF;
  --color-primary-glow: rgba(31, 116, 255, 0.4);
  --color-accent: #00E0FF;
  --color-cta: #E51E2A;
  --color-success: #00FF80;

  /* Text - Claro no fundo escuro */
  --color-text: #FFFFFF;
  --color-text-secondary: rgba(255, 255, 255, 0.85);
  --color-text-muted: rgba(255, 255, 255, 0.6);

  /* Glass & Borders */
  --glass-bg: rgba(12, 25, 44, 0.9);
  --glass-border: rgba(31, 116, 255, 0.25);
  --color-border: rgba(31, 116, 255, 0.15);

  /* Inputs */
  --input-bg: rgba(12, 25, 44, 0.7);
  --input-border: rgba(31, 116, 255, 0.3);
  --input-text: #FFFFFF;

  /* Gradients */
  --bg-gradient-1: rgba(31, 116, 255, 0.1);
  --bg-gradient-2: rgba(0, 224, 255, 0.08);
}

/* ===== LIGHT MODE ===== */
/* Fundo claro com texto escuro (#0c192c) */
html[data-theme="light"],
body.light-mode {
  --color-bg: #f3f6fc;
  --color-surface: #FFFFFF;
  --color-card: #FFFFFF;

  /* Brand Colors (mesmas, ajustadas para contraste) */
  --color-primary: #1F74FF;
  --color-primary-glow: rgba(31, 116, 255, 0.2);
  --color-accent: #00b8d4;
  --color-cta: #E51E2A;
  --color-success: #00c853;

  /* Text - Azul Royal Diurno no fundo claro */
  --color-text: #0c192c;
  --color-text-secondary: #1e3a5f;
  --color-text-muted: #475569;

  /* Glass & Borders */
  --glass-bg: rgba(255, 255, 255, 0.98);
  --glass-border: #dbeafe;
  --color-border: #e2e8f0;

  /* Inputs */
  --input-bg: #f8fafc;
  --input-border: #cbd5e1;
  --input-text: #0c192c;

  /* Gradients */
  --bg-gradient-1: rgba(31, 116, 255, 0.05);
  --bg-gradient-2: rgba(0, 224, 255, 0.03);
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 15% 50%, var(--bg-gradient-1), transparent 25%),
    radial-gradient(circle at 85% 30%, var(--bg-gradient-2), transparent 25%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.4);
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.glass-header {
  background: #000000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 116, 255, 0.15);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* ========================================
   GLOBAL HEADER/NAVBAR STYLES - Nova Paleta
   ======================================== */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1F74FF 0%, #00E0FF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(31, 116, 255, 0.4);
}

.navbar-title {
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-size: 1.125rem;
  line-height: 1;
}

.navbar-subtitle {
  font-size: 9px;
  color: #1F74FF;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.navbar-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.navbar-link:hover {
  color: #00E0FF;
}

.navbar-btn-primary {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: #1F74FF;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(31, 116, 255, 0.3);
}

.navbar-btn-primary:hover {
  background: #00E0FF;
  box-shadow: 0 4px 20px rgba(0, 224, 255, 0.4);
}

.credits-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 255, 128, 0.15);
  color: #00FF80;
  border: 1px solid rgba(0, 255, 128, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }

  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-left {
  opacity: 0;
  animation: slideInLeft 0.7s ease-out forwards;
}

.animate-slide-right {
  opacity: 0;
  animation: slideInRight 0.7s ease-out forwards;
}

.animate-slide-up {
  opacity: 0;
  animation: slideInUp 0.7s ease-out forwards;
}

.animate-slide-down {
  opacity: 0;
  animation: slideInDown 0.7s ease-out forwards;
}

.animate-scale-in {
  opacity: 0;
  animation: scaleIn 0.5s ease-out forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 5s ease infinite;
}

/* Stagger delays */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
}

.delay-600 {
  animation-delay: 0.6s;
}

.delay-700 {
  animation-delay: 0.7s;
}

.delay-800 {
  animation-delay: 0.8s;
}

/* Hover lift effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Card glow on hover */
.card-glow {
  transition: all 0.3s ease;
}

.card-glow:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
}

/* Form Elements */
.input-base {
  background: var(--input-bg);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  color: var(--color-text);
}

.input-base::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.input-base:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
  outline: none;
  background: var(--input-bg);
}

/* Tabs */
.tab-btn {
  position: relative;
  transition: all 0.2s ease;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  color: var(--color-text);
  background: var(--glass-border);
}

.tab-btn.active {
  color: var(--color-text);
  background: var(--glass-border);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, rgba(37, 99, 235, 1) 100%);
  color: white;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px var(--color-primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--glass-border);
  border-color: var(--color-text-muted);
}

/* Code Output */
#output_json,
.code-block,
pre {
  color: var(--color-text);
}

/* ========================================
   LIGHT MODE OVERRIDES
   Sobrescreve classes Tailwind hardcoded
   ======================================== */
html[data-theme="light"],
body.light-mode,
html:not(.dark) body:not(.dark-mode) {
  background-color: #f3f6fc !important;
}

/* Glass panels and cards in light mode */
html[data-theme="light"] .glass-panel,
body.light-mode .glass-panel,
html:not(.dark) .glass-panel {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* Header in light mode */
html[data-theme="light"] .glass-header,
body.light-mode .glass-header,
html:not(.dark) .glass-header {
  background: #ffffff !important;
  border-bottom-color: #e2e8f0 !important;
}

/* Stat cards in light mode */
html[data-theme="light"] .stat-card,
body.light-mode .stat-card,
html:not(.dark) .stat-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Input fields in light mode */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
body.light-mode input,
body.light-mode select,
body.light-mode textarea,
html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #f8fafc !important;
  border-color: #dbeafe !important;
  color: #0c192c !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder,
body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
  color: #94a3b8 !important;
}

/* Text colors in light mode */
/* Texto principal no light mode - Azul Royal */
html[data-theme="light"] .text-white,
body.light-mode .text-white {
  color: #0c192c !important;
}

html[data-theme="light"] .text-slate-300,
html[data-theme="light"] .text-slate-400,
body.light-mode .text-slate-300,
body.light-mode .text-slate-400 {
  color: #475569 !important;
}

html[data-theme="light"] .text-slate-500,
body.light-mode .text-slate-500 {
  color: #64748b !important;
}

/* Background overrides in light mode */
html[data-theme="light"] .bg-slate-900,
html[data-theme="light"] .bg-slate-950,
html[data-theme="light"] .bg-black,
body.light-mode .bg-slate-900,
body.light-mode .bg-slate-950,
body.light-mode .bg-black {
  background-color: #ffffff !important;
}

html[data-theme="light"] .bg-slate-800,
body.light-mode .bg-slate-800 {
  background-color: #f1f5f9 !important;
}

html[data-theme="light"] .bg-slate-700,
body.light-mode .bg-slate-700 {
  background-color: #e2e8f0 !important;
}

/* Border overrides in light mode */
html[data-theme="light"] .border-white\/5,
html[data-theme="light"] .border-white\/10,
html[data-theme="light"] .border-slate-700,
html[data-theme="light"] .border-slate-800,
body.light-mode .border-white\/5,
body.light-mode .border-white\/10,
body.light-mode .border-slate-700,
body.light-mode .border-slate-800 {
  border-color: #e2e8f0 !important;
}

/* Cards and stat cards in light mode */
html[data-theme="light"] [class*="bg-"][class*="/5"],
html[data-theme="light"] [class*="bg-"][class*="/10"],
html[data-theme="light"] [class*="bg-"][class*="/20"],
body.light-mode [class*="bg-"][class*="/5"],
body.light-mode [class*="bg-"][class*="/10"],
body.light-mode [class*="bg-"][class*="/20"] {
  background-color: rgba(59, 130, 246, 0.08) !important;
}

/* Cores de accent - usando paleta oficial */
html[data-theme="light"] .text-blue-400,
body.light-mode .text-blue-400 {
  color: #1F74FF !important;
}

html[data-theme="light"] .text-emerald-400,
body.light-mode .text-emerald-400 {
  color: #059669 !important;
}

html[data-theme="light"] .text-purple-400,
body.light-mode .text-purple-400 {
  color: #7c3aed !important;
}

html[data-theme="light"] .text-amber-400,
body.light-mode .text-amber-400 {
  color: #d97706 !important;
}

html[data-theme="light"] .text-red-400,
body.light-mode .text-red-400 {
  color: #dc2626 !important;
}

/* Navbar and header elements in light mode */
html[data-theme="light"] header,
html[data-theme="light"] nav,
body.light-mode header,
body.light-mode nav {
  background-color: #ffffff !important;
}

html[data-theme="light"] .navbar-title,
body.light-mode .navbar-title {
  color: #0f172a !important;
}

/* Tables in light mode */
html[data-theme="light"] table thead,
body.light-mode table thead {
  background-color: #f1f5f9 !important;
}

html[data-theme="light"] table tbody tr:hover,
body.light-mode table tbody tr:hover {
  background-color: #f8fafc !important;
}

/* Modals in light mode */
html[data-theme="light"] .modal-content,
html[data-theme="light"] [class*="modal"] .glass-panel,
body.light-mode .modal-content,
body.light-mode [class*="modal"] .glass-panel {
  background: #ffffff !important;
}

/* Ensure body text is dark in light mode */
html[data-theme="light"] body,
body.light-mode {
  color: #1e293b !important;
}

/* Code blocks stay dark in light mode for contrast */
html[data-theme="light"] pre,
html[data-theme="light"] code,
html[data-theme="light"] .code-block,
body.light-mode pre,
body.light-mode code,
body.light-mode .code-block {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}

/* ========================================
   LIGHT MODE - BOTÕES E ELEMENTOS INTERATIVOS
   Garantindo texto visível em todos os botões
   ======================================== */

/* Botões com fundo de cor transparente */
html[data-theme="light"] button,
body.light-mode button {
  color: #0c192c;
}

/* Preservar cores em botões com background colorido */
html[data-theme="light"] button.bg-blue-600,
html[data-theme="light"] button.bg-blue-500,
html[data-theme="light"] button.bg-emerald-500,
html[data-theme="light"] button.bg-red-500,
html[data-theme="light"] button.bg-purple-500,
body.light-mode button.bg-blue-600,
body.light-mode button.bg-blue-500,
body.light-mode button.bg-emerald-500,
body.light-mode button.bg-red-500,
body.light-mode button.bg-purple-500 {
  color: #ffffff !important;
}

/* Botões de exemplo/preview com texto visível */
html[data-theme="light"] .example-btn,
html[data-theme="light"] [class*="example"],
body.light-mode .example-btn,
body.light-mode [class*="example"] {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

/* Tags/badges no tema light */
html[data-theme="light"] .tag,
html[data-theme="light"] [class*="tag-"],
html[data-theme="light"] .badge,
body.light-mode .tag,
body.light-mode [class*="tag-"],
body.light-mode .badge {
  border: 1px solid #cbd5e1 !important;
}

/* Checkboxes e radio buttons */
html[data-theme="light"] input[type="checkbox"],
html[data-theme="light"] input[type="radio"],
body.light-mode input[type="checkbox"],
body.light-mode input[type="radio"] {
  accent-color: #1F74FF;
}

/* Dropdown menus */
html[data-theme="light"] .dropdown-menu,
html[data-theme="light"] [class*="dropdown"],
body.light-mode .dropdown-menu,
body.light-mode [class*="dropdown"] {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Labels em formulários */
html[data-theme="light"] label,
body.light-mode label {
  color: #334155 !important;
}

/* Tooltips */
html[data-theme="light"] [class*="tooltip"],
body.light-mode [class*="tooltip"] {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

/* Tabs botões no light mode */
html[data-theme="light"] .tab-btn,
body.light-mode .tab-btn {
  color: #475569 !important;
  background-color: transparent !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .tab-btn:hover,
body.light-mode .tab-btn:hover {
  background-color: #f1f5f9 !important;
  color: #0c192c !important;
}

html[data-theme="light"] .tab-btn.active,
body.light-mode .tab-btn.active {
  background-color: #1F74FF !important;
  color: #ffffff !important;
  border-color: #1F74FF !important;
}

/* Botões de ação nas tabelas */
html[data-theme="light"] tbody button,
body.light-mode tbody button {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] tbody button:hover,
body.light-mode tbody button:hover {
  background-color: #cbd5e1 !important;
}

/* Links no tema light */
html[data-theme="light"] a,
body.light-mode a {
  color: #1F74FF;
}

html[data-theme="light"] a:hover,
body.light-mode a:hover {
  color: #0056d6;
}

/* Preservar cores específicas de links */
html[data-theme="light"] a.text-blue-400,
html[data-theme="light"] a.text-emerald-400,
html[data-theme="light"] a.text-purple-400,
body.light-mode a.text-blue-400,
body.light-mode a.text-emerald-400,
body.light-mode a.text-purple-400 {
  color: inherit !important;
}

/* Modal overlay */
html[data-theme="light"] .bg-black\/80,
html[data-theme="light"] .bg-black\/90,
body.light-mode .bg-black\/80,
body.light-mode .bg-black\/90 {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Scrollbar no tema light */
html[data-theme="light"] ::-webkit-scrollbar-thumb,
body.light-mode ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Footer text */
html[data-theme="light"] footer,
body.light-mode footer {
  color: #64748b !important;
}

/* Role badges preservar cores */
html[data-theme="light"] .bg-gradient-to-r,
body.light-mode .bg-gradient-to-r {
  color: #ffffff !important;
}