/* ERP Spark global styles */

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.6); }

.dark ::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); }
.dark ::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.5); }

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fade-in 0.4s ease-out; }

@keyframes slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.animate-slide-in { animation: slide-in 0.3s ease-out; }

/* Glassmorphism */
.glass {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.7);
}
.dark .glass {
  background: rgba(15, 23, 42, 0.7);
}

/* Brand gradient */
.gradient-brand {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
}
.text-gradient-brand {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Drag indicators */
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }
.drag-over { background-color: rgba(99,102,241,0.1); border: 2px dashed #6366f1; }
.dragging { opacity: 0.4; }

/* Toast */
.toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 9999;
  display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px; max-width: 400px;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  display: flex; align-items: center; gap: 0.75rem;
  animation: slide-in 0.3s ease-out;
  background: white;
}
.dark .toast { background: rgb(30,41,59); color: white; }
.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-info { border-left: 4px solid #6366f1; }
.toast-warning { border-left: 4px solid #f59e0b; }

/* Modal backdrop */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fade-in 0.2s ease-out;
}
.modal-panel {
  background: white;
  border-radius: 1rem;
  max-width: 90vw; max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: fade-in 0.3s ease-out;
}
.dark .modal-panel { background: rgb(30,41,59); color: white; }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  transition: all 0.2s;
  box-shadow: 0 4px 14px 0 rgba(99,102,241,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(99,102,241,0.4);
}
.btn-primary:active { transform: translateY(0); }

/* Field type icons (for builder) */
.field-type-card {
  transition: all 0.2s;
  border: 2px solid transparent;
}
.field-type-card:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(99,102,241,0.3);
}
.field-type-card.selected {
  border-color: #6366f1;
  background: rgba(99,102,241,0.05);
}

/* Loading spinner */
.spinner {
  border: 3px solid rgba(99,102,241,0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  width: 28px; height: 28px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Print styles */
@media print {
  .no-print { display: none !important; }
}
