// Form Enhancements

.form-group {
  position: relative;
  margin-bottom: var(--spacing-lg);
  
  &.has-error {
    input, textarea, select {
      border-color: #dc3545;
      
      &:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
      }
    }
  }
  
  &.has-success {
    input, textarea, select {
      border-color: var(--secondery_color);
      
      &:focus {
        border-color: var(--secondery_color);
        box-shadow: 0 0 0 0.2rem rgba(15, 228, 147, 0.25);
      }
    }
  }
}

.error-message {
  display: block;
  color: #dc3545;
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

// Input focus improvements
input, textarea, select, .form-control {
  transition: all var(--transition-fast);
  border: var(--glass-border);
  color: var(--black_800);
  
  &:focus {
    outline: none;
    border-color: var(--brand_color);
    box-shadow: 0 0 0 3px rgba(244, 25, 109, 0.1);
  }
}

// Toast Notifications
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: var(--spacing-md) var(--spacing-lg);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--long_shadow);
  z-index: var(--z-tooltip);
  transform: translateX(400px);
  transition: transform var(--transition-base);
  max-width: 350px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  
  &.show {
    transform: translateX(0);
  }
  
  &::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
  }
  
  &.toast-success {
    border-left: 4px solid var(--secondery_color);
    
    &::before {
      background: var(--secondery_color);
    }
  }
  
  &.toast-error {
    border-left: 4px solid #dc3545;
    
    &::before {
      background: #dc3545;
    }
  }
  
  &.toast-warning {
    border-left: 4px solid #ffc107;
    
    &::before {
      background: #ffc107;
    }
  }
  
  &.toast-info {
    border-left: 4px solid var(--brand_color);
    
    &::before {
      background: var(--brand_color);
    }
  }
}

// Ripple effect for buttons
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

// Loading spinner overlay
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(2px);
  
  .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--black_100);
    border-top-color: var(--brand_color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
}

// Modal improvements
.modal {
  .modal-dialog {
    transition: transform var(--transition-base);
  }
  
  &.show .modal-dialog {
    animation: modalSlideIn var(--transition-base);
  }
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

// Improved dropdown animations
.dropdown-menu {
  animation: dropdownSlideIn 0.2s ease-out;
  
  &.show {
    display: block;
  }
}

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

// Placeholder animations
@keyframes placeholderShimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.placeholder-loading {
  animation: placeholderShimmer 1.2s linear infinite forwards;
  background: linear-gradient(to right, var(--black_50) 8%, var(--black_75) 18%, var(--black_50) 33%);
  background-size: 800px 104px;
  height: 20px;
  border-radius: var(--radius-sm);
}

// Improved checkbox and radio buttons
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand_color);
  cursor: pointer;
}

// Better disabled state
:disabled,
[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

// Improved table styles
.table {
  th {
    font-weight: 600;
    color: var(--h_title);
    border-bottom: 2px solid var(--black_100);
  }
  
  tr {
    transition: background-color var(--transition-fast);
    
    &:hover {
      background-color: var(--black_25);
    }
  }
}

// Progress bars
.progress-bar {
  height: 8px;
  background: var(--black_75);
  border-radius: var(--radius-full);
  overflow: hidden;
  
  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand_color), var(--brand_color_700));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
    
    &::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
      animation: progressShine 1.5s infinite;
    }
  }
}

@keyframes progressShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
