/* CRM Tool Theme - Modern Advanced Design */
:root {
  /* Border Radius */
  --app-rounded: 0.875rem;
  --app-rounded-lg: 1rem;
  --app-rounded-xl: 1.25rem;
  
  /* Shadows */
  --app-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --app-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --app-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --app-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --app-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --app-shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  
  /* Transitions */
  --app-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --app-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --app-transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  
  /* Spacing */
  --app-spacing-xs: 0.5rem;
  --app-spacing-sm: 0.75rem;
  --app-spacing: 1rem;
  --app-spacing-lg: 1.5rem;
  --app-spacing-xl: 2rem;
  
  /* Vibrant Colors from TailAdmin */
  --app-color-primary: #3641f5; /* brand-600 */
  --app-color-success: #039855; /* success-600 */
  --app-color-warning: #dc6803; /* warning-600 */
  --app-color-danger: #d92d20; /* error-600 */
  --app-color-info: #0086c9; /* blue-light-600 */
  --app-color-purple: #7a5af8; /* theme-purple-500 */
  --app-color-pink: #ee46bc; /* theme-pink-500 */
  --app-color-secondary: #475467; /* gray-600 */

  /* Backgrounds from TailAdmin */
  --card-bg: #ffffff; /* white */
  --text-color: #101828; /* black */
}

/* Dark mode color customization from TailAdmin */
.dark {
  --tw-bg-opacity: 1;
  --tw-text-opacity: 1;
  --glass-bg: rgba(26, 34, 49, 0.8); /* gray-dark with opacity */
  --glass-border: rgba(75, 85, 99, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --card-bg-dark: #1a2231; /* gray-dark */
  --text-color-dark: #f9fafb; /* gray-50 */
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100 dark:bg-gray-800;
}

::-webkit-scrollbar-thumb {
  @apply bg-gray-400 dark:bg-gray-600 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-500 dark:bg-gray-500;
}

/* Smooth transitions for theme switching */
* {
  transition: background-color var(--app-transition), 
              border-color var(--app-transition),
              color var(--app-transition),
              transform var(--app-transition),
              box-shadow var(--app-transition);
}

/* Glassmorphism utility */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.dark .glass-strong {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(75, 85, 99, 0.4);
}

/* Modern gradient backgrounds */
.gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.gradient-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.gradient-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* Dashboard card enhancements with colorful accents */
.dashboard-card {
  background-color: var(--card-bg);
  color: var(--text-color);
  box-shadow: var(--app-shadow-md);
  border-radius: var(--app-rounded-xl);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  transition: all var(--app-transition-slow);
  border-left: 5px solid;
}

.dark .dashboard-card {
  background-color: var(--card-bg-dark);
  color: var(--text-color-dark);
}

.dashboard-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--app-shadow-xl);
}

.dashboard-card.primary {
  border-color: #3b82f6;
}

.dashboard-card.success {
  border-color: #10b981;
}

.dashboard-card.warning {
  border-color: #f59e0b;
}

.dashboard-card.danger {
  border-color: #ef4444;
}

.dashboard-card.info {
  border-color: #06b6d4;
}

.dashboard-card.secondary {
  border-color: #6b7280;
}

.dashboard-card.purple {
  border-color: #8b5cf6;
}

.dashboard-card.pink {
  border-color: #ec4899;
}

/* Loading spinner with modern design */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 4px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-sm {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 3px;
}

.spinner-lg {
  width: 3rem;
  height: 3rem;
  border-width: 5px;
}

/* Modern badge styles with shadows */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  box-shadow: var(--app-shadow-sm);
  transition: all var(--app-transition);
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--app-shadow);
}

.badge-primary {
  background-color: #dbeafe;
  color: #1e40af;
}

.dark .badge-primary {
  background-color: #1e3a8a;
  color: #bfdbfe;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.dark .badge-success {
  background-color: #064e3b;
  color: #a7f3d0;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.dark .badge-warning {
  background-color: #78350f;
  color: #fde68a;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.dark .badge-danger {
  background-color: #7f1d1d;
  color: #fecaca;
}

.badge-info {
  background-color: #cffafe;
  color: #155e75;
}

.dark .badge-info {
  background-color: #164e63;
  color: #a5f3fc;
}

.badge-purple {
  background-color: #ede9fe;
  color: #5b21b6;
}

.dark .badge-purple {
  background-color: #4c1d95;
  color: #ddd6fe;
}

/* Advanced animation utilities */
@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-slide-in {
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-in-right {
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-up {
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Skeleton loader for loading states */
.skeleton {
  background: linear-gradient(90deg, 
    #f3f4f6 0%, 
    #e5e7eb 20%, 
    #f3f4f6 40%, 
    #f3f4f6 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s linear infinite;
  border-radius: var(--app-rounded);
}

.dark .skeleton {
  background: linear-gradient(90deg, 
    #374151 0%, 
    #4b5563 20%, 
    #374151 40%, 
    #374151 100%
  );
  background-size: 1000px 100%;
}

/* Focus visible for accessibility with modern ring */
*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
  border-radius: var(--app-rounded);
}

.dark *:focus-visible {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.5);
}

/* Modern hover effects */
.hover-lift {
  transition: all var(--app-transition);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--app-shadow-lg);
}

.hover-glow {
  position: relative;
  transition: all var(--app-transition);
}

.hover-glow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--app-transition);
  pointer-events: none;
  border-radius: inherit;
}

.hover-glow:hover::after {
  opacity: 1;
}

/* Floating label effect */
.floating-label {
  position: relative;
}

.floating-label input:focus ~ label,
.floating-label input:not(:placeholder-shown) ~ label,
.floating-label textarea:focus ~ label,
.floating-label textarea:not(:placeholder-shown) ~ label {
  transform: translateY(-1.5rem) scale(0.85);
  color: #3b82f6;
}

.floating-label label {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transition: all var(--app-transition);
  pointer-events: none;
  background: white;
  padding: 0 0.25rem;
}

.dark .floating-label label {
  background: #1f2937;
}

/* Select2 Dark Mode Styles */
.dark .select2-container--default .select2-selection--multiple {
  background-color: #1f2937 !important;
  border-color: #4b5563 !important;
  color: #f9fafb !important;
}

.dark .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #4f46e5 !important;
  border-color: #4338ca !important;
  color: #ffffff !important;
}

.dark .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #e0e7ff !important;
}

.dark .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #ffffff !important;
}

.dark .select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: #6366f1 !important;
}

.dark .select2-dropdown {
  background-color: #1f2937 !important;
  border-color: #4b5563 !important;
}

.dark .select2-container--default .select2-results__option {
  color: #f9fafb !important;
  background-color: #1f2937 !important;
}

.dark .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
}

.dark .select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #312e81 !important;
  color: #e0e7ff !important;
}

.dark .select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: #374151 !important;
  border-color: #4b5563 !important;
  color: #f9fafb !important;
}

.dark .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
  color: #9ca3af !important;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .glass,
  .glass-strong {
    background: white !important;
    backdrop-filter: none !important;
  }
}
