// Utility Classes for Better UX

// Loading states
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
  
  &::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--brand_color);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

// Card shadows with hover effect
.card-hover {
  transition: all var(--transition-base);
  
  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  }
}

// Focus states
.focus-ring {
  &:focus {
    outline: 2px solid var(--brand_color);
    outline-offset: 2px;
  }
}

// Smooth hover transitions
.hover-lift {
  transition: transform var(--transition-base);
  
  &:hover {
    transform: translateY(-2px);
  }
}

.hover-scale {
  transition: transform var(--transition-base);
  
  &:hover {
    transform: scale(1.05);
  }
}

// Image overlays
.img-overlay {
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 1;
  }
  
  &:hover::before {
    opacity: 1;
  }
  
  img {
    transition: transform var(--transition-slow);
  }
  
  &:hover img {
    transform: scale(1.1);
  }
}

// Text utilities
.text-gradient {
  background: linear-gradient(135deg, var(--brand_color) 0%, var(--brand_color_700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

// Skeleton loading
.skeleton {
  background: linear-gradient(90deg, var(--black_50) 25%, var(--black_75) 50%, var(--black_50) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

// Badge styles
.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand_color);
  
  &.badge-success {
    background: var(--secondery_color);
  }
  
  &.badge-warning {
    background: #ffc107;
  }
  
  &.badge-danger {
    background: #dc3545;
  }
}

// Pulse animation for notifications
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

// Fade in animation
.fade-in {
  animation: fadeIn var(--transition-base);
}

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

// Glass morphism effect
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

// Shadow utilities
.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

// Interactive states
.clickable {
  cursor: pointer;
  user-select: none;
  
  &:active {
    transform: scale(0.98);
  }
}

// Tooltip base
.tooltip-base {
  position: relative;

  &::before,
  &::after {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
  }

  &:hover::before,
  &:hover::after {
    opacity: 1;
  }
}

/* ---- Smooth accordion / collapse transitions ---- */
.collapsing {
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.accordion-button {
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}
.accordion-button::after {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
/* -------------------------------------------------- */
