/* =========================================================
   ServusFlow ADPAZ - Estilos Globais & Utilitários
   ========================================================= */

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: #09090b;
  color: #f4f4f5;
}

/* Scrollbars customizadas */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #f59e0b;
}

/* Efeitos Visuais & Glassmorphism */
.glow-bg {
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.03) 45%, transparent 70%);
}

.card-glass {
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.75) 0%, rgba(18, 18, 23, 0.6) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card-glass-strong {
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.85) 0%, rgba(18, 18, 23, 0.75) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.card-metric {
  background: linear-gradient(135deg, #18181b 0%, #121217 100%);
  border: 1px solid rgba(39, 39, 42, 0.8);
  transition: all 0.25s ease;
}

.card-metric:hover {
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
}

.hero-gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 40%, #f59e0b 80%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Animações de Chat */
.typing-dot {
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.msg-fade-in {
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Animações de Toast */
.toast-anim {
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =========================================================
   Skeleton Loaders & Shimmer
   ========================================================= */
.skeleton {
  background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite ease-in-out;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 6px;
  border-radius: 4px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

/* =========================================================
   Command Palette (Ctrl + K) & Badges
   ========================================================= */
.cmd-modal-backdrop {
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cmd-item {
  transition: all 0.15s ease-in-out;
}

.cmd-item:hover, .cmd-item.selected {
  background-color: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fef3c7;
}

.cmd-item.selected .cmd-icon {
  color: #f59e0b;
}

.kbd-badge {
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.4);
  font-family: ui-monospace, monospace;
}

/* =========================================================
   Realtime Pulse & Live Sync
   ========================================================= */
.live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.realtime-highlight {
  animation: highlightRow 2.5s ease-out;
}

@keyframes highlightRow {
  0% { background-color: rgba(245, 158, 11, 0.25); }
  100% { background-color: transparent; }
}

/* Impressão de Alta Fidelidade (A4) */
@media print {
  body {
    background-color: white !important;
    color: black !important;
    margin: 0;
    padding: 0;
  }
  #app-wrapper, #toast-container, header, footer, aside, nav, button, .no-print {
    display: none !important;
  }
  #print-wrapper {
    display: block !important;
    width: 100%;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  @page {
    margin: 1cm;
    size: A4;
  }
  .print-box {
    border: 1px solid #000;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .print-title {
    background: #e5e7eb !important;
    padding: 4px 8px;
    font-weight: bold;
    margin-bottom: 8px;
    border-radius: 4px;
  }
  .premium-card {
    border: 1px solid #d1d5db;
    border-radius: 12px;
    margin-bottom: 16px;
    background-color: #ffffff;
    page-break-inside: avoid;
    break-inside: avoid;
    overflow: hidden;
  }
  .premium-header {
    background-color: #f3f4f6 !important;
    padding: 12px 16px;
    border-bottom: 1px solid #d1d5db;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .premium-body {
    padding: 12px 16px;
    font-size: 10px;
  }
  .premium-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .premium-text-box {
    background-color: #f9fafb !important;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
  }
  .premium-label {
    font-weight: bold;
    color: #374151;
    margin-right: 4px;
  }
  .premium-value {
    color: #111827;
  }
}

@media screen {
  #print-wrapper {
    display: none !important;
  }
}
