/* BK-Leads Custom Styles */

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Sidebar transition */
.sidebar-transition {
  transition:
    width 0.3s ease,
    transform 0.3s ease;
}

/* Page transitions */
[x-cloak] {
  display: none !important;
}

/* Chart container */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

/* Table row hover */
.table-row-hover:hover {
  background-color: #f8fafc;
}

/* Badge base */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
}
.badge-success {
  background-color: #dcfce7;
  color: #166534;
}
.badge-error {
  background-color: #fee2e2;
  color: #991b1b;
}
.badge-warning {
  background-color: #fef9c3;
  color: #854d0e;
}
.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Modal backdrop */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* KPI card icon background */
.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Animate spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* Login background gradient */
.login-bg {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #06b6d4 100%);
}

/* Sidebar active item */
.sidebar-active {
  background-color: rgba(255, 255, 255, 0.15);
  border-right: 3px solid #fff;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* JSON display */
.json-display {
  background-color: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

/* Tab active */
.tab-active {
  border-bottom: 2px solid #4f46e5;
  color: #4f46e5;
  font-weight: 600;
}
.tab-inactive {
  border-bottom: 2px solid transparent;
  color: #64748b;
}
.tab-inactive:hover {
  color: #334155;
  border-bottom-color: #cbd5e1;
}

/* Skeleton loading shimmer */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.375rem;
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Dark mode variants */
.dark .skeleton {
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
}
.dark .badge-success {
  background-color: #166534;
  color: #dcfce7;
}
.dark .badge-error {
  background-color: #991b1b;
  color: #fee2e2;
}
.dark .badge-warning {
  background-color: #854d0e;
  color: #fef9c3;
}
.dark .badge-info {
  background-color: #1e40af;
  color: #dbeafe;
}
.dark .table-row-hover:hover {
  background-color: #1e293b;
}
.dark .json-display {
  background-color: #0f172a;
}
.dark .tab-active {
  border-bottom-color: #818cf8;
  color: #818cf8;
}
.dark .tab-inactive {
  color: #94a3b8;
}
.dark .tab-inactive:hover {
  color: #e2e8f0;
  border-bottom-color: #475569;
}
.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}
.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.dark .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton {
    animation: none;
  }
}
