.slide-toggle-container {
  display: inline-flex;
  align-items: center;
  
  &.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    
    .slide-toggle-wrapper {
      cursor: not-allowed;
    }
  }
}

.slide-toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  
  &.label-before {
    flex-direction: row;
    
    .label-text {
      margin-right: 12px;
    }
  }
  
  &.label-after {
    flex-direction: row;
    
    .label-text {
      margin-left: 12px;
    }
  }
}

.label-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #333);
  transition: color 0.2s ease;
}

.slide-toggle-wrapper {
  outline: none;
  cursor: pointer;
  pointer-events: auto !important;
  position: relative;
  z-index: 1;
  
  &:focus-visible {
    .slide-toggle-track {
      box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 0, 123, 255), 0.2);
    }
  }
}

.slide-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: #ccc;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  
  // Estados de cor
  &.color-primary {
    &.checked {
      background-color: var(--primary-color, #007bff);
    }
  }
  
  &.color-accent {
    &.checked {
      background-color: var(--accent-color, #17a2b8);
    }
  }
  
  &.color-warn {
    &.checked {
      background-color: var(--warn-color, #dc3545);
    }
  }
  
  // Hover effects
  &:hover:not(.disabled) {
    background-color: #bbb;
    
    &.checked {
      filter: brightness(1.1);
    }
  }
}

.slide-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  
  &.checked {
    transform: translateX(20px);
  }
}

// Dark theme support
@media (prefers-color-scheme: dark) {
  .label-text {
    color: var(--text-primary-dark, #f8f9fa);
  }
  
  .slide-toggle-track {
    background-color: #555;
    
    &:hover:not(.disabled) {
      background-color: #666;
    }
  }
  
  .slide-toggle-thumb {
    background-color: #f8f9fa;
  }
}

// Responsive design
@media (max-width: 768px) {
  .slide-toggle-track {
    width: 40px;
    height: 22px;
    border-radius: 11px;
  }
  
  .slide-toggle-thumb {
    width: 18px;
    height: 18px;
    
    &.checked {
      transform: translateX(18px);
    }
  }
  
  .label-text {
    font-size: 13px;
  }
}

// Animation for smoother interaction
.slide-toggle-track {
  &::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 18px;
    background: transparent;
    transition: background-color 0.2s ease;
  }
  
  &:active::before {
    background-color: rgba(0, 0, 0, 0.05);
  }
  
  &.checked:active::before {
    background-color: rgba(var(--primary-rgb, 0, 123, 255), 0.1);
  }
} 