/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* HTMX Transitions */
.htmx-swapping {
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.htmx-settling {
  opacity: 1;
  transition: opacity 200ms ease-in;
}

.htmx-added {
  opacity: 0;
}

.htmx-added.htmx-settling {
  opacity: 1;
  transition: opacity 300ms ease-in;
}

/* Fade out animation for deleted items */
.htmx-swapping.fade-out {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}

/* Slide down animation for new items */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-down {
  animation: slideDown 300ms ease-out;
}

/* Loading indicator for HTMX requests */
.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-indicator {
  display: none;
}

/* Toast/notification animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-notification {
  animation: slideInRight 300ms ease-out;
}

/* Loading spinner */
@keyframes spin {
   0% { transform: rotate(0deg); }
   100% { transform: rotate(360deg); }
}

.spinner {
   border: 3px solid #d9b8e3;
   border-top: 3px solid #c69fd5;
   border-radius: 50%;
   width: 24px;
   height: 24px;
   animation: spin 1s linear infinite;
   display: inline-block;
   margin-left: 8px;
}

/* Enhanced button effect */
.btn-gradient {
   background: #c69fd5;
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gradient:hover {
   background: #d9b8e3;
   transform: translateY(-2px);
   box-shadow: 0 8px 20px rgba(198, 159, 213, 0.4), 0 0 20px rgba(198, 159, 213, 0.2);
}

.btn-gradient:active {
   transform: translateY(0);
   box-shadow: 0 4px 12px rgba(198, 159, 213, 0.3);
}

/* Card effects */
.card {
   background: #FEFEF5;
   border: 1px solid rgba(120, 113, 108, 0.2);
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
   border-color: rgba(198, 159, 213, 0.4);
   transform: translateY(-4px);
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 20px rgba(198, 159, 213, 0.15);
}

/* Glass morphism effect */
.glass {
   background: rgba(254, 254, 245, 0.7);
   backdrop-filter: blur(10px);
   border: 1px solid rgba(120, 113, 108, 0.2);
}

/* Glow on focus */
input:focus,
textarea:focus,
select:focus {
   outline: none;
   border-color: #c69fd5;
   box-shadow: 0 0 0 3px rgba(198, 159, 213, 0.1), 0 0 15px rgba(198, 159, 213, 0.2);
   transition: all 0.3s ease;
}

/* Better scrollbar */
::-webkit-scrollbar {
   width: 10px;
   height: 10px;
}

::-webkit-scrollbar-track {
   background: #F5F5F4;
}

::-webkit-scrollbar-thumb {
   background: #d9b8e3;
   border-radius: 5px;
   border: 2px solid #F5F5F4;
}

::-webkit-scrollbar-thumb:hover {
   background: #c69fd5;
}

/* Pulse animation for important elements */
@keyframes pulse-glow {
   0%, 100% {
     box-shadow: 0 0 10px rgba(198, 159, 213, 0.4);
   }
   50% {
     box-shadow: 0 0 20px rgba(198, 159, 213, 0.6);
   }
}

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

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.3s ease-out;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.badge:hover {
  transform: scale(1.05);
}

/* Skeleton loader */
@keyframes shimmer {
   0% {
     background-position: -1000px 0;
   }
   100% {
     background-position: 1000px 0;
   }
}

.skeleton {
   background: linear-gradient(90deg, #d9b8e3 25%, #FEFEF5 50%, #d9b8e3 75%);
   background-size: 1000px 100%;
   animation: shimmer 2s infinite;
}

/* Smooth transitions for all interactive elements */
button,
a,
input,
select,
textarea {
  transition: all 0.2s ease;
}

/* Better link hover */
a:hover {
  opacity: 0.9;
}

/* Line clamp utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
